Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
le-user-apps
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Harbor Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
le6
le-user-apps
Commits
8bf9f9cc
There was a problem fetching the pipeline summary.
Commit
8bf9f9cc
authored
7 years ago
by
Diego Giovane Pasqualin
Browse files
Options
Downloads
Plain Diff
Merge branch 'issue/230' into 'master'
SCRUM#230
: add job on .gitlab-ci.yml to deploy package to stable repository. See merge request
!4
parents
fcf91237
0c6e1dbc
No related branches found
No related tags found
1 merge request
!4
SCRUM#230: add job on .gitlab-ci.yml to deploy package to stable repository.
Pipeline
#
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.build.sh
+18
-0
18 additions, 0 deletions
.build.sh
.deploy.sh
+23
-0
23 additions, 0 deletions
.deploy.sh
.gitlab-ci.yml
+17
-21
17 additions, 21 deletions
.gitlab-ci.yml
dput.cf
+1
-0
1 addition, 0 deletions
dput.cf
with
59 additions
and
21 deletions
.build.sh
0 → 100755
+
18
−
0
View file @
8bf9f9cc
#!/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/
This diff is collapsed.
Click to expand it.
.deploy.sh
0 → 100755
+
23
−
0
View file @
8bf9f9cc
#!/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
This diff is collapsed.
Click to expand it.
.gitlab-ci.yml
+
17
−
21
View file @
8bf9f9cc
...
...
@@ -12,17 +12,7 @@ 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
test
:
stage
:
test
...
...
@@ -30,26 +20,32 @@ test:
-
ubuntu
-
regular
script
:
-
apt-get update
-
DEBIAN_FRONTEND=noninteractive apt-get install -y $(pwd)/build/*.deb
-
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install $(pwd)/build/*.deb
-
recommends=$(grep Recommends package/debian/control | cut -d ':' -f2 | tr -d ',')
-
DEBIAN_FRONTEND=noninteractive apt-get install -y $recommends
dependencies
:
-
build
deploy
:
deploy
_for_testing
:
stage
:
deploy
only
:
-
master
-
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
This diff is collapsed.
Click to expand it.
dput.cf
+
1
−
0
View file @
8bf9f9cc
[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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment