Commit 353ab352 authored by Alessandro Elias's avatar Alessandro Elias
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 !5
parents 21785ec9 a5b0f1d9
Pipeline #12839 failed with stages
in 6 minutes and 11 seconds
#!/bin/bash
# This script generates a .deb package
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]*')
tar --exclude=debian -czf ${PACKAGE}_${VERSION}.orig.tar.gz package/*
cd package
debuild -us -uc
cd ../
mkdir build/
mv ${PACKAGE}* build/
#!/bin/bash
# This script uploads an includes a .deb package in our debian repository.
# The distribution is chosen based on the gitlab-ci stage we are on.
apt-get update && apt-get install -y dput ssh
eval $(ssh-agent -s)
ssh-add <(echo "$PRIV_KEY")
echo "Deploy job name: $CI_JOB_NAME"
if [ "$CI_JOB_NAME" = "deploy_for_testing" ]; then
dput -u -f --config=dput.cf repo build/*.changes
elif [ "$CI_JOB_NAME" = "deploy_for_stable" ]; then
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]*')
REPREPRO_CMD="reprepro -Vb /home/repository/www/le6 copysrc stable testing $PACKAGE $VERSION"
ssh -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa repository@repo.c3sl.ufpr.br "$REPREPRO_CMD"
fi
......@@ -14,18 +14,8 @@ build:
- ubuntu
- regular
script:
- if [ ! -d "package/debian/" ] ; then exit 1; fi
# TODO: find a way to get the dependencies automatically
- apt-get update && apt-get install -y build-essential devscripts dh-make dh-python dh-systemd quilt python-setuptools cdbs po4a python-utidylib
- 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
test:
stage: test
......@@ -36,23 +26,29 @@ test:
# TODO: find a way to get the dependencies automatically
- apt-get update && apt-get install -y gir1.2-webkit-3.0
- dpkg -i build/*.deb
- echo "Estágio de Teste finalizado"
dependencies:
- build
deploy:
deploy_for_testing:
stage: deploy
only:
- master
tags:
- ubuntu
- regular
only:
- master
- debian-packaging
script:
- ./.deploy.sh
dependencies:
- build
deploy_for_stable:
stage: deploy
when: manual
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
[repo]
fqdn = repo.c3sl.ufpr.br
method = scp
login = repository
incoming = /home/repository/www/le6/incoming
allow_unsigned_uploads = 1
ssh_config_options = User=repository
StrictHostKeyChecking=no
post_upload_command = ssh -l repository -i ~/.ssh/id_rsa repo.c3sl.ufpr.br "reprepro -Vb /home/repository/www/le6 processincoming default"
\ No newline at end of file
post_upload_command = ssh -l repository -i ~/.ssh/id_rsa repo.c3sl.ufpr.br "reprepro -Vb /home/repository/www/le6 processincoming default"
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