Skip to content
Snippets Groups Projects
Commit c643ed5b authored by OZGCloud's avatar OZGCloud
Browse files

OZG-7021 OZG-7217 Build, tag and push Docker images

parent fc78497b
No related branches found
No related tags found
No related merge requests found
......@@ -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"
}
}
}
......
......@@ -142,13 +142,14 @@
],
"options": {
"engine": "docker",
"push": true,
"metadata": {
"images": [
"docker.ozg-sh.de/info"
],
"load": true,
"tags": [
"build-latest"
"snapshot-latest"
]
}
}
......
......@@ -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",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment