-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update labelling to allow labels to be defined in cluster_vars. Add … (…
…#55) * Update labelling to allow labels to be defined in cluster_vars. Add assertions to ensure they can be applied to infrastructure. * Labelling schema changed to use underscores instead of hyphens * Disambiguate RELEASE types (git tag or IaC tag): GIT_RELEASE or IAC_RELEASE
- Loading branch information
1 parent
086c0f4
commit 597fb45
Showing
11 changed files
with
82 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
--- | ||
|
||
sys_version: "1_0_0" | ||
sysdisks_version: "1_0_1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
--- | ||
--- | ||
|
||
sys_version: "1_0_0" | ||
sysdisks_version: "1_0_1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,7 @@ pipeline { | |
withCredentials([sshUserPrivateKey(credentialsId: "VTP_${params.DEPLOY_ENV.toUpperCase()}_SSH_KEY", keyFileVariable: 'keyfile', usernameVariable: 'sshuser')]) { | ||
sh 'env' | ||
sh 'echo "$DEPLOY_ENV: len $(echo -n $VAULT_PASSWORD_BUILDENV | /usr/bin/wc -c) sum $(echo -n $VAULT_PASSWORD_BUILDENV | /usr/bin/sum) "' | ||
sh 'pipenv run ansible-playbook -u ${sshuser} --private-key=${keyfile} -e buildenv=$DEPLOY_ENV -e clusterid=$CLUSTER_ID [email protected] cluster.yml -e clean=false' | ||
sh 'pipenv run ansible-playbook -u ${sshuser} --private-key=${keyfile} -e buildenv=$DEPLOY_ENV -e clusterid=$CLUSTER_ID [email protected] cluster.yml' | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,11 +26,12 @@ pipeline { | |
sh 'env' | ||
sh 'pipenv install --python /usr/bin/python3' | ||
} | ||
} | ||
} | ||
stage('ReDeploy Release') { | ||
environment { | ||
DEPLOY_ENV="${params.DEPLOY_ENV}" | ||
RELEASE ="${params.RELEASE}" | ||
GIT_RELEASE ="${params.RELEASE}" | ||
IAC_RELEASE ="${params.RELEASE.replace('.', '_')}" | ||
GIT_TOKEN = credentials("GITHUB_SVC_USER") | ||
VAULT_PASSWORD_BUILDENV = credentials("VAULT_PASSWORD_${params.DEPLOY_ENV.toUpperCase()}") | ||
CANARY="-e canary=${params.CANARY}" | ||
|
@@ -39,14 +40,15 @@ pipeline { | |
steps { | ||
script { | ||
try { | ||
echo "RELEASE= ${RELEASE}" | ||
echo "GIT_RELEASE= ${GIT_RELEASE}" | ||
echo "IAC_RELEASE= ${IAC_RELEASE}" | ||
sh "git remote set-url origin https://${GIT_TOKEN_USR}:${GIT_TOKEN_PSW}@github.com/sky-uk/clusterverse.git" | ||
sh 'git fetch --tags' | ||
sh 'git checkout ${RELEASE}' | ||
sh 'git checkout ${GIT_RELEASE}' | ||
withCredentials([sshUserPrivateKey(credentialsId: "VTP_${params.DEPLOY_ENV.toUpperCase()}_SSH_KEY", keyFileVariable: 'keyfile', usernameVariable: 'sshuser')]) { | ||
sh 'env' | ||
sh 'echo "$DEPLOY_ENV: len $(echo -n $VAULT_PASSWORD_BUILDENV | /usr/bin/wc -c) sum $(echo -n $VAULT_PASSWORD_BUILDENV | /usr/bin/sum)"' | ||
sh 'pipenv run ansible-playbook -u ${sshuser} --private-key=${keyfile} -e buildenv=$DEPLOY_ENV -e clusterid=$CLUSTER_ID [email protected] redeploy.yml $CANARY $MYHOSTTYPES -e release_version=$RELEASE' | ||
sh 'pipenv run ansible-playbook -u ${sshuser} --private-key=${keyfile} -e buildenv=$DEPLOY_ENV -e clusterid=$CLUSTER_ID [email protected] redeploy.yml $CANARY $MYHOSTTYPES -e release_version=$IAC_RELEASE' | ||
} | ||
} catch (err) { | ||
// echo "Failed: ${err} - Version ${broken_version} will be deleted and the previous version will be deployed." | ||
|
@@ -62,7 +64,7 @@ pipeline { | |
// sh 'echo "$DEPLOY_ENV: len $(echo -n $VAULT_PASSWORD_BUILDENV | /usr/bin/wc -c) sum $(echo -n $VAULT_PASSWORD_BUILDENV | /usr/bin/sum) "' | ||
// sh 'pipenv run ansible-playbook -u ${sshuser} --private-key=${keyfile} -e buildenv=$DEPLOY_ENV -e clusterid=$CLUSTER_ID [email protected] cluster.yml -e clean=_all_ --tags=clusterverse_clean' | ||
// } | ||
error "${RELEASE} deployment failed" | ||
error "${GIT_RELEASE} deployment failed" | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.