From 6d1adee92f131c8ed9de5a0bec18fb393efda233 Mon Sep 17 00:00:00 2001 From: Gary Verhaegen Date: Thu, 20 Aug 2020 19:11:27 +0200 Subject: [PATCH] push script-runner and trigger-runner to Artifactory (#7196) I have created the corresponding user and repositories on Artifactory, and tested the `curl` command manually. I'll add the corresponding credentials to Azure once this is approved. CHANGELOG_BEGIN CHANGELOG_END --- azure-pipelines.yml | 40 ++++++++++++++++++++++++++++++++++++++++ ci/build-unix.yml | 26 ++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f585568ef3..1911e70eac 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -365,6 +365,8 @@ jobs: protos-zip: $[ dependencies.Linux.outputs['publish.protos-zip'] ] daml-on-sql: $[ dependencies.Linux.outputs['publish.daml-on-sql'] ] json-api: $[ dependencies.Linux.outputs['publish.json-api'] ] + script-runner: $[ dependencies.Linux.outputs['publish.script-runner'] ] + trigger-runner: $[ dependencies.Linux.outputs['publish.trigger-runner'] ] release_sha: $[ dependencies.check_for_release.outputs['out.release_sha'] ] release_tag: $[ dependencies.check_for_release.outputs['out.release_tag'] ] trigger_sha: $[ dependencies.check_for_release.outputs['out.trigger_sha'] ] @@ -377,6 +379,7 @@ jobs: if git tag v$(release_tag) $(release_sha); then git push origin v$(release_tag) mkdir $(Build.StagingDirectory)/release + mkdir $(Build.StagingDirectory)/artifactory else echo "##vso[task.setvariable variable=skip-github]TRUE" fi @@ -415,6 +418,16 @@ jobs: artifactName: $(json-api) targetPath: $(Build.StagingDirectory)/release condition: not(eq(variables['skip-github'], 'TRUE')) + - task: DownloadPipelineArtifact@0 + inputs: + artifactName: $(trigger-runner) + targetPath: $(Build.StagingDirectory)/artifactory + condition: not(eq(variables['skip-github'], 'TRUE')) + - task: DownloadPipelineArtifact@0 + inputs: + artifactName: $(script-runner) + targetPath: $(Build.StagingDirectory)/artifactory + condition: not(eq(variables['skip-github'], 'TRUE')) - bash: | set -euo pipefail KEY_FILE=$(mktemp) @@ -432,6 +445,10 @@ jobs: for f in *; do gpg --homedir $GPG_DIR -ab $f done + cd ../artifactory + for f in *; do + gpg --homedir $GPG_DIR -ab $f + done env: GPG_KEY: $(gpg-code-signing) - task: GitHubRelease@0 @@ -475,6 +492,29 @@ jobs: condition: not(eq(variables['skip-github'], 'TRUE')) - bash: | set -euo pipefail + + push() { + local file repository + repository=$1 + file=$2 + curl -f \ + -u "$AUTH" \ + -H "X-Checksum-MD5:$(md5sum ${local} | awk '{print $1}')" \ + -H "X-Checksum-SHA1:$(sha1sum ${local} | awk '{print $1}')" \ + -X PUT \ + -T $(Build.StagingDirectory)/artifactory/${file} \ + https://digitalasset.jfrog.io/artifactory/${repository}/$(release_tag)/${file} + } + + push daml-trigger-runner $(trigger-runner) + push daml-trigger-runner $(trigger-runner).asc + push daml-script-runner $(script-runner) + push daml-script-runner $(script-runner).asc + env: + AUTH: $(ARTIFACTORY_USERPASS) + condition: not(eq(variables['skip-github'], 'TRUE')) + - bash: | + set -euo pipefail pr_handler=$(head -1 release/rotation | awk '{print $1}') curl -XPOST \ -i \ diff --git a/ci/build-unix.yml b/ci/build-unix.yml index e305b61d39..1415e5dc61 100644 --- a/ci/build-unix.yml +++ b/ci/build-unix.yml @@ -92,6 +92,16 @@ steps: bazel build //ledger-service/http-json:http-json-binary_deploy.jar cp bazel-bin/ledger-service/http-json/http-json-binary_deploy.jar $(Build.StagingDirectory)/$JSON_API echo "##vso[task.setvariable variable=json-api;isOutput=true]$JSON_API" + + TRIGGER=daml-trigger-runner-${{parameters.release_tag}}.jar + bazel build //triggers/runner:trigger-runner_deploy.jar + cp bazel-bin/triggers/runner/trigger-runner_deploy.jar $(Build.StagingDirectory)/$TRIGGER + echo "##vso[task.setvariable variable=trigger-runner;isOutput=true]$TRIGGER" + + SCRIPT=daml-script-${{parameters.release_tag}}.jar + bazel build //daml-script/runner:script-runner_deploy.jar + cp bazel-bin/daml-script/runner/script-runner_deploy.jar $(Build.StagingDirectory)/$SCRIPT + echo "##vso[task.setvariable variable=script-runner;isOutput=true]$SCRIPT" env: DAML_SDK_RELEASE_VERSION: ${{parameters.release_tag}} name: publish @@ -129,3 +139,19 @@ steps: eq(${{parameters.is_release}}, 'true'), eq(variables['Build.SourceBranchName'], 'master'), eq('${{parameters.name}}', 'linux')) + - task: PublishPipelineArtifact@0 + inputs: + targetPath: $(Build.StagingDirectory)/$(publish.trigger-runner) + artifactName: $(publish.trigger-runner) + condition: and(succeeded(), + eq(${{parameters.is_release}}, 'true'), + eq(variables['Build.SourceBranchName'], 'master'), + eq('${{parameters.name}}', 'linux')) + - task: PublishPipelineArtifact@0 + inputs: + targetPath: $(Build.StagingDirectory)/$(publish.script-runner) + artifactName: $(publish.script-runner) + condition: and(succeeded(), + eq(${{parameters.is_release}}, 'true'), + eq(variables['Build.SourceBranchName'], 'master'), + eq('${{parameters.name}}', 'linux'))