Skip to content

Commit

Permalink
Simplify the EKS job so you don't have type in the version informatio…
Browse files Browse the repository at this point in the history
…n 5 times (#1559)
  • Loading branch information
addyess committed Aug 20, 2024
1 parent d5b6ff1 commit de292b3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion jobs/build-snaps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
Source tag from https://github.com/kubernetes/kubernetes.
- string:
name: channels
default: '{version}/edge,{version}/beta,{version}/candidate'
default: 'edge,beta,candidate,stable'
description: |
Comma separated snap store channels to release the built snaps to.
- bool:
Expand Down
5 changes: 3 additions & 2 deletions jobs/build-snaps/build-release-eks-snaps.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

def kube_version = params.k8s_tag
def kube_ersion = kube_version.substring(1)
def channels = params.channels.tokenize(',').collect { kube_ersion + '/' + it }.join(',')
def lxc_name = env.JOB_NAME+"-"+env.BUILD_NUMBER
def _find_eks_base(version, override){
if (override.length())
Expand Down Expand Up @@ -127,7 +128,7 @@ pipeline {
steps {
script {
if(params.dry_run) {
echo "Dry run; would have uploaded snaps to ${params.channels}"
echo "Dry run; would have uploaded snaps to ${channels}"
} else {
sh """
BUILD_ARCH=\$(dpkg --print-architecture)
Expand All @@ -140,7 +141,7 @@ pipeline {
echo "Uploading \${BUILT_SNAP}."
sudo lxc shell ${lxc_name} -- bash -c \
"snapcraft -v upload /\${EKS_SNAP}/\${BUILT_SNAP} --release ${params.channels}"
"snapcraft -v upload /\${EKS_SNAP}/\${BUILT_SNAP} --release ${channels}"
done
sudo lxc shell ${lxc_name} -- bash -c "snapcraft logout"
"""
Expand Down

0 comments on commit de292b3

Please sign in to comment.