Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
savoirfairelinux
jami-project
Commits
61db0463
Commit
61db0463
authored
3 years ago
by
jenkins
Browse files
Options
Downloads
Plain Diff
New release.
parents
ff810ae7
d0e3d621
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Jenkinsfile
+91
-24
91 additions, 24 deletions
Jenkinsfile
scripts/deploy-packages.sh
+3
-3
3 additions, 3 deletions
scripts/deploy-packages.sh
with
94 additions
and
27 deletions
Jenkinsfile
+
91
−
24
View file @
61db0463
...
...
@@ -26,14 +26,22 @@
// 2. ws-cleanup plugin
// 3. ansicolor plugin
// TODO:
// - GPG-sign release tarballs.
// - GPG-sign release commits.
// - Allow publishing from any node, to avoid relying on a single machine.
// Configuration globals.
def
SUBMODULES
=
[
'daemon'
,
'lrc'
,
'client-gnome'
,
'client-qt'
]
def
TARGETS
=
[:]
def
SSH_PRIVATE_KEY
=
'/var/lib/jenkins/.ssh/gplpriv'
def
REMOTE_HOST
=
env
.
SSH_HOST_DL_RING_CX
def
REMOTE_BASE_DIR
=
'/srv/repository/ring'
def
RING
_PUBLIC_KEY_FINGERPRINT
=
'A295D773307D25A33AE72F2F64CD5FA175348F84'
def
JAMI
_PUBLIC_KEY_FINGERPRINT
=
'A295D773307D25A33AE72F2F64CD5FA175348F84'
def
SNAPCRAFT_KEY
=
'/var/lib/jenkins/.snap/key'
def
GIT_USER_EMAIL
=
'jenkins@jami.net'
def
GIT_USER_NAME
=
'jenkins'
def
GIT_PUSH_URL
=
'ssh://jenkins@review.jami.net:29420/jami-project'
def
SSH_CRED_ID
=
'35cefd32-dd99-41b0-8312-0b386df306ff'
pipeline
{
agent
{
...
...
@@ -72,7 +80,10 @@ pipeline {
description:
'Whether to build ARM packages.'
)
booleanParam
(
name:
'DEPLOY'
,
defaultValue:
false
,
description:
'Whether and where to deploy packages.'
)
description:
'Whether to deploy packages.'
)
booleanParam
(
name:
'PUBLISH'
,
defaultValue:
false
,
description:
'Whether to upload tarball and push to git.'
)
choice
(
name:
'CHANNEL'
,
choices:
'internal\nnightly\nstable'
,
description:
'The repository channel to deploy to. '
+
...
...
@@ -107,6 +118,28 @@ See https://wiki.savoirfairelinux.com/wiki/Jenkins.jami.net#Configuration_client
}
}
stage
(
'Configure Git'
)
{
steps
{
sh
"""git config user.name ${GIT_USER_NAME}
git config user.email ${GIT_USER_EMAIL}
git remote set-url origin ${GIT_PUSH_URL}
"""
}
}
stage
(
'Checkout channel branch'
)
{
when
{
expression
{
params
.
CHANNEL
!=
'internal'
}
}
steps
{
sh
"git checkout ${params.CHANNEL} "
+
'&& git merge --no-commit FETCH_HEAD'
}
}
stage
(
'Fetch submodules'
)
{
steps
{
echo
'Initializing submodules '
+
SUBMODULES
.
join
(
', '
)
+
...
...
@@ -119,14 +152,47 @@ See https://wiki.savoirfairelinux.com/wiki/Jenkins.jami.net#Configuration_client
stage
(
'Generate release tarball'
)
{
steps
{
sh
'''#!/usr/bin/env -S bash -l
sh
"""#!/usr/bin/env -S bash -l
git commit -am "New release."
make portable-release-tarball .tarball-version
'''
git tag \$(cat .tarball-version)
"""
stash
(
includes:
'*.tar.gz, .tarball-version'
,
name:
'release-tarball'
)
}
}
stage
(
'Publish release artifacts'
)
{
when
{
expression
{
params
.
PUBLISH
&&
params
.
CHANNEL
!=
'internal'
}
}
environment
{
GIT_SSH_COMMAND
=
'ssh -o UserKnownHostsFile=/dev/null '
+
'-o StrictHostKeyChecking=no'
}
steps
{
sshagent
(
credentials:
[
SSH_CRED_ID
])
{
echo
"Publishing to git repository..."
// Note: Only stable release tags are published.
script
{
if
(
params
.
CHANNEL
==
'stable'
)
{
sh
'git push --tags'
}
else
{
sh
'git push'
}
}
echo
"Publishing release tarball to https://dl.jami.net..."
sh
'rsync --verbose jami*.tar.gz '
+
"${REMOTE_HOST}:${REMOTE_BASE_DIR}/release/tarballs/"
+
"${params.CHANNEL}/"
}
}
}
stage
(
'Build packages'
)
{
environment
{
DISABLE_CONTRIB_DOWNLOADS
=
'TRUE'
...
...
@@ -185,6 +251,7 @@ See https://wiki.savoirfairelinux.com/wiki/Jenkins.jami.net#Configuration_client
}
steps
{
sshagent
(
credentials:
[
SSH_CRED_ID
])
{
script
{
TARGETS
.
each
{
target
->
try
{
...
...
@@ -205,9 +272,8 @@ See https://wiki.savoirfairelinux.com/wiki/Jenkins.jami.net#Configuration_client
echo
"Deploying ${distribution} packages..."
sh
"""scripts/deploy-packages.sh \
--distribution=${distribution} \
--keyid="${
RING
_PUBLIC_KEY_FINGERPRINT}" \
--keyid="${
JAMI
_PUBLIC_KEY_FINGERPRINT}" \
--snapcraft-login="${SNAPCRAFT_KEY}" \
--remote-ssh-identity-file="${SSH_PRIVATE_KEY}" \
--remote-repository-location="${REMOTE_HOST}:${REMOTE_BASE_DIR}/${params.CHANNEL}" \
--remote-manual-download-location="${REMOTE_HOST}:${REMOTE_BASE_DIR}/manual-${params.CHANNEL}"
"""
...
...
@@ -217,3 +283,4 @@ See https://wiki.savoirfairelinux.com/wiki/Jenkins.jami.net#Configuration_client
}
}
}
}
This diff is collapsed.
Click to expand it.
scripts/deploy-packages.sh
+
3
−
3
View file @
61db0463
...
...
@@ -225,14 +225,14 @@ function package_snap()
echo
"## deploying snap ##"
echo
"####################"
if
[[
"
${
CHANNEL
:0:19
}
"
==
"internal_experiment"
]]
;
then
if
[[
$
CHANNEL
=
~ internal
]]
;
then
DISTRIBUTION_REPOSITORY_FOLDER
=
$(
realpath
repositories
)
/
${
DISTRIBUTION
}
mkdir
-p
${
DISTRIBUTION_REPOSITORY_FOLDER
}
cp
packages/
${
DISTRIBUTION
}*
/
*
.snap
${
DISTRIBUTION_REPOSITORY_FOLDER
}
/
elif
[[
"
${
CHANNEL
:0:7
}
"
==
"
nightly
"
]]
;
then
elif
[[
$
CHANNEL
=
~
nightly
]]
;
then
snapcraft login
--with
${
SNAPCRAFT_LOGIN
}
snapcraft push packages/
${
DISTRIBUTION
}*
/
*
.snap
--release
edge
elif
[[
"
${
CHANNEL
:0:6
}
"
==
"
stable
"
]]
;
then
elif
[[
$
CHANNEL
=
~
stable
]]
;
then
snapcraft login
--with
${
SNAPCRAFT_LOGIN
}
snapcraft push packages/
${
DISTRIBUTION
}*
/
*
.snap
--release
stable
fi
...
...
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