Skip to content

Commit

Permalink
Revert "feat:Add tenant Id and deployment for prod (#13)" (#18)
Browse files Browse the repository at this point in the history
This reverts commit 28a1715.
  • Loading branch information
pd-dudkiewicz authored and dharmendrak committed May 21, 2021
1 parent bc9c6be commit 8d3a4e7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
21 changes: 6 additions & 15 deletions Jenkinsfile_CNP
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,9 @@ def secrets = [
secret('microservicekey-civil-service', 'S2S_SECRET'),
secret('ccd-importer-username', 'CCD_CONFIGURER_IMPORTER_USERNAME'),
secret('ccd-importer-password', 'CCD_CONFIGURER_IMPORTER_PASSWORD')
]
]

def prod_secrets = [
'civil-${env}': [
secret('microservicekey-civil-service', 'S2S_SECRET')
],
'civil-prod': [
secret('microservicekey-civil-service', 'S2S_SECRET_PROD')
]
]

Expand All @@ -49,7 +46,7 @@ def uploadBpmnDiagrams(String env) {
dir("${WORKSPACE}/bin") {
sh """
eval \$(./variables/load-${env}-environment-variables.sh)
./import-bpmn-diagram.sh ${WORKSPACE}
./import-bpmn-diagram.sh ${WORKSPACE} ${env}
"""
}
}
Expand All @@ -64,11 +61,7 @@ withPipeline(type, product, component) {
loadVaultSecrets(secrets)
}
onMaster {
if(env == 'prod'){
loadVaultSecrets(prod_secrets)
} else {
loadVaultSecrets(secrets)
}
loadVaultSecrets(secrets)
}
onDemo {
loadVaultSecrets(secrets)
Expand Down Expand Up @@ -148,9 +141,7 @@ withPipeline(type, product, component) {
after('functionalTest:aat') {
createGithubRelease()
uploadBpmnDiagrams('aat')
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'output/**/*'
}
after('deploy:prod') {
uploadBpmnDiagrams('prod')
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'output/**/*'
}
}
9 changes: 7 additions & 2 deletions bin/import-bpmn-diagram.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@
set -eu
workspace=${1}

s2sSecret=${S2S_SECRET:-AABBCCDDEEFFGGHH}

if [[ "${2}" == 'prod' ]]; then
s2sSecret=${S2S_SECRET_PROD}
fi

serviceToken=$($(realpath $workspace)/bin/utils/idam-lease-service-token.sh civil_service \
$(docker run --rm toolbelt/oathtool --totp -b ${S2S_SECRET:-AABBCCDDEEFFGGHH}))
$(docker run --rm toolbelt/oathtool --totp -b ${s2sSecret}))
filepath="$(realpath $workspace)/src/main/resources/camunda"

for file in $(find ${filepath} -name '*.bpmn')
Expand All @@ -15,7 +21,6 @@ do
-H "ServiceAuthorization: Bearer ${serviceToken}" \
-F "deployment-name=$(basename ${file})" \
-F "deploy-changed-only=true" \
-F "tenant-id=civil" \
-F "file=@${filepath}/$(basename ${file})")

upload_http_code=$(echo "$uploadResponse" | tail -n1)
Expand Down

0 comments on commit 8d3a4e7

Please sign in to comment.