Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OSM Packages
Manage
Activity
Members
Labels
Plan
Issues
1
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
17
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vnf-onboarding
OSM Packages
Commits
78850a71
Commit
78850a71
authored
4 months ago
by
garciadeblas
Browse files
Options
Downloads
Patches
Plain Diff
Feature 11048: Publication of OSM packages as public VNF catalog
parent
3c6679c2
No related branches found
No related tags found
1 merge request
!236
Feature 11048: Publication of OSM packages as public VNF catalog
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+78
-43
78 additions, 43 deletions
.gitlab-ci.yml
with
78 additions
and
43 deletions
.gitlab-ci.yml
+
78
−
43
View file @
78850a71
###############################################################################
publish-repository
:
# Builds the repository and pushes it to ftp site when a MR is accepted
image
:
ubuntu:22.04
stage
:
deploy
script
:
-
DEBIAN_FRONTEND=noninteractive apt update
-
DEBIAN_FRONTEND=noninteractive apt install -y gcc git make python3 python3 python3-pip python3-pycurl python3-setuptools sshpass software-properties-common wget
-
git submodule init
-
git submodule update
-
git clone https://osm.etsi.org/gerrit/osm/osmclient.git
-
pip3 install -r osmclient/requirements.txt -r osmclient/requirements-dev.txt
-
pip3 install osmclient/
-
rm -rf osmclient/
-
./generate-packages.sh
-
mkdir temp
# - mv magma/* temp
-
mv *.tar.gz charm-packages/*.tar.gz temp
-
LC_ALL=C.UTF-8 LANG=C.UTF-8 osm -vvv repo-index --origin temp --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
# Global variables
###############################################################################
variables
:
DEBIAN_FRONTEND
:
"
noninteractive"
LC_ALL
:
"
C.UTF-8"
LANG
:
"
C.UTF-8"
REPOSITORY_URL
:
"
https://osm.etsi.org/gerrit/osm/osmclient.git"
SFTP_SERVER
:
"
vnf-catalog.etsi.org"
SFTP_PORT
:
"
29419"
SFTP_USER
:
"
osmsupport"
ONDEMAND_DESTINATION_FOLDER
:
"
Stable"
###############################################################################
# Anchor definition with common commands
###############################################################################
.default-script
:
&default_script
-
apt update && apt install -y gcc git make python3 python3 python3-pip python3-pycurl python3-setuptools software-properties-common wget
-
git submodule init
-
git submodule update
-
git clone https://osm.etsi.org/gerrit/osm/osmclient.git
-
pip3 install -r osmclient/requirements.txt -r osmclient/requirements-dev.txt
-
pip3 install osmclient/
-
rm -rf osmclient/
-
./generate-packages.sh
-
mkdir temp
# - mv magma/* temp
-
mv *.tar.gz charm-packages/*.tar.gz temp
-
osm -vvv repo-index --origin temp --destination vnf-catalog
-
rm -rf temp
###############################################################################
# Job to build artifacts
###############################################################################
build-local-repository
:
# Builds the repository locally but does not push if this is a new MR that
# is still in development
image
:
python:3.10
stage
:
build
script
:
*default_script
artifacts
:
paths
:
-
vnf-catalog/
# rules:
# - if: '$CI_COMMIT_REF_PROTECTED == "false"'
# when: on_success
###############################################################################
# Job to publish artifacts on successful merge (publication to Testing)
###############################################################################
publish-testing-repository
:
# Builds the repository and pushes it to ftp site when a MR is accepted
image
:
ubuntu:22.04
stage
:
deploy
dependencies
:
-
build-local-repository
# Reuses artifacts generated in build los artefactos generados en build
script
:
-
DEBIAN_FRONTEND=noninteractive apt update
-
DEBIAN_FRONTEND=noninteractive apt install -y gcc git make python3 python3 python3-pip python3-pycurl python3-setuptools sshpass software-properties-common wget
-
git submodule init
-
git submodule update
-
git clone https://osm.etsi.org/gerrit/osm/osmclient.git
-
pip3 install -r osmclient/requirements.txt -r osmclient/requirements-dev.txt
-
pip3 install osmclient/
-
rm -rf osmclient/
-
./generate-packages.sh
-
mkdir temp
# - mv magma/* temp
-
mv *.tar.gz charm-packages/*.tar.gz temp
-
LC_ALL=C.UTF-8 LANG=C.UTF-8 osm -vvv repo-index --origin temp --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/Premerge
# EOF
-
apt update && apt install -y sshpass
-
|
sshpass -p "$VNF_CATALOG_CREDENTIALS" sftp -o "StrictHostKeyChecking no" -P $SFTP_PORT $SFTP_USER@$SFTP_SERVER << EOF
put -r vnf-catalog/* Testing
EOF
rules
:
-
if
:
'
$CI_COMMIT_REF_
PROTECTED
==
"false"'
-
if
:
'
$CI_COMMIT_REF_
NAME
==
"master"'
# Only in master
when
:
on_success
# - if: '$CI_COMMIT_REF_PROTECTED == "true"'
# when: on_success
###############################################################################
# Job to publish artifacts on demand (publication to Testing)
###############################################################################
publish-ondemand-repository
:
image
:
ubuntu:22.04
stage
:
deploy
dependencies
:
-
build-local-repository
script
:
-
apt update && apt install -y sshpass
-
|
DESTINATION_FOLDER="${ONDEMAND_DESTINATION_FOLDER:-Testing}"
echo "Uploading files to folder $DESTINATION_FOLDER in FTP ..."
sshpass -p "$VNF_CATALOG_CREDENTIALS" sftp -o "StrictHostKeyChecking no" -P $SFTP_PORT $SFTP_USER@$SFTP_SERVER << EOF
put -r vnf-catalog/* $DESTINATION_FOLDER
EOF
when
:
manual
# This job is run on demand
allow_failure
:
true
environment
:
name
:
production
url
:
"
ftp://$SFTP_SERVER/$DESTINATION_FOLDER"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment