Skip to content
Snippets Groups Projects
Commit fa19d4d1 authored by Amin Bandali's avatar Amin Bandali Committed by Sébastien Blin
Browse files

snap: use exported credentials from 'SNAPCRAFT_STORE_CREDENTIALS'

The old 'login --with' method has been deprecated and is no longer
supported.  Switch to the new method of using a previously-exported
credential, by reading it from the 'SNAPCRAFT_STORE_CREDENTIALS'
environment variable.

https://snapcraft.io/docs/snapcraft-authentication#heading--using

Change-Id: Icd3f0716f4f82df62891cc71dc7e94c92eeff558
parent f074e376
Branches
Tags
No related merge requests found
......@@ -37,12 +37,12 @@ def TARGETS = [:]
def REMOTE_HOST = env.SSH_HOST_DL_RING_CX
def REMOTE_BASE_DIR = '/srv/repository/ring'
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 JENKINS_SSH_KEY = '35cefd32-dd99-41b0-8312-0b386df306ff'
def DL_SSH_KEY = '5825b39b-dfc6-435f-918e-12acc1f56221'
def SNAPCRAFT_KEY = '106e398c-43ca-41c0-8f7e-4f45030f8bdd'
pipeline {
agent {
......@@ -270,10 +270,10 @@ git tag \$(cat .tarball-version) -am "Jami \$(cat .tarball-version)"
distributions.each { distribution ->
echo "Deploying ${distribution} packages..."
withCredentials([string(credentialsId: SNAPCRAFT_KEY, variable: 'SNAPCRAFT_STORE_CREDENTIALS')]) {
sh """scripts/deploy-packages.sh \
--distribution=${distribution} \
--keyid="${JAMI_PUBLIC_KEY_FINGERPRINT}" \
--snapcraft-login="${SNAPCRAFT_KEY}" \
--remote-repository-location="${REMOTE_HOST}:${REMOTE_BASE_DIR}/${params.CHANNEL}" \
--remote-manual-download-location="${REMOTE_HOST}:${REMOTE_BASE_DIR}/manual-${params.CHANNEL}"
"""
......@@ -284,3 +284,4 @@ git tag \$(cat .tarball-version) -am "Jami \$(cat .tarball-version)"
}
}
}
}
......@@ -226,10 +226,8 @@ function package_snap()
ls packages/${DISTRIBUTION}*
cp packages/${DISTRIBUTION}*/*.snap ${DISTRIBUTION_REPOSITORY_FOLDER}/
elif [[ $CHANNEL =~ nightly ]]; then
snapcraft login --with ${SNAPCRAFT_LOGIN}
snapcraft push packages/${DISTRIBUTION}*/*.snap --release edge
elif [[ $CHANNEL =~ stable ]]; then
snapcraft login --with ${SNAPCRAFT_LOGIN}
snapcraft push packages/${DISTRIBUTION}*/*.snap --release stable
fi
}
......@@ -311,10 +309,6 @@ case $i in
SSH_IDENTITY_FILE="${i#*=}"
shift
;;
--snapcraft-login=*)
SNAPCRAFT_LOGIN="${i#*=}"
shift
;;
*)
echo "Unrecognized option ${i}"
exit 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment