name: generate resources: {} script: > s2i build $(workspaces.build-dir.path)/artifacts/ $(params.SOURCE_IMAGE) \ --image-scripts-url image:///usr/local/s2i \ --as-dockerfile /gen-source/Dockerfile.gen volumeMounts: - mountPath: /gen-source name: gen-source workingDir: $(workspaces.build-dir.path) - envFrom: - secretRef: name: ocp-ss-pipeline-svc-ad prefix: AD_ image: registry.redhat.io/rhel8/buildah@sha256:0a86ecbdfbe86e9d225b7fe4b090a0dd6d323f8afdfdf2bd933ff223ddb53320 name: build-and-push resources: {} script: > BUILD=$(params.BUILD) BRANCH=$(params.BRANCH) COMMIT=$(params.COMMIT) input_string=$(params.APPLICATION_NAME) result="${input_string#*-}" echo "Result: $result" TAG=$(date +"%Y%m%d")-$(params.APP_VERSION)-${BUILD: -5}-${BRANCH:0:3}-${COMMIT:0:5}-${result}-$(params.java-version) IMAGE=$(params.IMAGE_REGISTRY)/$(params.ORGANIZATION)/$(params.PRODUCT)/$(params.APPLICATION_NAME):${TAG} buildah bud --storage-driver=vfs --tls-verify=false --format=docker --layers -f /gen-source/Dockerfile.gen -t ${IMAGE} --label AppArtifact=$(params.APP_ARTIFACT_URL) . buildah push --storage-driver=vfs --tls-verify=false --format=docker --creds ${AD_username}:${AD_password} --digestfile $(workspaces.build-dir.path)/image-digest ${IMAGE} docker://${IMAGE} cat $(workspaces.build-dir.path)/image-digest | tee /tekton/results/IMAGE_DIGEST echo -n ${TAG} | tee /tekton/results/IMAGE_TAG securityContext: capabilities: add: - SETFCAP volumeMounts: - mountPath: /var/lib/containers name: varlibcontainers - mountPath: /gen-source name: gen-source workingDir: /gen-source