|
| 1 | +agents: |
| 2 | + queue: "julia" |
| 3 | + # Only run on `sandbox.jl` machines (not `docker`-isolated ones) since we need nestable sandboxing |
| 4 | + sandbox.jl: "true" |
| 5 | + os: "linux" |
| 6 | + |
| 7 | +steps: |
| 8 | + - label: "upload_s3_musl64" |
| 9 | + key: upload_s3_musl64 |
| 10 | + depends_on: package_musl64 |
| 11 | + if: | |
| 12 | + (pipeline.slug == "julia-master") && (build.branch == "master") && (build.pull_request.id == null) |
| 13 | + commands: | |
| 14 | + echo "--- Print the full and short commit hashes" |
| 15 | + SHORT_COMMIT_LENGTH=10 |
| 16 | + SHORT_COMMIT=`echo $${BUILDKITE_COMMIT:?} | cut -c1-$${SHORT_COMMIT_LENGTH:?}` |
| 17 | + ARTIFACT_FILENAME="julia-$${SHORT_COMMIT:?}-musl64.tar.gz" |
| 18 | +
|
| 19 | + echo "--- Download build artifacts" |
| 20 | + rm -rf $${ARTIFACT_FILENAME:?} |
| 21 | + buildkite-agent artifact download $${ARTIFACT_FILENAME:?} . |
| 22 | +
|
| 23 | + echo "--- Upload build artifacts to S3" |
| 24 | + # Upload to the following URL: |
| 25 | + # https://julialangnightlies-s3.julialang.org/bin/linux/x64/julia-latest-musl64.tar.gz |
| 26 | + export NEW_ARTIFACT_FILENAME="julia-latest-musl64.tar.gz" |
| 27 | + export BUILDKITE_ARTIFACT_UPLOAD_DESTINATION="s3://julialangnightlies-s3/bin/linux/x64" |
| 28 | + export BUILDKITE_S3_DEFAULT_REGION="us-east-1" |
| 29 | + if [[ "$${ARTIFACT_FILENAME:?}" != "$${NEW_ARTIFACT_FILENAME:?}" ]]; then |
| 30 | + mv $${ARTIFACT_FILENAME:?} $${NEW_ARTIFACT_FILENAME:?} |
| 31 | + fi |
| 32 | +
|
| 33 | + # From the Buildkite documentation: |
| 34 | + # > By default the agent will create objects with public-read permissions, so that |
| 35 | + # > clicking on an artifact link in the Buildkite web interface can go directly to the |
| 36 | + # > S3 object to be viewed in the browser. |
| 37 | +
|
| 38 | + buildkite-agent artifact upload $${ARTIFACT_FILENAME:?} |
| 39 | + timeout_in_minutes: 60 |
| 40 | + |
| 41 | +# We must accept the signed job id secret in order to propagate secrets |
| 42 | +env: |
| 43 | + BUILDKITE_PLUGIN_CRYPTIC_BASE64_SIGNED_JOB_ID_SECRET: ${BUILDKITE_PLUGIN_CRYPTIC_BASE64_SIGNED_JOB_ID_SECRET?} |
0 commit comments