Skip to content
Snippets Groups Projects
Commit e2a01ca7 authored by Diego Giovane Pasqualin's avatar Diego Giovane Pasqualin
Browse files

Merge branch 'issue/230' into 'master'

SCRUM#230: add job on .gitlab-ci.yml to deploy package to stable repository.

See merge request !3
parents 31bd4945 ec7271ec
No related branches found
No related tags found
1 merge request!3SCRUM#230: add job on .gitlab-ci.yml to deploy package to stable repository.
Pipeline #
#!/usr/bin/bash
apt-get update && apt-get install -y devscripts
CHANGELOG="package/debian/changelog"
LINE=$(head -n 1 $CHANGELOG)
PACKAGE=$(echo $LINE | cut -d' ' -f1)
VERSION=$(echo $LINE | cut -d' ' -f2 | grep -o -E '[0-9]*\.[0-9]*\.[0-9]*')
if [ $CI_JOB_NAME = "build_for_stable" ]; then
sed 's/testing; urgen/stable; urgen/' $CHANGELOG > $CHANGELOG
fi
tar --exclude=debian -czf ${PACKAGE}_${VERSION}.orig.tar.gz package/*
cd package
debuild -us -uc
cd ../
mkdir build/
mv ${PACKAGE}* build/
#!/usr/bin/bash
apt-get update && apt-get install -y dput ssh
eval $(ssh-agent -s)
ssh-add <(echo "$PRIV_KEY")
dput -u -f --config=dput.cf repo build/*.changes
......@@ -4,7 +4,7 @@ stages:
- test
- deploy
build:
build_for_testing:
stage: build
artifacts:
paths:
......@@ -12,17 +12,17 @@ build:
tags:
- debian-packaging
script:
- apt-get update && apt-get install -y devscripts
- LINE=$(head -n 1 package/debian/changelog)
- PACKAGE=$(echo $LINE | cut -d' ' -f1)
- VERSION=$(echo $LINE | cut -d' ' -f2 | grep -o -E '[0-9]*\.[0-9]*\.[0-9]*')
- tar --exclude=debian -czf ${PACKAGE}_${VERSION}.orig.tar.gz package/*
- cd package
- debuild -us -uc --lintian-opts --suppress-tags package-installs-apt-preferences
- cd ../
- mkdir build/
- mv ${PACKAGE}* build/
- echo "Estágio de Build finalizado."
- ./.build.sh
build_for_stable:
stage: build
artifacts:
paths:
- build/
tags:
- debian-packaging
script:
- ./.build.sh
test:
stage: test
......@@ -32,11 +32,10 @@ test:
script:
- apt-get update && apt-get install -y unattended-upgrades
- dpkg -i build/*.deb
- echo "Estágio de Teste finalizado"
dependencies:
- build
- build_for_testing
deploy:
deploy_for_testing:
stage: deploy
only:
- master
......@@ -44,11 +43,20 @@ deploy:
- ubuntu
- regular
script:
- echo "Estágio de Deploy"
- apt-get update && apt-get install -y dput ssh
- eval $(ssh-agent -s)
- ssh-add <(echo "$PRIV_KEY")
- dput -u -f --config=dput.cf repo build/*.changes
- echo "Estágio de Deploy finalizado"
- ./.deploy.sh
dependencies:
- build
- build_for_testing
deploy_for_stable:
stage: deploy
when: manual
only:
- master
tags:
- ubuntu
- regular
script:
- ./.deploy.sh
dependencies:
- build_for_stable
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