diff --git a/Jenkinsfile.admin b/Jenkinsfile.admin new file mode 100644 index 0000000000000000000000000000000000000000..111ca2c5fff71683885dfc840a809ced2ce0c75a --- /dev/null +++ b/Jenkinsfile.admin @@ -0,0 +1,48 @@ +pipeline { + agent { + node { + label 'ozgcloud-jenkins-build-agent' + } + } + + environment { + BLUE_OCEAN_URL = "https://jenkins.infra.ozg-cloud.systems/job/alfa/job/${env.BRANCH_NAME}/${env.BUILD_NUMBER}/" + RELEASE_REGEX = /\d+.\d+.\d+/ + SNAPSHOT_REGEX = /\d+.\d+.\d+-SNAPSHOT/ + FAILED_STAGE = "" + SH_SUCCESS_STATUS_CODE = 0 + } + + options { + timeout(time: 1, unit: 'HOURS') + disableConcurrentBuilds() + buildDiscarder(logRotator(numToKeepStr: '5')) + } + + // TODO check version + stage('build') { + steps { + script { + FAILED_STAGE=env.STAGE_NAME + + dir('alfa-client') { + sh 'echo "registry=https://nexus.ozg-sh.de/repository/npm-proxy" >> ~/.npmrc' + sh 'echo "//nexus.ozg-sh.de/:_auth=amVua2luczprTSFnNVUhMVQzNDZxWQ==" >> ~/.npmrc' + + sh 'npm cache verify' + sh 'npm install' + + if (isReleaseBranch()) { + sh 'npm run ci-prodBuild-admin' + } else { + sh 'npm run ci-build-admin' + } + } + } + } + } +} + +Boolean isReleaseBranch() { + return env.BRANCH_NAME == 'release' +} \ No newline at end of file