Skip to content
Snippets Groups Projects
Commit 390c82ae authored by Mark Beierl's avatar Mark Beierl Committed by garciaale
Browse files

Adding automatic build of VNF repository on commit

Installs OSM client to perform repo-index
Moves the Magma subfolder content to the top level so it will be
included in the final build
Calls osm repo-index to build all packages and index
Uses sftp to publish content to https://osm.etsi.org/vnf-catalog/Testing/
parent af05fbcc
No related branches found
No related tags found
2 merge requests!106Sol006 merge,!96Sshconfig
###############################################################################
publish-repository:
# Builds the repository and pushes it to ftp site when a MR is accepted
image: ubuntu:18.04
stage: deploy
script:
- DEBIAN_FRONTEND=noninteractive apt update
- DEBIAN_FRONTEND=noninteractive apt install -y python3-pip sshpass software-properties-common wget
- python3 -m pip install python-magic pyangbind verboselogs
- wget -qO - https://osm-download.etsi.org/repository/osm/debian/ReleaseEIGHT/OSM%20ETSI%20Release%20Key.gpg | apt-key add -
- add-apt-repository -y "deb [arch=amd64] https://osm-download.etsi.org/repository/osm/debian/ReleaseEIGHT stable devops IM osmclient"
- DEBIAN_FRONTEND=noninteractive apt update
- DEBIAN_FRONTEND=noninteractive apt install -y python3-osmclient
- mv magma/* .
- LC_ALL=C.UTF-8 oLANG=C.UTF-8 osm repo-index --origin . --destination vnf-catalog
- |
sshpass -p "$VNF_CATALOG_CREDENTIALS" sftp -o "StrictHostKeyChecking no" -P 29419 osmsupport@vnf-catalog.etsi.org << EOF
put -r vnf-catalog/* Testing
EOF
rules:
- if: '$CI_COMMIT_REF_PROTECTED == "true"'
when: on_success
###############################################################################
build-local-repository:
# Builds the repository locally but does not push if this is a new MR that
# is still in development
image: ubuntu:18.04
stage: build
script:
- DEBIAN_FRONTEND=noninteractive apt update
- DEBIAN_FRONTEND=noninteractive apt install -y python3-pip sshpass software-properties-common wget
- python3 -m pip install python-magic pyangbind verboselogs
- wget -qO - https://osm-download.etsi.org/repository/osm/debian/ReleaseEIGHT/OSM%20ETSI%20Release%20Key.gpg | apt-key add -
- add-apt-repository -y "deb [arch=amd64] https://osm-download.etsi.org/repository/osm/debian/ReleaseEIGHT stable devops IM osmclient"
- DEBIAN_FRONTEND=noninteractive apt update
- DEBIAN_FRONTEND=noninteractive apt install -y python3-osmclient
- mv magma/* .
- LC_ALL=C.UTF-8 oLANG=C.UTF-8 osm repo-index --origin . --destination vnf-catalog
rules:
- if: '$CI_COMMIT_REF_PROTECTED == "false"'
when: on_success
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment