Commit 7d9679cc authored by Lucas Fernandes de Oliveira's avatar Lucas Fernandes de Oliveira

Merge branch 'develop' into 'master'

SCRUM#649 creating le_version file

See merge request !2
parents ecce6bf6 734d3f98
Pipeline #19211 passed with stages
in 1 minute and 17 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 || exit 1
debuild -us -uc --lintian-opts --profile debian
cd ../ || exit 1
mkdir build/
mv "${PACKAGE}"* build/
#!/bin/bash
# shellcheck disable=SC2029
# 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_unstable" ]; then
dput -u -f --config=dput.cf repo build/*.changes
else
if [ "$CI_JOB_NAME" = "deploy_for_testing" ]; then
REPO_SRC="unstable"
REPO_TGT="testing"
elif [ "$CI_JOB_NAME" = "deploy_for_stable" ]; then
REPO_SRC="testing"
REPO_TGT="stable"
fi
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 $REPO_TGT $REPO_SRC $PACKAGE $VERSION"
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null repository@repo.c3sl.ufpr.br "$REPREPRO_CMD"
fi
package/debian/files
package/debian/debhelper-build-stamp
le-*.tar.gz
le-*.build
le-*.dsc
le-*.changes
le-*.deb
le-*.debhelper.log
le-*.substvars
build/
## Template para empacotamento utilizando o Gitlab-ci.
stages:
- lint
- build
- test
- deploy
lint_shell:
stage: lint
tags:
- debian-packaging
script:
- ./.linter_shell.sh
build:
stage: build
artifacts:
paths:
- build/
tags:
- debian-packaging
script:
- apt-get update && apt-get install -y devscripts debhelper dh-systemd python-distutils-extra pandoc
- ./.build.sh
test:
stage: test
tags:
- ubuntu
- regular
script:
- apt-get update && apt-get install -y wget
- echo "deb http://repo.c3sl.ufpr.br/le6/ unstable main" > /etc/apt/sources.list.d/le6.list
- wget -O- http://repo.c3sl.ufpr.br/le6/le.c3sl.ufpr.br.key | apt-key add -
- echo "Installation test:"
- apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install $(pwd)/build/*.deb language-pack-gnome-pt language-pack-pt-base
- echo "Removal test:"
- pkg_name=$(head -n 1 package/debian/changelog | cut -d' ' -f1)
- DEBIAN_FRONTEND=noninteractive apt -y remove $pkg_name
dependencies:
- build
deploy_for_unstable:
stage: deploy
only:
- develop
tags:
- debian-packaging
script:
- ./.deploy.sh
dependencies:
- build
deploy_for_testing:
stage: deploy
only:
- /^rc-.*$/
tags:
- debian-packaging
script:
- ./.deploy.sh
dependencies:
- build
deploy_for_stable:
stage: deploy
when: manual
only:
- master
tags:
- debian-packaging
script:
- ./.deploy.sh
dependencies:
- build
#!/bin/bash
YELLOW='\033[0;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
sh_files=$(find -name "*.sh")
exe_files=$(grep -Erl "#\!/bin/(bash|sh)" --exclude=*.* package)
files="$sh_files\n$exe_files"
#find no files
if [[ "$files" == "\n" ]];then
echo -e "${YELLOW}No shell files found!${NC}"
exit 0
fi
echo -e "$files"| xargs shellcheck -s bash
if [[ $? -eq 0 ]];then
echo "AWESOME!No problems found."
exit 0
else
echo -e "Understand errors in: ${BLUE}https://github.com/koalaman/shellcheck/wiki${NC}"
exit 1
fi
[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"
le-add-missing-file-version (1.0.0) unstable; urgency=medium
* Initial release (Closes: SCRUM#649)
-- Davisson Paulino <lesuporte@c3sl.ufpr.br> Thu, 17 Jan 2019 11:33:50 -0200
Source: le-add-missing-file-version
Section: admin
Priority: optional
Maintainer: C3SL <lesuporte@c3sl.ufpr.br>
Build-Depends: debhelper (>= 9)
Standards-Version: 3.9.8
Vcs-Git: https://gitlab.c3sl.ufpr.br/le6/le-add-missing-file-version.git
Vcs-Browser: https://gitlab.c3sl.ufpr.br/le6/le-add-missing-file-version.git
Package: le-add-missing-file-version
Architecture: all
Depends: ${misc:Depends}
Description: Create file etc/le_version for existing user base
This package is to add a missing file at `/etc/le_version`
which has got a version of LE, and it is used by the agent
to send information to proinfodata (empty package).
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: le-add-missing-file-version
Source: https://gitlab.c3sl.ufpr.br/le6/le-add-missing-file-version.git
Files: *
Copyright: 2019 C3SL <lesuporte@c3sl.ufpr.br>
License: GPL-2.0+
License: GPL-2.0+
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>
.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
#!/bin/sh
set -e
case "$1" in
configure)
if [ -f "/etc/lsb-release" ];then
LE_VERSION=$(grep "DISTRIB_DESCRIPTION" < /etc/lsb-release| egrep -o "[0-9]+(.[0-9]+)?(.[0-9]+)?")
echo "$LE_VERSION" > "/etc/le_version"
else
echo "file '/etc/lsb-release' does not exist"
exit 1
fi
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
exit 0
#!/usr/bin/make -f
%:
dh $@
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