|
1 | | -#!/usr/local/bin/bash |
2 | | - |
3 | | -set -euo pipefail |
4 | | - |
5 | | -source .expeditor/scripts/release_habitat/shared.sh |
6 | | - |
7 | | -# Get secrets! (our auth token and aws creds should be auto-injected but there's a bug: |
8 | | -# https://github.com/chef/ci-studio-common/issues/200) |
9 | | -eval "$(vault-util fetch-secret-env)" |
10 | | - |
11 | | -export HAB_AUTH_TOKEN="${PIPELINE_HAB_AUTH_TOKEN}" |
12 | | -export HAB_BLDR_URL="${PIPELINE_HAB_BLDR_URL}" |
13 | | - |
14 | | - |
15 | | -echo "--- Executing: brew install protobuf" |
16 | | -brew install protobuf |
17 | | - |
18 | | -channel=$(get_release_channel) |
19 | | - |
20 | | -echo "--- Channel: $channel - bldr url: $HAB_BLDR_URL" |
21 | | - |
22 | | -macos_install_bootstrap_package |
23 | | - |
24 | | -declare -g hab_binary |
25 | | -curlbash_hab "x86_64-darwin" |
26 | | -import_keys |
27 | | - |
28 | | -macos_use_cert_file_from_linux_cacerts_package |
29 | | - |
30 | | -# the macos 11 anka image does not allow us to create a /hab |
31 | | -# directory so we mount off /tmp |
32 | | -export HAB_ROOT_PATH |
33 | | -HAB_ROOT_PATH=$(mktemp -d /tmp/fs-root-XXXXXX) |
34 | | - |
35 | | -macos_sync_cache_signing_keys |
36 | | - |
37 | | -install_rustup |
38 | | - |
39 | | -if [ "$BUILD_PKG_TARGET" == "aarch64-darwin" ]; then |
40 | | - rustup target add aarch64-apple-darwin |
41 | | -fi |
42 | | - |
43 | | -# set the rust toolchain |
44 | | -rust_toolchain="$(tail -n 1 rust-toolchain | cut -d'"' -f 2)" |
45 | | -echo "--- :rust: Using Rust toolchain ${rust_toolchain}" |
46 | | -rustc --version # just 'cause I'm paranoid and I want to double check |
47 | | - |
48 | | -echo "--- :habicat: Building components/hab" |
49 | | - |
50 | | -HAB_BLDR_CHANNEL="${channel}" macos_build components/hab |
51 | | -source results/last_build.env |
52 | | - |
53 | | -# This is a hack to rebuild the hart with corrected directory structure |
54 | | -# changing the root from /tmp to /hab |
55 | | -rm -f results/"$pkg_artifact" |
56 | | -tar -cf temp.tar "$HAB_ROOT_PATH"/pkgs --transform="s,""${HAB_ROOT_PATH:1}"",hab," --transform="s,tmp,hab," |
57 | | -xz --compress -6 --threads=0 temp.tar |
58 | | -hab pkg sign --origin "$HAB_ORIGIN" temp.tar.xz results/"$pkg_artifact" |
59 | | - |
60 | | -echo "--- :habicat: Uploading ${pkg_ident:?} to ${HAB_BLDR_URL} in the '${channel}' channel" |
61 | | -${hab_binary} pkg upload \ |
62 | | - --channel="${channel}" \ |
63 | | - --auth="${HAB_AUTH_TOKEN}" \ |
64 | | - --no-build \ |
65 | | - "results/${pkg_artifact:?}" |
66 | | - |
67 | | -echo "<br>* ${pkg_ident} (${BUILD_PKG_TARGET})" | buildkite-agent annotate --append --context "release-manifest" |
68 | | - |
69 | | -set_target_metadata "${pkg_ident}" "${pkg_target}" |
| 1 | +#!/usr/local/bin/bash |
| 2 | + |
| 3 | +set -euo pipefail |
| 4 | + |
| 5 | +source .expeditor/scripts/release_habitat/shared.sh |
| 6 | + |
| 7 | +# Get secrets! (our auth token and aws creds should be auto-injected but there's a bug: |
| 8 | +# https://github.com/chef/ci-studio-common/issues/200) |
| 9 | +eval "$(vault-util fetch-secret-env)" |
| 10 | + |
| 11 | +export HAB_BLDR_URL="${PIPELINE_HAB_BLDR_URL}" |
| 12 | + |
| 13 | + |
| 14 | +echo "--- Executing: brew install protobuf" |
| 15 | +brew install protobuf |
| 16 | + |
| 17 | +channel=$(get_release_channel) |
| 18 | + |
| 19 | +echo "--- Channel: $channel - bldr url: $HAB_BLDR_URL" |
| 20 | + |
| 21 | +macos_install_bootstrap_package |
| 22 | + |
| 23 | +declare -g hab_binary |
| 24 | +curlbash_hab "x86_64-darwin" |
| 25 | +import_keys |
| 26 | + |
| 27 | +macos_use_cert_file_from_linux_cacerts_package |
| 28 | + |
| 29 | +# the macos 11 anka image does not allow us to create a /hab |
| 30 | +# directory so we mount off /tmp |
| 31 | +export HAB_ROOT_PATH |
| 32 | +HAB_ROOT_PATH=$(mktemp -d /tmp/fs-root-XXXXXX) |
| 33 | + |
| 34 | +macos_sync_cache_signing_keys |
| 35 | + |
| 36 | +install_rustup |
| 37 | + |
| 38 | +if [ "$BUILD_PKG_TARGET" == "aarch64-darwin" ]; then |
| 39 | + rustup target add aarch64-apple-darwin |
| 40 | +fi |
| 41 | + |
| 42 | +# set the rust toolchain |
| 43 | +rust_toolchain="$(tail -n 1 rust-toolchain | cut -d'"' -f 2)" |
| 44 | +echo "--- :rust: Using Rust toolchain ${rust_toolchain}" |
| 45 | +rustc --version # just 'cause I'm paranoid and I want to double check |
| 46 | + |
| 47 | +echo "--- :habicat: Building components/hab" |
| 48 | + |
| 49 | +HAB_BLDR_CHANNEL="${channel}" macos_build components/hab |
| 50 | +source results/last_build.env |
| 51 | + |
| 52 | +# This is a hack to rebuild the hart with corrected directory structure |
| 53 | +# changing the root from /tmp to /hab |
| 54 | +rm -f results/"$pkg_artifact" |
| 55 | +tar -cf temp.tar "$HAB_ROOT_PATH"/pkgs --transform="s,""${HAB_ROOT_PATH:1}"",hab," --transform="s,tmp,hab," |
| 56 | +xz --compress -6 --threads=0 temp.tar |
| 57 | +hab pkg sign --origin "$HAB_ORIGIN" temp.tar.xz results/"$pkg_artifact" |
| 58 | + |
| 59 | +echo "--- :habicat: Uploading ${pkg_ident:?} to ${HAB_BLDR_URL} in the '${channel}' channel" |
| 60 | +${hab_binary} pkg upload \ |
| 61 | + --channel="${channel}" \ |
| 62 | + --auth="${HAB_AUTH_TOKEN}" \ |
| 63 | + --no-build \ |
| 64 | + "results/${pkg_artifact:?}" |
| 65 | + |
| 66 | +echo "<br>* ${pkg_ident} (${BUILD_PKG_TARGET})" | buildkite-agent annotate --append --context "release-manifest" |
| 67 | + |
| 68 | +set_target_metadata "${pkg_ident}" "${pkg_target}" |
0 commit comments