Commit 35a10d5e authored by Luan Varaschim Welter's avatar Luan Varaschim Welter
Browse files

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

parent fa114582
Pipeline #11516 passed with stages
in 35 seconds
......@@ -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
- 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
......@@ -31,22 +31,29 @@ test:
- regular
script:
- dpkg -i build/*.deb
- echo "Estágio de Teste finalizado"
dependencies:
- build
- build_for_testing
deploy:
deploy_for_testing:
stage: deploy
only:
- master
tags:
- debian-packaging
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:
- debian-packaging
script:
- ./deploy.sh
dependencies:
- build_for_stable
#!/usr/bin/bash
#generate debian package for stable and testing build
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 -i 's/testing; urgen/stable; urgen/g' $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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment