diff --git a/alfa-client/apps/info/Jenkinsfile b/alfa-client/apps/info/Jenkinsfile index a8104a6a9fdd615be40f462018d62fdc6d472777..733723cb4c35639f1d90bedaee32ee1fbdb971b7 100644 --- a/alfa-client/apps/info/Jenkinsfile +++ b/alfa-client/apps/info/Jenkinsfile @@ -10,6 +10,7 @@ pipeline { SNAPSHOT_REGEX = /\d+.\d+.\d+-SNAPSHOT/ FAILED_STAGE = "" SH_SUCCESS_STATUS_CODE = 0 + FORCE_COLOR = 0 } options { timeout(time: 1, unit: 'HOURS') @@ -36,10 +37,24 @@ pipeline { sh 'echo "//nexus.ozg-sh.de/:_auth=amVua2luczprTSFnNVUhMVQzNDZxWQ==" >> ~/.npmrc' sh 'npm cache verify' sh 'npm install' - sh 'npm run ci-test-info' - sh 'npm run ci-build-info-by' - sh 'npm run ci-build-info-sh' + sh 'npx nx run info:test' // TODO: Is Sonar necessary? + + IMAGE_TAG = generateImageTag() + + if (isMasterBranch()) { + IMAGE_TAG = "snapshot-latest" + } + else if (isReleaseBranch()) { + IMAGE_TAG = "latest" + } + + withCredentials([usernamePassword(credentialsId: 'jenkins-nexus-login', usernameVariable: 'USER', passwordVariable: 'PASSWORD')]) { + sh 'docker login docker.ozg-sh.de -u ${USER} -p ${PASSWORD}' + } + + sh "INPUT_TAGS=${IMAGE_TAG} INPUT_IMAGES=docker.ozg-sh.de/info-client-by npx nx container info --configuration=by" + sh "INPUT_TAGS=${IMAGE_TAG} INPUT_IMAGES=docker.ozg-sh.de/info-client-sh npx nx container info --configuration=sh" } } } diff --git a/alfa-client/apps/info/project.json b/alfa-client/apps/info/project.json index 522d61ad7f9fff8504be4747cf4046bb87a7a582..ff755ade38b6101e24314aea4299532718137586 100644 --- a/alfa-client/apps/info/project.json +++ b/alfa-client/apps/info/project.json @@ -142,13 +142,14 @@ ], "options": { "engine": "docker", + "push": true, "metadata": { "images": [ "docker.ozg-sh.de/info" ], "load": true, "tags": [ - "build-latest" + "snapshot-latest" ] } } diff --git a/alfa-client/package.json b/alfa-client/package.json index 9fe33b8a53aab908cbad51a53aa142d26df4425d..fa0be066897c9f55385797772171fc3b78eef9ad 100644 --- a/alfa-client/package.json +++ b/alfa-client/package.json @@ -20,11 +20,8 @@ "ci-build-admin": "nx container admin && cp -r dist/ apps/admin/", "ci-prodBuild": "nx run alfa:build --outputHashing=all --configuration production", "ci-prodBuild-admin": "nx container admin && cp -r dist/ apps/admin/", - "ci-build-info-by": "INPUT_TAGS=by nx container info --configuration=by", - "ci-build-info-sh": "INPUT_TAGS=sh nx container info --configuration=sh", "ci-test": "nx run-many --target=test --parallel 20 -- --runInBand", "ci-sonar": "nx run-many --target=test --parallel 20 -- --runInBand --codeCoverage --coverageReporters=lcov --testResultsProcessor=jest-sonar-reporter && npx sonar-scanner", - "ci-test-info": "nx run info:test", "lint": "nx workspace-lint && nx lint", "affected:apps": "nx affected:apps", "affected:libs": "nx affected:libs",