2023-06-13 18:36:32 +03:00
|
|
|
# Copyright (c) 2023 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
jobs:
|
2023-06-14 15:09:58 +03:00
|
|
|
- job: get_daml_com
|
2023-06-13 18:36:32 +03:00
|
|
|
condition: eq(variables['Build.SourceBranchName'], 'main')
|
|
|
|
pool:
|
|
|
|
name: 'ubuntu_20_04'
|
|
|
|
demands: assignment -equals default
|
|
|
|
steps:
|
|
|
|
- checkout: self
|
2023-06-13 19:38:36 +03:00
|
|
|
- template: bash-lib.yml
|
2023-06-13 18:36:32 +03:00
|
|
|
parameters:
|
|
|
|
var_name: bash-lib
|
|
|
|
- bash: |
|
|
|
|
set -euo pipefail
|
2023-06-14 17:58:45 +03:00
|
|
|
eval "$(dev-env/bin/dade-assist)"
|
2023-06-13 18:36:32 +03:00
|
|
|
source $(bash-lib)
|
|
|
|
tmp=$(mktemp)
|
|
|
|
curl --silent \
|
|
|
|
--fail \
|
|
|
|
--location \
|
|
|
|
https://get.daml.com \
|
|
|
|
> $tmp
|
|
|
|
if diff daml-assistant/get-daml.sh $tmp; then
|
|
|
|
echo "Files match, nothing to do."
|
|
|
|
else
|
|
|
|
echo "Files differ; pushing new version."
|
|
|
|
aws s3 cp daml-assistant/get-daml.sh s3://get-daml-com/get-daml.sh --acl public-read --region us-east-1
|
2023-06-14 21:54:52 +03:00
|
|
|
aws cloudfront create-invalidation --distribution-id EXTKHQ2MNSNU4 --paths "/*"
|
2023-06-13 18:36:32 +03:00
|
|
|
echo "Telling Slack..."
|
2023-06-15 11:49:07 +03:00
|
|
|
tell_slack "$(echo -e "Change detected in https://get.daml.com (\`<\` is added):\n\`\`\`\n$(diff daml-assistant/get-daml.sh $tmp)\`\`\`")"
|
2023-06-13 18:36:32 +03:00
|
|
|
fi
|
|
|
|
name: push_if_needed
|
|
|
|
env:
|
|
|
|
AWS_ACCESS_KEY_ID: $(AWS_CLIENT_ID)
|
|
|
|
AWS_SECRET_ACCESS_KEY: $(AWS_SECRET)
|
|
|
|
|