mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-20 09:17:43 +03:00
630d021331
* Generate Bazel logs and upload to GCS changelog_begin changelog_end * Move git_*_sha into variables template Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
59 lines
3.2 KiB
YAML
59 lines
3.2 KiB
YAML
# Copyright (c) 2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
steps:
|
|
- template: bash-lib.yml
|
|
parameters:
|
|
var_name: bash_lib
|
|
- bash: |
|
|
set -euo pipefail
|
|
if [[ $(Agent.OS) = Windows* ]]; then
|
|
export PATH="$PATH:$(cygpath "$(powershell "./dev-env/windows/bin/dadew.ps1 enable >\$2; dadew where")/scoop/shims")"
|
|
else
|
|
eval "$(dev-env/bin/dade assist)"
|
|
fi
|
|
source $(bash_lib)
|
|
jq -nc >job-md.json '{
|
|
timestamp: "$(pipeline_timestamp)",
|
|
id: "$(pipeline_id)",
|
|
agent_id: "$(Agent.Id)",
|
|
agent_job_name: "$(Agent.JobName)",
|
|
agent_machine_name: "$(Agent.MachineName)",
|
|
agent_name: "$(Agent.Name)",
|
|
agent_os: "$(Agent.OS)",
|
|
agent_os_architecture: "$(Agent.OSArchitecture)",
|
|
build_build_id: "$(Build.BuildId)",
|
|
build_build_number: "$(Build.BuildNumber)",
|
|
build_definition_name: "$(Build.DefinitionName)",
|
|
build_source_branch: "$(Build.SourceBranch)",
|
|
build_source_branch_name: "$(Build.SourceBranchName)",
|
|
build_source_version: "$(Build.SourceVersion)",
|
|
system_job_attempt: "$(System.JobAttempt)",
|
|
system_job_display_name: "$(System.JobDisplayName)",
|
|
system_job_id: "$(System.JobId)",
|
|
system_job_name: "$(System.JobName)",
|
|
system_pullRequest_pullRequestId: "'"${SYSTEM_PULLREQUEST_PULLREQUESTID:-}"'",
|
|
system_pullRequest_pullRequestNumber: "'"${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER:-}"'",
|
|
system_pullRequest_mergedAt: "'"${SYSTEM_PULLREQUEST_MERGEDAT:-}"'",
|
|
system_pullRequest_sourceBranch: "'"${SYSTEM_PULLREQUEST_SOURCEBRANCH:-}"'",
|
|
system_pullRequest_targetBranch: "'"${SYSTEM_PULLREQUEST_TARGETBRANCH:-}"'",
|
|
system_pullRequest_sourceRepositoryUri: "'"${SYSTEM_PULLREQUEST_SOURCEREPOSITORYURI:-}"'",
|
|
system_pullRequest_sourceCommitId: "'"${SYSTEM_PULLREQUEST_SOURCECOMMITID:-}"'",
|
|
git_branch_sha: "$(git_branch_sha)",
|
|
git_main_sha: "$(git_main_sha)",
|
|
git_fork_point: "$(git_fork_point_sha)",
|
|
git_current_branch: "'"$(git branch --show-current)"'",
|
|
git_current_commit: "'"$(git rev-parse HEAD)"'",
|
|
git_current_tree: "'"$(git rev-parse HEAD:./)"'",
|
|
}'
|
|
jq <job-md.json .
|
|
gcs "$GCRED" cp "job-md.json" "gs://daml-data/bazel-metrics/$(pipeline_id)/job-md.json"
|
|
[[ -f "build-profile.json" ]] && gcs "$GCRED" cp "build-profile.json" "gs://daml-data/bazel-metrics/$(pipeline_id)/build-profile.json" || echo "build-profile.json not found"
|
|
[[ -f "build-events.json" ]] && gcs "$GCRED" cp "build-events.json" "gs://daml-data/bazel-metrics/$(pipeline_id)/build-events.json" || echo "build-events.json not found"
|
|
[[ -f "test-profile.json" ]] && gcs "$GCRED" cp "test-profile.json" "gs://daml-data/bazel-metrics/$(pipeline_id)/test-profile.json" || echo "test-profile.json not found"
|
|
[[ -f "test-events.json" ]] && gcs "$GCRED" cp "test-events.json" "gs://daml-data/bazel-metrics/$(pipeline_id)/test-events.json" || echo "test-events.json not found"
|
|
condition: succeededOrFailed()
|
|
displayName: 'Upload Bazel metrics'
|
|
env:
|
|
GCRED: $(GOOGLE_APPLICATION_CREDENTIALS_CONTENT)
|