Common code to deploy cloukit modules to npm and github releases
Put this into each pipeline Jenkins Job to trigger a dockerized build inside Jenkins.
node {
wrap([$class: 'HideSecretEnvVarsBuildWrapper']) {
if (env.GWBT_BRANCH == 'gh-pages') {
echo "NOT BUILDING GH-PAGES BRANCH"
} else if (env.GWBT_REPO_FULL_NAME) {
// ALWAYS LOAD JENKINSFILE FROM MASTER !!! TO AVOID INJECTS BY PULL REQUESTS !!!
sh 'curl -H "Authorization: token ${SECRET_GITHUB_AUTH_TOKEN}" -H "Accept: application/vnd.github.v3.raw" -o Jenkinsfile -L https://api.github.com/repos/cloukit/library-deploy-chain/contents/Jenkinsfile'
load('./Jenkinsfile')
} else {
echo "manual starts not allowed!"
}
}
}
- Master Branch pushes will be deployed to Nexus as alpha versions e.g. 1.1.0-alpha.6
- Tag pushes will be deployed to npmjs as release versions e.g. 1.1.0