Skip to content

Commit

Permalink
ci: Inline pushAndSign functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Laubi committed Jun 1, 2023
1 parent fcf7847 commit 78165bd
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions .ci/releasePipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,9 @@ void createContainerAndPushToStorage(Map args = [version: null, tagLatest: false
sh 'docker login --username $username --password $password $registry'
sh 'DOCKER_BUILDKIT=1 make docker-container OUTPUT=./build/docker/monaco CONTAINER_NAME=$registry/$repo/dynatrace-configuration-as-code VERSION=$version'

pushAndSign(imageName: '$registry/$repo/dynatrace-configuration-as-code:$version')
sh 'docker push $registry/$repo/dynatrace-configuration-as-code:$version'
def fullImageNameWithDigests = sh(returnStdout: true, script: 'docker inspect $registry/$repo/dynatrace-configuration-as-code:$version --format="{{ (index .RepoDigests 0) }}"')
sh "make sign-image COSIGN_PASSWORD=\$cosign_password FULL_IMAGE_NAME=${fullImageNameWithDigests}"

if (args.tagLatest) {
sh 'docker tag $registry/$repo/dynatrace-configuration-as-code:$version $registry/$repo/dynatrace-configuration-as-code:latest'
Expand All @@ -327,12 +329,6 @@ void createContainerAndPushToStorage(Map args = [version: null, tagLatest: false
}
}

void pushAndSign(Map args = [imageName: null]) {
sh "docker push ${args.imageName}"
def fullImageNameWithDigests = sh(returnStdout: true, script: "docker inspect ${args.imageName} --format='{{ (index .RepoDigests 0) }}'")
sh "make sign-image COSIGN_PASSWORD=\$cosign_password FULL_IMAGE_NAME=${fullImageNameWithDigests}"
}

int createGitHubRelease(Map args = [version: null]) {
stage('Create GitHub release draft') {
script {
Expand Down

0 comments on commit 78165bd

Please sign in to comment.