--- # *** # WARNING: Do not EDIT or MERGE this file, it is generated by packagespec. # *** version: 2.1 executors: builder: docker: - image: circleci/buildpack-deps environment: PRODUCT_REVISION: "" AUTO_INSTALL_TOOLS: 'YES' BUILDKIT_PROGRESS: plain shell: /usr/bin/env bash -euo pipefail -c builder-machine: machine: image: ubuntu-1604:202007-01 resource_class: xlarge environment: PRODUCT_REVISION: "" AUTO_INSTALL_TOOLS: 'YES' BUILDKIT_PROGRESS: plain shell: /usr/bin/env bash -euo pipefail -c workflows: version: 2 build-standalone: jobs: - build-common-layers - darwin_amd64_package: { requires: [ build-common-layers ] } - linux_amd64_package: { requires: [ build-common-layers ] } - windows_amd64_package: { requires: [ build-common-layers ] } - bundle-releases: requires: - darwin_amd64_package - linux_amd64_package - windows_amd64_package jobs: build-common-layers: executor: builder-machine steps: - add_ssh_keys: fingerprints: # hashicorp-ci github user. - "c6:96:98:82:dc:04:6c:39:dd:ac:83:05:e3:15:1c:98" - checkout - write-build-layer-cache-keys - restore_cache: name: Restore build image cache keys: - cache006-copy-source_33b2_{{checksum ".buildcache/cache-keys/copy-source-33b2efc628fbbe13613a0fb6a2770ed00b4f5691"}} - cache006-go-modules_4329_{{checksum ".buildcache/cache-keys/go-modules-4329169e81f027b85b81899e720217fef865e165"}} - cache006-ui_5f82_{{checksum ".buildcache/cache-keys/ui-5f82d1f0cbf979ee051aa1ba0f7105483fa6947d"}} - cache006-base_aac1_{{checksum ".buildcache/cache-keys/base-aac1d959b4b3af1495941602b5e51fb6181baded"}} - run: name: Finish early if loaded exact match from cache. command: | if [ -f .buildcache/archives/03-copy-source-33b2efc628fbbe13613a0fb6a2770ed00b4f5691.tar.gz ]; then echo "Exact match found in cache, skipping build." circleci-agent step halt else echo "No exact match found, proceeding with build." fi - run: name: Load whatever builder cache we have (if any) into the Docker daemon no_output_timeout: 30m command: | LAYER_SPEC_ID=03-copy-source-33b2efc628fbbe13613a0fb6a2770ed00b4f5691 make -C packages*.lock load-builder-cache - run: name: Build base layer command: | KEYFILE="$HOME/.ssh/id_rsa_c6969882dc046c39ddac8305e3151c98" eval "$(ssh-agent -s)" if [ -f "$KEYFILE" ]; then ssh-add "$KEYFILE" else echo "==> INFO: SSH key for github.com not found" echo " Attempts to access private repositories from within" echo " the build will fail, e.g. for private go modules, or" echo " attempts to directly clone private repositories." fi make -f packages*.lock/layer.mk 00-base-aac1d959b4b3af1495941602b5e51fb6181baded-image - run: name: Build ui layer command: | KEYFILE="$HOME/.ssh/id_rsa_c6969882dc046c39ddac8305e3151c98" eval "$(ssh-agent -s)" if [ -f "$KEYFILE" ]; then ssh-add "$KEYFILE" else echo "==> INFO: SSH key for github.com not found" echo " Attempts to access private repositories from within" echo " the build will fail, e.g. for private go modules, or" echo " attempts to directly clone private repositories." fi make -f packages*.lock/layer.mk 01-ui-5f82d1f0cbf979ee051aa1ba0f7105483fa6947d-image - run: name: Build go-modules layer command: | KEYFILE="$HOME/.ssh/id_rsa_c6969882dc046c39ddac8305e3151c98" eval "$(ssh-agent -s)" if [ -f "$KEYFILE" ]; then ssh-add "$KEYFILE" else echo "==> INFO: SSH key for github.com not found" echo " Attempts to access private repositories from within" echo " the build will fail, e.g. for private go modules, or" echo " attempts to directly clone private repositories." fi make -f packages*.lock/layer.mk 02-go-modules-4329169e81f027b85b81899e720217fef865e165-image - run: name: Build copy-source layer command: | KEYFILE="$HOME/.ssh/id_rsa_c6969882dc046c39ddac8305e3151c98" eval "$(ssh-agent -s)" if [ -f "$KEYFILE" ]; then ssh-add "$KEYFILE" else echo "==> INFO: SSH key for github.com not found" echo " Attempts to access private repositories from within" echo " the build will fail, e.g. for private go modules, or" echo " attempts to directly clone private repositories." fi make -f packages*.lock/layer.mk 03-copy-source-33b2efc628fbbe13613a0fb6a2770ed00b4f5691-image - run: name: Export builder image command: make -f packages*.lock/layer.mk 03-copy-source-33b2efc628fbbe13613a0fb6a2770ed00b4f5691-save - save_cache: name: Save layer copy-source to cache. key: cache006-copy-source_33b2_{{checksum ".buildcache/cache-keys/copy-source-33b2efc628fbbe13613a0fb6a2770ed00b4f5691"}} paths: - .buildcache/archives/03-copy-source-33b2efc628fbbe13613a0fb6a2770ed00b4f5691.tar.gz - run: name: Prepare layer go-modules for caching command: mv .buildcache/archives/03-copy-source-33b2efc628fbbe13613a0fb6a2770ed00b4f5691.tar.gz .buildcache/archives/02-go-modules-4329169e81f027b85b81899e720217fef865e165.tar.gz - save_cache: name: Save layer go-modules to cache. key: cache006-go-modules_4329_{{checksum ".buildcache/cache-keys/go-modules-4329169e81f027b85b81899e720217fef865e165"}} paths: - .buildcache/archives/02-go-modules-4329169e81f027b85b81899e720217fef865e165.tar.gz - run: name: Prepare layer ui for caching command: mv .buildcache/archives/02-go-modules-4329169e81f027b85b81899e720217fef865e165.tar.gz .buildcache/archives/01-ui-5f82d1f0cbf979ee051aa1ba0f7105483fa6947d.tar.gz - save_cache: name: Save layer ui to cache. key: cache006-ui_5f82_{{checksum ".buildcache/cache-keys/ui-5f82d1f0cbf979ee051aa1ba0f7105483fa6947d"}} paths: - .buildcache/archives/01-ui-5f82d1f0cbf979ee051aa1ba0f7105483fa6947d.tar.gz - run: name: Prepare layer base for caching command: mv .buildcache/archives/01-ui-5f82d1f0cbf979ee051aa1ba0f7105483fa6947d.tar.gz .buildcache/archives/00-base-aac1d959b4b3af1495941602b5e51fb6181baded.tar.gz - save_cache: name: Save layer base to cache. key: cache006-base_aac1_{{checksum ".buildcache/cache-keys/base-aac1d959b4b3af1495941602b5e51fb6181baded"}} paths: - .buildcache/archives/00-base-aac1d959b4b3af1495941602b5e51fb6181baded.tar.gz darwin_amd64_package: executor: builder environment: - PACKAGE_SPEC_ID: 0f13a5db9132c9350b00e8f221a982e8395b69b4 steps: - setup_remote_docker: version: 19.03.12 - add_ssh_keys: fingerprints: # hashicorp-ci github user. - "c6:96:98:82:dc:04:6c:39:dd:ac:83:05:e3:15:1c:98" - checkout # Restore the package cache first, we might not need to rebuild. - write-package-cache-key - restore_cache: name: Restore package cache key: 'cache006-package-0f13a5db9132c9350b00e8f221a982e8395b69b4-{{checksum ".buildcache/cache-keys/package-0f13a5db9132c9350b00e8f221a982e8395b69b4"}}' - run: name: Check the cache status. command: | if ! { PKG=$(find .buildcache/packages/store -maxdepth 1 -mindepth 1 -name '*.zip' 2> /dev/null) && [ -n "$PKG" ]; }; then echo "No package found, continuing with build." exit 0 fi echo "Package already cached, skipping build." circleci-agent step halt # We need to rebuild, so load the builder cache. - write-build-layer-cache-keys - restore_cache: name: Restore build layer cache keys: - cache006-copy-source_33b2_{{checksum ".buildcache/cache-keys/copy-source-33b2efc628fbbe13613a0fb6a2770ed00b4f5691"}} - cache006-go-modules_4329_{{checksum ".buildcache/cache-keys/go-modules-4329169e81f027b85b81899e720217fef865e165"}} - cache006-ui_5f82_{{checksum ".buildcache/cache-keys/ui-5f82d1f0cbf979ee051aa1ba0f7105483fa6947d"}} - cache006-base_aac1_{{checksum ".buildcache/cache-keys/base-aac1d959b4b3af1495941602b5e51fb6181baded"}} - run: name: Load whatever builder cache we have (if any) into the Docker daemon no_output_timeout: 30m command: | make -C packages*.lock load-builder-cache - run: name: Compile Package command: | KEYFILE="$HOME/.ssh/id_rsa_c6969882dc046c39ddac8305e3151c98" eval "$(ssh-agent -s)" if [ -f "$KEYFILE" ]; then ssh-add "$KEYFILE" else echo "==> INFO: SSH key for github.com not found" echo " Attempts to access private repositories from within" echo " the build will fail, e.g. for private go modules, or" echo " attempts to directly clone private repositories." fi make -C packages*.lock package - run: name: List packages command: ls -lahR .buildcache/packages - save_cache: name: Saving package cache key: 'cache006-package-0f13a5db9132c9350b00e8f221a982e8395b69b4-{{checksum ".buildcache/cache-keys/package-0f13a5db9132c9350b00e8f221a982e8395b69b4"}}' paths: - .buildcache/packages/store # Save builder image cache if necessary. # The range should only iterate over a single layer. linux_amd64_package: executor: builder environment: - PACKAGE_SPEC_ID: 1a93ce0fa57be896594a31ad452b1f492727c915 steps: - setup_remote_docker: version: 19.03.12 - add_ssh_keys: fingerprints: # hashicorp-ci github user. - "c6:96:98:82:dc:04:6c:39:dd:ac:83:05:e3:15:1c:98" - checkout # Restore the package cache first, we might not need to rebuild. - write-package-cache-key - restore_cache: name: Restore package cache key: 'cache006-package-1a93ce0fa57be896594a31ad452b1f492727c915-{{checksum ".buildcache/cache-keys/package-1a93ce0fa57be896594a31ad452b1f492727c915"}}' - run: name: Check the cache status. command: | if ! { PKG=$(find .buildcache/packages/store -maxdepth 1 -mindepth 1 -name '*.zip' 2> /dev/null) && [ -n "$PKG" ]; }; then echo "No package found, continuing with build." exit 0 fi echo "Package already cached, skipping build." circleci-agent step halt # We need to rebuild, so load the builder cache. - write-build-layer-cache-keys - restore_cache: name: Restore build layer cache keys: - cache006-copy-source_33b2_{{checksum ".buildcache/cache-keys/copy-source-33b2efc628fbbe13613a0fb6a2770ed00b4f5691"}} - cache006-go-modules_4329_{{checksum ".buildcache/cache-keys/go-modules-4329169e81f027b85b81899e720217fef865e165"}} - cache006-ui_5f82_{{checksum ".buildcache/cache-keys/ui-5f82d1f0cbf979ee051aa1ba0f7105483fa6947d"}} - cache006-base_aac1_{{checksum ".buildcache/cache-keys/base-aac1d959b4b3af1495941602b5e51fb6181baded"}} - run: name: Load whatever builder cache we have (if any) into the Docker daemon no_output_timeout: 30m command: | make -C packages*.lock load-builder-cache - run: name: Compile Package command: | KEYFILE="$HOME/.ssh/id_rsa_c6969882dc046c39ddac8305e3151c98" eval "$(ssh-agent -s)" if [ -f "$KEYFILE" ]; then ssh-add "$KEYFILE" else echo "==> INFO: SSH key for github.com not found" echo " Attempts to access private repositories from within" echo " the build will fail, e.g. for private go modules, or" echo " attempts to directly clone private repositories." fi make -C packages*.lock package - run: name: List packages command: ls -lahR .buildcache/packages - save_cache: name: Saving package cache key: 'cache006-package-1a93ce0fa57be896594a31ad452b1f492727c915-{{checksum ".buildcache/cache-keys/package-1a93ce0fa57be896594a31ad452b1f492727c915"}}' paths: - .buildcache/packages/store # Save builder image cache if necessary. # The range should only iterate over a single layer. windows_amd64_package: executor: builder environment: - PACKAGE_SPEC_ID: 7c03e0434a3d1cb97495af4e5db40c716584dd5e steps: - setup_remote_docker: version: 19.03.12 - add_ssh_keys: fingerprints: # hashicorp-ci github user. - "c6:96:98:82:dc:04:6c:39:dd:ac:83:05:e3:15:1c:98" - checkout # Restore the package cache first, we might not need to rebuild. - write-package-cache-key - restore_cache: name: Restore package cache key: 'cache006-package-7c03e0434a3d1cb97495af4e5db40c716584dd5e-{{checksum ".buildcache/cache-keys/package-7c03e0434a3d1cb97495af4e5db40c716584dd5e"}}' - run: name: Check the cache status. command: | if ! { PKG=$(find .buildcache/packages/store -maxdepth 1 -mindepth 1 -name '*.zip' 2> /dev/null) && [ -n "$PKG" ]; }; then echo "No package found, continuing with build." exit 0 fi echo "Package already cached, skipping build." circleci-agent step halt # We need to rebuild, so load the builder cache. - write-build-layer-cache-keys - restore_cache: name: Restore build layer cache keys: - cache006-copy-source_33b2_{{checksum ".buildcache/cache-keys/copy-source-33b2efc628fbbe13613a0fb6a2770ed00b4f5691"}} - cache006-go-modules_4329_{{checksum ".buildcache/cache-keys/go-modules-4329169e81f027b85b81899e720217fef865e165"}} - cache006-ui_5f82_{{checksum ".buildcache/cache-keys/ui-5f82d1f0cbf979ee051aa1ba0f7105483fa6947d"}} - cache006-base_aac1_{{checksum ".buildcache/cache-keys/base-aac1d959b4b3af1495941602b5e51fb6181baded"}} - run: name: Load whatever builder cache we have (if any) into the Docker daemon no_output_timeout: 30m command: | make -C packages*.lock load-builder-cache - run: name: Compile Package command: | KEYFILE="$HOME/.ssh/id_rsa_c6969882dc046c39ddac8305e3151c98" eval "$(ssh-agent -s)" if [ -f "$KEYFILE" ]; then ssh-add "$KEYFILE" else echo "==> INFO: SSH key for github.com not found" echo " Attempts to access private repositories from within" echo " the build will fail, e.g. for private go modules, or" echo " attempts to directly clone private repositories." fi make -C packages*.lock package - run: name: List packages command: ls -lahR .buildcache/packages - save_cache: name: Saving package cache key: 'cache006-package-7c03e0434a3d1cb97495af4e5db40c716584dd5e-{{checksum ".buildcache/cache-keys/package-7c03e0434a3d1cb97495af4e5db40c716584dd5e"}}' paths: - .buildcache/packages/store # Save builder image cache if necessary. # The range should only iterate over a single layer. bundle-releases: executor: builder steps: - checkout - write-all-package-cache-keys - load-darwin_amd64_package - run: environment: PACKAGE_SPEC_ID: 0f13a5db9132c9350b00e8f221a982e8395b69b4 name: Write package metadata for darwin_amd64_package command: | make package-meta - load-linux_amd64_package - run: environment: PACKAGE_SPEC_ID: 1a93ce0fa57be896594a31ad452b1f492727c915 name: Write package metadata for linux_amd64_package command: | make package-meta - load-windows_amd64_package - run: environment: PACKAGE_SPEC_ID: 7c03e0434a3d1cb97495af4e5db40c716584dd5e name: Write package metadata for windows_amd64_package command: | make package-meta - run: name: Write package aliases command: make aliases - run: name: List Build Cache command: ls -lahR .buildcache # Give the lockfile a name store_artifacts can work with. - run: cp packages*.lock/pkgs.yml lockfile-standalone.yml # Surface the lock file as an artifact. - store_artifacts: path: lockfile-standalone.yml destination: lockfile-standalone.yml # Surface the package store directory as an artifact. # This makes each zipped package separately downloadable. - store_artifacts: path: .buildcache/packages destination: packages-standalone # Surface a tarball of the whole package store plus lockfile as an artifact. - run: tar -czf packages-standalone.tar.gz .buildcache/packages lockfile-standalone.yml - store_artifacts: path: packages-standalone.tar.gz destination: packages-standalone.tar.gz # Surface a tarball of just the metadata files. - run: tar -czf meta-standalone.tar.gz .buildcache/packages/store/*.json lockfile-standalone.yml - store_artifacts: path: meta-standalone.tar.gz destination: meta-standalone.tar.gz commands: load-darwin_amd64_package: steps: - restore_cache: key: 'cache006-package-0f13a5db9132c9350b00e8f221a982e8395b69b4-{{checksum ".buildcache/cache-keys/package-0f13a5db9132c9350b00e8f221a982e8395b69b4"}}' load-linux_amd64_package: steps: - restore_cache: key: 'cache006-package-1a93ce0fa57be896594a31ad452b1f492727c915-{{checksum ".buildcache/cache-keys/package-1a93ce0fa57be896594a31ad452b1f492727c915"}}' load-windows_amd64_package: steps: - restore_cache: key: 'cache006-package-7c03e0434a3d1cb97495af4e5db40c716584dd5e-{{checksum ".buildcache/cache-keys/package-7c03e0434a3d1cb97495af4e5db40c716584dd5e"}}' write-build-layer-cache-keys: steps: - run: name: Write builder layer cache keys command: make -C packages*.lock write-builder-cache-keys write-package-cache-key: steps: - run: name: Write package cache key command: make -C packages*.lock write-package-cache-key write-all-package-cache-keys: steps: - run: name: Write all package cache keys command: make -C packages*.lock write-all-package-cache-keys