Commit 054b2d6a 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 !7
parents c814504c af5219d8
Pipeline #12372 failed with stages
in 21 minutes and 15 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
......@@ -18,15 +18,7 @@ build:
# TODO: find a way to get the dependencies automatically
# - apt-get update && apt-get --allow-downgrades --allow-remove-essential --allow-change-held-packages install -y libc6=2.23-0ubuntu9 libc-bin=2.23-0ubuntu9
- apt-get update && apt-get install -y build-essential devscripts dh-make dh-systemd quilt adwaita-icon-theme apt autopoint bf-utf-source check dctrl-tools debconf debconf-utils debhelper devio dh-autoreconf dh-di dh-systemd dpkg-dev gir1.2-soup-2.4 gir1.2-timezonemap-1.0 gir1.2-webkit2-4.0 gir1.2-xkl-1.0 gobject-introspection imagemagick intltool intltool-debian iso-codes isoquery keymapper libbogl-dev libcairo2-dev libdebconfclient0-dev libdebian-installer4-dev libgirepository1.0-dev libglib2.0-dev libgtk-3-dev libido3-0.1-dev libindicator3-dev libiw-dev liblocale-gettext-perl libparted-dev librsvg2-bin libsubunit-dev locales pep8 pkg-config po-debconf pyflakes3 python-gi-dev python-scour python3-all python3-apt python3-cairo python3-dbus python3-gi python3-gi-cairo python3-icu python3-mock python3-pam tzdata ubuntu-artwork udev wget xkb-data xkb-data-i18n xvfb
- 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
......@@ -35,25 +27,29 @@ test:
- regular
script:
# TODO: find a way to get the dependencies automatically
- export DEBIAN_FRONTEND=noninteractive
- apt-get update && apt-get -q -y install libc6 libdebconfclient0 libdebian-installer4 libiw30 libparted-fs-resize0 libparted2 debconf init-system-helpers lsb-base python3:any ubiquity-frontend-gtk ubiquity-artwork-2.21.63.4 laptop-detect lsb-release ubiquity-casper python3-apt console-setup iso-codes passwd adduser os-prober rdate ntfs-3g ecryptfs-utils cryptsetup policykit-1 python3-icu python3-pam language-selector-common archdetect-deb dpkg-repack apt-clone wget grub-common dbus-x11 sbsigntool python3-aptdaemon.gtk3widgets genisoimage apt-utils bogl-bterm tasksel python3-pyqt4 kwin-x11 kwin xauth python3-dbus.mainloop.qt
- dpkg -i build/*.deb
- echo "Estágio de Teste finalizado"
- apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install $(pwd)/build/*.deb
dependencies:
- build
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
deploy_for_stable:
stage: deploy
when: manual
only:
- master
tags:
- debian-packaging
script:
- ./.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
......
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