From b210c0e27d888338351f4d8762fbd2f37fcb2010 Mon Sep 17 00:00:00 2001 From: OZGCloud <ozgcloud@mgm-tp.com> Date: Thu, 15 Feb 2024 13:29:10 +0100 Subject: [PATCH] OZG-5021 move jenkinsfile to root --- Jenkinsfile.admin | 48 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 Jenkinsfile.admin diff --git a/Jenkinsfile.admin b/Jenkinsfile.admin new file mode 100644 index 0000000000..111ca2c5ff --- /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 -- GitLab