2867 lines
128 KiB
YAML
Generated
2867 lines
128 KiB
YAML
Generated
### ***
|
|
### WARNING: DO NOT manually EDIT or MERGE this file, it is generated by 'make ci-config'.
|
|
### INSTEAD: Edit or merge the source in config/ then run 'make ci-config'.
|
|
### ***
|
|
# Orb 'circleci/slack@3.2.0' resolved to 'circleci/slack@3.2.0'
|
|
version: 2
|
|
jobs:
|
|
bundle-releases:
|
|
docker:
|
|
- image: circleci/buildpack-deps
|
|
shell: /usr/bin/env bash -euo pipefail -c
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
command: make -C packages*.lock write-all-package-cache-keys
|
|
name: Write all package cache keys
|
|
- restore_cache:
|
|
key: cache006-package-4100a546c7a2deb7ac3bea5970bedfed2eebe64c-{{checksum ".buildcache/cache-keys/package-4100a546c7a2deb7ac3bea5970bedfed2eebe64c"}}
|
|
- run:
|
|
command: |
|
|
make package-meta
|
|
environment:
|
|
PACKAGE_SPEC_ID: 4100a546c7a2deb7ac3bea5970bedfed2eebe64c
|
|
name: Write package metadata for darwin_386_package
|
|
- restore_cache:
|
|
key: cache006-package-f0a38bf7dac73fa7d95360f7864e1488de1af94b-{{checksum ".buildcache/cache-keys/package-f0a38bf7dac73fa7d95360f7864e1488de1af94b"}}
|
|
- run:
|
|
command: |
|
|
make package-meta
|
|
environment:
|
|
PACKAGE_SPEC_ID: f0a38bf7dac73fa7d95360f7864e1488de1af94b
|
|
name: Write package metadata for darwin_amd64_package
|
|
- restore_cache:
|
|
key: cache006-package-beaf7ce640bd8bbb15ddfdb3c7b199032dbd0b60-{{checksum ".buildcache/cache-keys/package-beaf7ce640bd8bbb15ddfdb3c7b199032dbd0b60"}}
|
|
- run:
|
|
command: |
|
|
make package-meta
|
|
environment:
|
|
PACKAGE_SPEC_ID: beaf7ce640bd8bbb15ddfdb3c7b199032dbd0b60
|
|
name: Write package metadata for freebsd_386_package
|
|
- restore_cache:
|
|
key: cache006-package-d5a2eed6cd62f28a96e9966923d4a3319c143b09-{{checksum ".buildcache/cache-keys/package-d5a2eed6cd62f28a96e9966923d4a3319c143b09"}}
|
|
- run:
|
|
command: |
|
|
make package-meta
|
|
environment:
|
|
PACKAGE_SPEC_ID: d5a2eed6cd62f28a96e9966923d4a3319c143b09
|
|
name: Write package metadata for freebsd_amd64_package
|
|
- restore_cache:
|
|
key: cache006-package-05e17ce0ee458742bbcad189c58cd709ead699e3-{{checksum ".buildcache/cache-keys/package-05e17ce0ee458742bbcad189c58cd709ead699e3"}}
|
|
- run:
|
|
command: |
|
|
make package-meta
|
|
environment:
|
|
PACKAGE_SPEC_ID: 05e17ce0ee458742bbcad189c58cd709ead699e3
|
|
name: Write package metadata for freebsd_arm_package
|
|
- restore_cache:
|
|
key: cache006-package-281190f33a5f3e27aa6bcd886810bcdd7e0160e2-{{checksum ".buildcache/cache-keys/package-281190f33a5f3e27aa6bcd886810bcdd7e0160e2"}}
|
|
- run:
|
|
command: |
|
|
make package-meta
|
|
environment:
|
|
PACKAGE_SPEC_ID: 281190f33a5f3e27aa6bcd886810bcdd7e0160e2
|
|
name: Write package metadata for linux_386_package
|
|
- restore_cache:
|
|
key: cache006-package-e244c2d20b9417e0abadb35e73997f117916e00c-{{checksum ".buildcache/cache-keys/package-e244c2d20b9417e0abadb35e73997f117916e00c"}}
|
|
- run:
|
|
command: |
|
|
make package-meta
|
|
environment:
|
|
PACKAGE_SPEC_ID: e244c2d20b9417e0abadb35e73997f117916e00c
|
|
name: Write package metadata for linux_amd64_package
|
|
- restore_cache:
|
|
key: cache006-package-f6da1ed126cbd8ed4119da63c1fab12b6e758cf8-{{checksum ".buildcache/cache-keys/package-f6da1ed126cbd8ed4119da63c1fab12b6e758cf8"}}
|
|
- run:
|
|
command: |
|
|
make package-meta
|
|
environment:
|
|
PACKAGE_SPEC_ID: f6da1ed126cbd8ed4119da63c1fab12b6e758cf8
|
|
name: Write package metadata for linux_arm_package
|
|
- restore_cache:
|
|
key: cache006-package-5d98fd6000f50430ded790d9356a8253395305ec-{{checksum ".buildcache/cache-keys/package-5d98fd6000f50430ded790d9356a8253395305ec"}}
|
|
- run:
|
|
command: |
|
|
make package-meta
|
|
environment:
|
|
PACKAGE_SPEC_ID: 5d98fd6000f50430ded790d9356a8253395305ec
|
|
name: Write package metadata for linux_arm64_package
|
|
- restore_cache:
|
|
key: cache006-package-bf75cfc6c5d05271cff63ed817f7e09f9540eef3-{{checksum ".buildcache/cache-keys/package-bf75cfc6c5d05271cff63ed817f7e09f9540eef3"}}
|
|
- run:
|
|
command: |
|
|
make package-meta
|
|
environment:
|
|
PACKAGE_SPEC_ID: bf75cfc6c5d05271cff63ed817f7e09f9540eef3
|
|
name: Write package metadata for netbsd_386_package
|
|
- restore_cache:
|
|
key: cache006-package-9c418ea86d484862e6a7dfd55fecab8b86bbb708-{{checksum ".buildcache/cache-keys/package-9c418ea86d484862e6a7dfd55fecab8b86bbb708"}}
|
|
- run:
|
|
command: |
|
|
make package-meta
|
|
environment:
|
|
PACKAGE_SPEC_ID: 9c418ea86d484862e6a7dfd55fecab8b86bbb708
|
|
name: Write package metadata for netbsd_amd64_package
|
|
- restore_cache:
|
|
key: cache006-package-8de43fa1e99a3de7d649ba2949bbf83a7f0b55ef-{{checksum ".buildcache/cache-keys/package-8de43fa1e99a3de7d649ba2949bbf83a7f0b55ef"}}
|
|
- run:
|
|
command: |
|
|
make package-meta
|
|
environment:
|
|
PACKAGE_SPEC_ID: 8de43fa1e99a3de7d649ba2949bbf83a7f0b55ef
|
|
name: Write package metadata for openbsd_386_package
|
|
- restore_cache:
|
|
key: cache006-package-ae352f28d92b71e59f987251061b200622136b91-{{checksum ".buildcache/cache-keys/package-ae352f28d92b71e59f987251061b200622136b91"}}
|
|
- run:
|
|
command: |
|
|
make package-meta
|
|
environment:
|
|
PACKAGE_SPEC_ID: ae352f28d92b71e59f987251061b200622136b91
|
|
name: Write package metadata for openbsd_amd64_package
|
|
- restore_cache:
|
|
key: cache006-package-573d1e91d855d987e7c7f1179074a88ec04b69e0-{{checksum ".buildcache/cache-keys/package-573d1e91d855d987e7c7f1179074a88ec04b69e0"}}
|
|
- run:
|
|
command: |
|
|
make package-meta
|
|
environment:
|
|
PACKAGE_SPEC_ID: 573d1e91d855d987e7c7f1179074a88ec04b69e0
|
|
name: Write package metadata for solaris_amd64_package
|
|
- restore_cache:
|
|
key: cache006-package-355fcfc2936dcac87610bc5060591586299471d8-{{checksum ".buildcache/cache-keys/package-355fcfc2936dcac87610bc5060591586299471d8"}}
|
|
- run:
|
|
command: |
|
|
make package-meta
|
|
environment:
|
|
PACKAGE_SPEC_ID: 355fcfc2936dcac87610bc5060591586299471d8
|
|
name: Write package metadata for windows_386_package
|
|
- restore_cache:
|
|
key: cache006-package-91b9f04147548016ff75ff09603178cf650ff352-{{checksum ".buildcache/cache-keys/package-91b9f04147548016ff75ff09603178cf650ff352"}}
|
|
- run:
|
|
command: |
|
|
make package-meta
|
|
environment:
|
|
PACKAGE_SPEC_ID: 91b9f04147548016ff75ff09603178cf650ff352
|
|
name: Write package metadata for windows_amd64_package
|
|
- run:
|
|
command: make aliases
|
|
name: Write package aliases
|
|
- run:
|
|
command: ls -lahR .buildcache
|
|
name: List Build Cache
|
|
- run:
|
|
command: cp packages*.lock/pkgs.yml lockfile-standalone.yml
|
|
- store_artifacts:
|
|
destination: lockfile-standalone.yml
|
|
path: lockfile-standalone.yml
|
|
- store_artifacts:
|
|
destination: packages-standalone
|
|
path: .buildcache/packages
|
|
- run:
|
|
command: tar -czf packages-standalone.tar.gz .buildcache/packages lockfile-standalone.yml
|
|
- store_artifacts:
|
|
destination: packages-standalone.tar.gz
|
|
path: packages-standalone.tar.gz
|
|
- run:
|
|
command: tar -czf meta-standalone.tar.gz .buildcache/packages/store/*.json lockfile-standalone.yml
|
|
- store_artifacts:
|
|
destination: meta-standalone.tar.gz
|
|
path: meta-standalone.tar.gz
|
|
environment:
|
|
- AUTO_INSTALL_TOOLS: 'YES'
|
|
- BUILDKIT_PROGRESS: plain
|
|
- PRODUCT_REVISION: ''
|
|
darwin_amd64_package:
|
|
docker:
|
|
- image: circleci/buildpack-deps
|
|
shell: /usr/bin/env bash -euo pipefail -c
|
|
environment:
|
|
- AUTO_INSTALL_TOOLS: 'YES'
|
|
- BUILDKIT_PROGRESS: plain
|
|
- PRODUCT_REVISION: ''
|
|
- PACKAGE_SPEC_ID: f0a38bf7dac73fa7d95360f7864e1488de1af94b
|
|
steps:
|
|
- setup_remote_docker:
|
|
version: 19.03.12
|
|
- add_ssh_keys:
|
|
fingerprints:
|
|
- c6:96:98:82:dc:04:6c:39:dd:ac:83:05:e3:15:1c:98
|
|
- checkout
|
|
- run:
|
|
command: make -C packages*.lock write-package-cache-key
|
|
name: Write package cache key
|
|
- restore_cache:
|
|
key: cache006-package-f0a38bf7dac73fa7d95360f7864e1488de1af94b-{{checksum ".buildcache/cache-keys/package-f0a38bf7dac73fa7d95360f7864e1488de1af94b"}}
|
|
name: Restore package cache
|
|
- run:
|
|
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
|
|
name: Check the cache status.
|
|
- run:
|
|
command: make -C packages*.lock write-builder-cache-keys
|
|
name: Write builder layer cache keys
|
|
- restore_cache:
|
|
keys:
|
|
- cache006-copy-source_137b_{{checksum ".buildcache/cache-keys/copy-source-137b41f69eedb5c72701865851015bdf792fe20f"}}
|
|
- cache006-warm-go-build-vendor-cache_ee41_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-ee412438fddc780f742015d41883229589ca8f84"}}
|
|
- cache006-build-static-assets_5d03_{{checksum ".buildcache/cache-keys/build-static-assets-5d03b27bdb30353a4b10b43aaeed34d1843ea016"}}
|
|
- cache006-build-ui_8c08_{{checksum ".buildcache/cache-keys/build-ui-8c0888ac60d74cc3c80ff1e66f92529854029bb8"}}
|
|
- cache006-ui-dependencies_a323_{{checksum ".buildcache/cache-keys/ui-dependencies-a323ed865ff8f01132ebbcfdb26cd46637ee0537"}}
|
|
- cache006-install-yarn_f6bc_{{checksum ".buildcache/cache-keys/install-yarn-f6bc3cf1c8120fc6fbc6a7815f1414ea4a92b347"}}
|
|
- cache006-set-workdir_6821_{{checksum ".buildcache/cache-keys/set-workdir-68217e0df446776a522c173819319331eab24bfd"}}
|
|
- cache006-install-go-tools_4930_{{checksum ".buildcache/cache-keys/install-go-tools-493003a45b9bf13a3740054d1ed1e50aa66e0981"}}
|
|
- cache006-install-go_04fa_{{checksum ".buildcache/cache-keys/install-go-04fac374a5ab393a607df72e77bce85e18dd3856"}}
|
|
- cache006-base_cd50_{{checksum ".buildcache/cache-keys/base-cd50335c2217aa98d45d50d7ef941dfd1289b070"}}
|
|
name: Restore build layer cache
|
|
- run:
|
|
command: |
|
|
make -C packages*.lock load-builder-cache
|
|
name: Load whatever builder cache we have (if any) into the Docker daemon
|
|
no_output_timeout: 30m
|
|
- run:
|
|
command: |2
|
|
|
|
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
|
|
name: Compile Package
|
|
- run:
|
|
command: ls -lahR .buildcache/packages
|
|
name: List packages
|
|
- save_cache:
|
|
key: cache006-package-f0a38bf7dac73fa7d95360f7864e1488de1af94b-{{checksum ".buildcache/cache-keys/package-f0a38bf7dac73fa7d95360f7864e1488de1af94b"}}
|
|
name: Saving package cache
|
|
paths:
|
|
- .buildcache/packages/store
|
|
- run:
|
|
command: |
|
|
if [ -f .buildcache/archives/08-warm-go-build-vendor-cache-ee412438fddc780f742015d41883229589ca8f84.tar.gz ]; then
|
|
echo "Builder image already cached, skipping cache step."
|
|
circleci-agent step halt
|
|
fi
|
|
name: Check builder cache status
|
|
- run:
|
|
command: make -f packages*.lock/layer.mk 08-warm-go-build-vendor-cache-ee412438fddc780f742015d41883229589ca8f84-save
|
|
name: Prepare build layers for caching
|
|
- save_cache:
|
|
key: cache006-warm-go-build-vendor-cache_ee41_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-ee412438fddc780f742015d41883229589ca8f84"}}
|
|
name: Save build layer cache
|
|
paths:
|
|
- .buildcache/archives/08-warm-go-build-vendor-cache-ee412438fddc780f742015d41883229589ca8f84.tar.gz
|
|
windows_386_package:
|
|
docker:
|
|
- image: circleci/buildpack-deps
|
|
shell: /usr/bin/env bash -euo pipefail -c
|
|
environment:
|
|
- AUTO_INSTALL_TOOLS: 'YES'
|
|
- BUILDKIT_PROGRESS: plain
|
|
- PRODUCT_REVISION: ''
|
|
- PACKAGE_SPEC_ID: 355fcfc2936dcac87610bc5060591586299471d8
|
|
steps:
|
|
- setup_remote_docker:
|
|
version: 19.03.12
|
|
- add_ssh_keys:
|
|
fingerprints:
|
|
- c6:96:98:82:dc:04:6c:39:dd:ac:83:05:e3:15:1c:98
|
|
- checkout
|
|
- run:
|
|
command: make -C packages*.lock write-package-cache-key
|
|
name: Write package cache key
|
|
- restore_cache:
|
|
key: cache006-package-355fcfc2936dcac87610bc5060591586299471d8-{{checksum ".buildcache/cache-keys/package-355fcfc2936dcac87610bc5060591586299471d8"}}
|
|
name: Restore package cache
|
|
- run:
|
|
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
|
|
name: Check the cache status.
|
|
- run:
|
|
command: make -C packages*.lock write-builder-cache-keys
|
|
name: Write builder layer cache keys
|
|
- restore_cache:
|
|
keys:
|
|
- cache006-copy-source_59bd_{{checksum ".buildcache/cache-keys/copy-source-59bd4f6e79bfea922ea2e2b209e7dc151e8fd719"}}
|
|
- cache006-warm-go-build-vendor-cache_947f_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-947f07f88a16ac9f143b6db2b240187e51034442"}}
|
|
- cache006-build-static-assets_5d03_{{checksum ".buildcache/cache-keys/build-static-assets-5d03b27bdb30353a4b10b43aaeed34d1843ea016"}}
|
|
- cache006-build-ui_8c08_{{checksum ".buildcache/cache-keys/build-ui-8c0888ac60d74cc3c80ff1e66f92529854029bb8"}}
|
|
- cache006-ui-dependencies_a323_{{checksum ".buildcache/cache-keys/ui-dependencies-a323ed865ff8f01132ebbcfdb26cd46637ee0537"}}
|
|
- cache006-install-yarn_f6bc_{{checksum ".buildcache/cache-keys/install-yarn-f6bc3cf1c8120fc6fbc6a7815f1414ea4a92b347"}}
|
|
- cache006-set-workdir_6821_{{checksum ".buildcache/cache-keys/set-workdir-68217e0df446776a522c173819319331eab24bfd"}}
|
|
- cache006-install-go-tools_4930_{{checksum ".buildcache/cache-keys/install-go-tools-493003a45b9bf13a3740054d1ed1e50aa66e0981"}}
|
|
- cache006-install-go_04fa_{{checksum ".buildcache/cache-keys/install-go-04fac374a5ab393a607df72e77bce85e18dd3856"}}
|
|
- cache006-base_cd50_{{checksum ".buildcache/cache-keys/base-cd50335c2217aa98d45d50d7ef941dfd1289b070"}}
|
|
name: Restore build layer cache
|
|
- run:
|
|
command: |
|
|
make -C packages*.lock load-builder-cache
|
|
name: Load whatever builder cache we have (if any) into the Docker daemon
|
|
no_output_timeout: 30m
|
|
- run:
|
|
command: |2
|
|
|
|
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
|
|
name: Compile Package
|
|
- run:
|
|
command: ls -lahR .buildcache/packages
|
|
name: List packages
|
|
- save_cache:
|
|
key: cache006-package-355fcfc2936dcac87610bc5060591586299471d8-{{checksum ".buildcache/cache-keys/package-355fcfc2936dcac87610bc5060591586299471d8"}}
|
|
name: Saving package cache
|
|
paths:
|
|
- .buildcache/packages/store
|
|
- run:
|
|
command: |
|
|
if [ -f .buildcache/archives/08-warm-go-build-vendor-cache-947f07f88a16ac9f143b6db2b240187e51034442.tar.gz ]; then
|
|
echo "Builder image already cached, skipping cache step."
|
|
circleci-agent step halt
|
|
fi
|
|
name: Check builder cache status
|
|
- run:
|
|
command: make -f packages*.lock/layer.mk 08-warm-go-build-vendor-cache-947f07f88a16ac9f143b6db2b240187e51034442-save
|
|
name: Prepare build layers for caching
|
|
- save_cache:
|
|
key: cache006-warm-go-build-vendor-cache_947f_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-947f07f88a16ac9f143b6db2b240187e51034442"}}
|
|
name: Save build layer cache
|
|
paths:
|
|
- .buildcache/archives/08-warm-go-build-vendor-cache-947f07f88a16ac9f143b6db2b240187e51034442.tar.gz
|
|
install-ui-dependencies:
|
|
docker:
|
|
- image: node:10-buster
|
|
shell: /usr/bin/env bash -euo pipefail -c
|
|
working_directory: /go/src/github.com/hashicorp/vault
|
|
steps:
|
|
- checkout
|
|
- restore_cache:
|
|
key: yarn-lock-v6-{{ checksum "ui/yarn.lock" }}
|
|
- run:
|
|
command: |
|
|
cd ui
|
|
yarn install
|
|
npm rebuild node-sass
|
|
name: Install UI dependencies
|
|
- save_cache:
|
|
key: yarn-lock-v6-{{ checksum "ui/yarn.lock" }}
|
|
paths:
|
|
- ui/node_modules
|
|
build-common-layers:
|
|
machine:
|
|
image: ubuntu-1604:202007-01
|
|
resource_class: xlarge
|
|
shell: /usr/bin/env bash -euo pipefail -c
|
|
steps:
|
|
- add_ssh_keys:
|
|
fingerprints:
|
|
- c6:96:98:82:dc:04:6c:39:dd:ac:83:05:e3:15:1c:98
|
|
- checkout
|
|
- run:
|
|
command: make -C packages*.lock write-builder-cache-keys
|
|
name: Write builder layer cache keys
|
|
- restore_cache:
|
|
keys:
|
|
- cache006-build-ui_8c08_{{checksum ".buildcache/cache-keys/build-ui-8c0888ac60d74cc3c80ff1e66f92529854029bb8"}}
|
|
- cache006-ui-dependencies_a323_{{checksum ".buildcache/cache-keys/ui-dependencies-a323ed865ff8f01132ebbcfdb26cd46637ee0537"}}
|
|
- cache006-install-yarn_f6bc_{{checksum ".buildcache/cache-keys/install-yarn-f6bc3cf1c8120fc6fbc6a7815f1414ea4a92b347"}}
|
|
- cache006-set-workdir_6821_{{checksum ".buildcache/cache-keys/set-workdir-68217e0df446776a522c173819319331eab24bfd"}}
|
|
- cache006-install-go-tools_4930_{{checksum ".buildcache/cache-keys/install-go-tools-493003a45b9bf13a3740054d1ed1e50aa66e0981"}}
|
|
- cache006-install-go_04fa_{{checksum ".buildcache/cache-keys/install-go-04fac374a5ab393a607df72e77bce85e18dd3856"}}
|
|
- cache006-base_cd50_{{checksum ".buildcache/cache-keys/base-cd50335c2217aa98d45d50d7ef941dfd1289b070"}}
|
|
name: Restore build image cache
|
|
- run:
|
|
command: |
|
|
if [ -f .buildcache/archives/06-build-ui-8c0888ac60d74cc3c80ff1e66f92529854029bb8.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
|
|
name: Finish early if loaded exact match from cache.
|
|
- run:
|
|
command: |
|
|
LAYER_SPEC_ID=06-build-ui-8c0888ac60d74cc3c80ff1e66f92529854029bb8 make -C packages*.lock load-builder-cache
|
|
name: Load whatever builder cache we have (if any) into the Docker daemon
|
|
no_output_timeout: 30m
|
|
- run:
|
|
command: |2
|
|
|
|
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-cd50335c2217aa98d45d50d7ef941dfd1289b070-image
|
|
name: Build base layer
|
|
- run:
|
|
command: |2
|
|
|
|
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-install-go-04fac374a5ab393a607df72e77bce85e18dd3856-image
|
|
name: Build install-go layer
|
|
- run:
|
|
command: |2
|
|
|
|
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-install-go-tools-493003a45b9bf13a3740054d1ed1e50aa66e0981-image
|
|
name: Build install-go-tools layer
|
|
- run:
|
|
command: |2
|
|
|
|
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-set-workdir-68217e0df446776a522c173819319331eab24bfd-image
|
|
name: Build set-workdir layer
|
|
- run:
|
|
command: |2
|
|
|
|
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 04-install-yarn-f6bc3cf1c8120fc6fbc6a7815f1414ea4a92b347-image
|
|
name: Build install-yarn layer
|
|
- run:
|
|
command: |2
|
|
|
|
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 05-ui-dependencies-a323ed865ff8f01132ebbcfdb26cd46637ee0537-image
|
|
name: Build ui-dependencies layer
|
|
- run:
|
|
command: |2
|
|
|
|
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 06-build-ui-8c0888ac60d74cc3c80ff1e66f92529854029bb8-image
|
|
name: Build build-ui layer
|
|
- run:
|
|
command: make -f packages*.lock/layer.mk 06-build-ui-8c0888ac60d74cc3c80ff1e66f92529854029bb8-save
|
|
name: Export builder image
|
|
- save_cache:
|
|
key: cache006-build-ui_8c08_{{checksum ".buildcache/cache-keys/build-ui-8c0888ac60d74cc3c80ff1e66f92529854029bb8"}}
|
|
name: Save layer build-ui to cache.
|
|
paths:
|
|
- .buildcache/archives/06-build-ui-8c0888ac60d74cc3c80ff1e66f92529854029bb8.tar.gz
|
|
- run:
|
|
command: mv .buildcache/archives/06-build-ui-8c0888ac60d74cc3c80ff1e66f92529854029bb8.tar.gz .buildcache/archives/05-ui-dependencies-a323ed865ff8f01132ebbcfdb26cd46637ee0537.tar.gz
|
|
name: Prepare layer ui-dependencies for caching
|
|
- save_cache:
|
|
key: cache006-ui-dependencies_a323_{{checksum ".buildcache/cache-keys/ui-dependencies-a323ed865ff8f01132ebbcfdb26cd46637ee0537"}}
|
|
name: Save layer ui-dependencies to cache.
|
|
paths:
|
|
- .buildcache/archives/05-ui-dependencies-a323ed865ff8f01132ebbcfdb26cd46637ee0537.tar.gz
|
|
- run:
|
|
command: mv .buildcache/archives/05-ui-dependencies-a323ed865ff8f01132ebbcfdb26cd46637ee0537.tar.gz .buildcache/archives/04-install-yarn-f6bc3cf1c8120fc6fbc6a7815f1414ea4a92b347.tar.gz
|
|
name: Prepare layer install-yarn for caching
|
|
- save_cache:
|
|
key: cache006-install-yarn_f6bc_{{checksum ".buildcache/cache-keys/install-yarn-f6bc3cf1c8120fc6fbc6a7815f1414ea4a92b347"}}
|
|
name: Save layer install-yarn to cache.
|
|
paths:
|
|
- .buildcache/archives/04-install-yarn-f6bc3cf1c8120fc6fbc6a7815f1414ea4a92b347.tar.gz
|
|
- run:
|
|
command: mv .buildcache/archives/04-install-yarn-f6bc3cf1c8120fc6fbc6a7815f1414ea4a92b347.tar.gz .buildcache/archives/03-set-workdir-68217e0df446776a522c173819319331eab24bfd.tar.gz
|
|
name: Prepare layer set-workdir for caching
|
|
- save_cache:
|
|
key: cache006-set-workdir_6821_{{checksum ".buildcache/cache-keys/set-workdir-68217e0df446776a522c173819319331eab24bfd"}}
|
|
name: Save layer set-workdir to cache.
|
|
paths:
|
|
- .buildcache/archives/03-set-workdir-68217e0df446776a522c173819319331eab24bfd.tar.gz
|
|
- run:
|
|
command: mv .buildcache/archives/03-set-workdir-68217e0df446776a522c173819319331eab24bfd.tar.gz .buildcache/archives/02-install-go-tools-493003a45b9bf13a3740054d1ed1e50aa66e0981.tar.gz
|
|
name: Prepare layer install-go-tools for caching
|
|
- save_cache:
|
|
key: cache006-install-go-tools_4930_{{checksum ".buildcache/cache-keys/install-go-tools-493003a45b9bf13a3740054d1ed1e50aa66e0981"}}
|
|
name: Save layer install-go-tools to cache.
|
|
paths:
|
|
- .buildcache/archives/02-install-go-tools-493003a45b9bf13a3740054d1ed1e50aa66e0981.tar.gz
|
|
- run:
|
|
command: mv .buildcache/archives/02-install-go-tools-493003a45b9bf13a3740054d1ed1e50aa66e0981.tar.gz .buildcache/archives/01-install-go-04fac374a5ab393a607df72e77bce85e18dd3856.tar.gz
|
|
name: Prepare layer install-go for caching
|
|
- save_cache:
|
|
key: cache006-install-go_04fa_{{checksum ".buildcache/cache-keys/install-go-04fac374a5ab393a607df72e77bce85e18dd3856"}}
|
|
name: Save layer install-go to cache.
|
|
paths:
|
|
- .buildcache/archives/01-install-go-04fac374a5ab393a607df72e77bce85e18dd3856.tar.gz
|
|
- run:
|
|
command: mv .buildcache/archives/01-install-go-04fac374a5ab393a607df72e77bce85e18dd3856.tar.gz .buildcache/archives/00-base-cd50335c2217aa98d45d50d7ef941dfd1289b070.tar.gz
|
|
name: Prepare layer base for caching
|
|
- save_cache:
|
|
key: cache006-base_cd50_{{checksum ".buildcache/cache-keys/base-cd50335c2217aa98d45d50d7ef941dfd1289b070"}}
|
|
name: Save layer base to cache.
|
|
paths:
|
|
- .buildcache/archives/00-base-cd50335c2217aa98d45d50d7ef941dfd1289b070.tar.gz
|
|
environment:
|
|
- AUTO_INSTALL_TOOLS: 'YES'
|
|
- BUILDKIT_PROGRESS: plain
|
|
- PRODUCT_REVISION: ''
|
|
linux_arm64_package:
|
|
docker:
|
|
- image: circleci/buildpack-deps
|
|
shell: /usr/bin/env bash -euo pipefail -c
|
|
environment:
|
|
- AUTO_INSTALL_TOOLS: 'YES'
|
|
- BUILDKIT_PROGRESS: plain
|
|
- PRODUCT_REVISION: ''
|
|
- PACKAGE_SPEC_ID: 5d98fd6000f50430ded790d9356a8253395305ec
|
|
steps:
|
|
- setup_remote_docker:
|
|
version: 19.03.12
|
|
- add_ssh_keys:
|
|
fingerprints:
|
|
- c6:96:98:82:dc:04:6c:39:dd:ac:83:05:e3:15:1c:98
|
|
- checkout
|
|
- run:
|
|
command: make -C packages*.lock write-package-cache-key
|
|
name: Write package cache key
|
|
- restore_cache:
|
|
key: cache006-package-5d98fd6000f50430ded790d9356a8253395305ec-{{checksum ".buildcache/cache-keys/package-5d98fd6000f50430ded790d9356a8253395305ec"}}
|
|
name: Restore package cache
|
|
- run:
|
|
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
|
|
name: Check the cache status.
|
|
- run:
|
|
command: make -C packages*.lock write-builder-cache-keys
|
|
name: Write builder layer cache keys
|
|
- restore_cache:
|
|
keys:
|
|
- cache006-copy-source_91e8_{{checksum ".buildcache/cache-keys/copy-source-91e8bb278d25180dcb516f63189718f0280f5625"}}
|
|
- cache006-warm-go-build-vendor-cache_bd9c_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-bd9cb1ba0e74a62a1d117e827fa88e80f256a746"}}
|
|
- cache006-build-static-assets_5d03_{{checksum ".buildcache/cache-keys/build-static-assets-5d03b27bdb30353a4b10b43aaeed34d1843ea016"}}
|
|
- cache006-build-ui_8c08_{{checksum ".buildcache/cache-keys/build-ui-8c0888ac60d74cc3c80ff1e66f92529854029bb8"}}
|
|
- cache006-ui-dependencies_a323_{{checksum ".buildcache/cache-keys/ui-dependencies-a323ed865ff8f01132ebbcfdb26cd46637ee0537"}}
|
|
- cache006-install-yarn_f6bc_{{checksum ".buildcache/cache-keys/install-yarn-f6bc3cf1c8120fc6fbc6a7815f1414ea4a92b347"}}
|
|
- cache006-set-workdir_6821_{{checksum ".buildcache/cache-keys/set-workdir-68217e0df446776a522c173819319331eab24bfd"}}
|
|
- cache006-install-go-tools_4930_{{checksum ".buildcache/cache-keys/install-go-tools-493003a45b9bf13a3740054d1ed1e50aa66e0981"}}
|
|
- cache006-install-go_04fa_{{checksum ".buildcache/cache-keys/install-go-04fac374a5ab393a607df72e77bce85e18dd3856"}}
|
|
- cache006-base_cd50_{{checksum ".buildcache/cache-keys/base-cd50335c2217aa98d45d50d7ef941dfd1289b070"}}
|
|
name: Restore build layer cache
|
|
- run:
|
|
command: |
|
|
make -C packages*.lock load-builder-cache
|
|
name: Load whatever builder cache we have (if any) into the Docker daemon
|
|
no_output_timeout: 30m
|
|
- run:
|
|
command: |2
|
|
|
|
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
|
|
name: Compile Package
|
|
- run:
|
|
command: ls -lahR .buildcache/packages
|
|
name: List packages
|
|
- save_cache:
|
|
key: cache006-package-5d98fd6000f50430ded790d9356a8253395305ec-{{checksum ".buildcache/cache-keys/package-5d98fd6000f50430ded790d9356a8253395305ec"}}
|
|
name: Saving package cache
|
|
paths:
|
|
- .buildcache/packages/store
|
|
- run:
|
|
command: |
|
|
if [ -f .buildcache/archives/08-warm-go-build-vendor-cache-bd9cb1ba0e74a62a1d117e827fa88e80f256a746.tar.gz ]; then
|
|
echo "Builder image already cached, skipping cache step."
|
|
circleci-agent step halt
|
|
fi
|
|
name: Check builder cache status
|
|
- run:
|
|
command: make -f packages*.lock/layer.mk 08-warm-go-build-vendor-cache-bd9cb1ba0e74a62a1d117e827fa88e80f256a746-save
|
|
name: Prepare build layers for caching
|
|
- save_cache:
|
|
key: cache006-warm-go-build-vendor-cache_bd9c_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-bd9cb1ba0e74a62a1d117e827fa88e80f256a746"}}
|
|
name: Save build layer cache
|
|
paths:
|
|
- .buildcache/archives/08-warm-go-build-vendor-cache-bd9cb1ba0e74a62a1d117e827fa88e80f256a746.tar.gz
|
|
test-ui:
|
|
docker:
|
|
- image: node:10-buster
|
|
shell: /usr/bin/env bash -euo pipefail -c
|
|
working_directory: /go/src/github.com/hashicorp/vault
|
|
resource_class: medium+
|
|
steps:
|
|
- checkout
|
|
- restore_cache:
|
|
key: yarn-lock-v6-{{ checksum "ui/yarn.lock" }}
|
|
- attach_workspace:
|
|
at: .
|
|
- run:
|
|
command: |
|
|
set -x
|
|
|
|
# Install Chrome
|
|
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub \
|
|
| apt-key add -
|
|
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" \
|
|
| tee /etc/apt/sources.list.d/google-chrome.list
|
|
apt-get update
|
|
apt-get -y install google-chrome-stable
|
|
rm /etc/apt/sources.list.d/google-chrome.list
|
|
rm -rf /var/lib/apt/lists/* /var/cache/apt/*
|
|
|
|
# Add ./bin to the PATH so vault binary can be run by Ember tests
|
|
export PATH="${PWD}/bin:${PATH}"
|
|
|
|
# Run Ember tests
|
|
cd ui
|
|
mkdir -p test-results/qunit
|
|
yarn test:oss
|
|
name: Test UI
|
|
- store_artifacts:
|
|
path: ui/test-results
|
|
- store_test_results:
|
|
path: ui/test-results
|
|
linux_arm_package:
|
|
docker:
|
|
- image: circleci/buildpack-deps
|
|
shell: /usr/bin/env bash -euo pipefail -c
|
|
environment:
|
|
- AUTO_INSTALL_TOOLS: 'YES'
|
|
- BUILDKIT_PROGRESS: plain
|
|
- PRODUCT_REVISION: ''
|
|
- PACKAGE_SPEC_ID: f6da1ed126cbd8ed4119da63c1fab12b6e758cf8
|
|
steps:
|
|
- setup_remote_docker:
|
|
version: 19.03.12
|
|
- add_ssh_keys:
|
|
fingerprints:
|
|
- c6:96:98:82:dc:04:6c:39:dd:ac:83:05:e3:15:1c:98
|
|
- checkout
|
|
- run:
|
|
command: make -C packages*.lock write-package-cache-key
|
|
name: Write package cache key
|
|
- restore_cache:
|
|
key: cache006-package-f6da1ed126cbd8ed4119da63c1fab12b6e758cf8-{{checksum ".buildcache/cache-keys/package-f6da1ed126cbd8ed4119da63c1fab12b6e758cf8"}}
|
|
name: Restore package cache
|
|
- run:
|
|
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
|
|
name: Check the cache status.
|
|
- run:
|
|
command: make -C packages*.lock write-builder-cache-keys
|
|
name: Write builder layer cache keys
|
|
- restore_cache:
|
|
keys:
|
|
- cache006-copy-source_4302_{{checksum ".buildcache/cache-keys/copy-source-43020c5d846d94f2fc5526c8a2dda0c3909bcc25"}}
|
|
- cache006-warm-go-build-vendor-cache_e13f_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-e13f21965c46bfa4c74795563a55268fe8a732c8"}}
|
|
- cache006-build-static-assets_5d03_{{checksum ".buildcache/cache-keys/build-static-assets-5d03b27bdb30353a4b10b43aaeed34d1843ea016"}}
|
|
- cache006-build-ui_8c08_{{checksum ".buildcache/cache-keys/build-ui-8c0888ac60d74cc3c80ff1e66f92529854029bb8"}}
|
|
- cache006-ui-dependencies_a323_{{checksum ".buildcache/cache-keys/ui-dependencies-a323ed865ff8f01132ebbcfdb26cd46637ee0537"}}
|
|
- cache006-install-yarn_f6bc_{{checksum ".buildcache/cache-keys/install-yarn-f6bc3cf1c8120fc6fbc6a7815f1414ea4a92b347"}}
|
|
- cache006-set-workdir_6821_{{checksum ".buildcache/cache-keys/set-workdir-68217e0df446776a522c173819319331eab24bfd"}}
|
|
- cache006-install-go-tools_4930_{{checksum ".buildcache/cache-keys/install-go-tools-493003a45b9bf13a3740054d1ed1e50aa66e0981"}}
|
|
- cache006-install-go_04fa_{{checksum ".buildcache/cache-keys/install-go-04fac374a5ab393a607df72e77bce85e18dd3856"}}
|
|
- cache006-base_cd50_{{checksum ".buildcache/cache-keys/base-cd50335c2217aa98d45d50d7ef941dfd1289b070"}}
|
|
name: Restore build layer cache
|
|
- run:
|
|
command: |
|
|
make -C packages*.lock load-builder-cache
|
|
name: Load whatever builder cache we have (if any) into the Docker daemon
|
|
no_output_timeout: 30m
|
|
- run:
|
|
command: |2
|
|
|
|
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
|
|
name: Compile Package
|
|
- run:
|
|
command: ls -lahR .buildcache/packages
|
|
name: List packages
|
|
- save_cache:
|
|
key: cache006-package-f6da1ed126cbd8ed4119da63c1fab12b6e758cf8-{{checksum ".buildcache/cache-keys/package-f6da1ed126cbd8ed4119da63c1fab12b6e758cf8"}}
|
|
name: Saving package cache
|
|
paths:
|
|
- .buildcache/packages/store
|
|
- run:
|
|
command: |
|
|
if [ -f .buildcache/archives/08-warm-go-build-vendor-cache-e13f21965c46bfa4c74795563a55268fe8a732c8.tar.gz ]; then
|
|
echo "Builder image already cached, skipping cache step."
|
|
circleci-agent step halt
|
|
fi
|
|
name: Check builder cache status
|
|
- run:
|
|
command: make -f packages*.lock/layer.mk 08-warm-go-build-vendor-cache-e13f21965c46bfa4c74795563a55268fe8a732c8-save
|
|
name: Prepare build layers for caching
|
|
- save_cache:
|
|
key: cache006-warm-go-build-vendor-cache_e13f_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-e13f21965c46bfa4c74795563a55268fe8a732c8"}}
|
|
name: Save build layer cache
|
|
paths:
|
|
- .buildcache/archives/08-warm-go-build-vendor-cache-e13f21965c46bfa4c74795563a55268fe8a732c8.tar.gz
|
|
test-ui-browserstack:
|
|
docker:
|
|
- image: node:10-buster
|
|
shell: /usr/bin/env bash -euo pipefail -c
|
|
working_directory: /go/src/github.com/hashicorp/vault
|
|
resource_class: medium+
|
|
steps:
|
|
- checkout
|
|
- restore_cache:
|
|
key: yarn-lock-v6-{{ checksum "ui/yarn.lock" }}
|
|
- attach_workspace:
|
|
at: .
|
|
- run:
|
|
command: |
|
|
# Add ./bin to the PATH so vault binary can be found.
|
|
export PATH="${PWD}"/bin:${PATH}
|
|
make test-ui-browserstack
|
|
name: Run Browserstack Tests
|
|
darwin_386_package:
|
|
docker:
|
|
- image: circleci/buildpack-deps
|
|
shell: /usr/bin/env bash -euo pipefail -c
|
|
environment:
|
|
- AUTO_INSTALL_TOOLS: 'YES'
|
|
- BUILDKIT_PROGRESS: plain
|
|
- PRODUCT_REVISION: ''
|
|
- PACKAGE_SPEC_ID: 4100a546c7a2deb7ac3bea5970bedfed2eebe64c
|
|
steps:
|
|
- setup_remote_docker:
|
|
version: 19.03.12
|
|
- add_ssh_keys:
|
|
fingerprints:
|
|
- c6:96:98:82:dc:04:6c:39:dd:ac:83:05:e3:15:1c:98
|
|
- checkout
|
|
- run:
|
|
command: make -C packages*.lock write-package-cache-key
|
|
name: Write package cache key
|
|
- restore_cache:
|
|
key: cache006-package-4100a546c7a2deb7ac3bea5970bedfed2eebe64c-{{checksum ".buildcache/cache-keys/package-4100a546c7a2deb7ac3bea5970bedfed2eebe64c"}}
|
|
name: Restore package cache
|
|
- run:
|
|
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
|
|
name: Check the cache status.
|
|
- run:
|
|
command: make -C packages*.lock write-builder-cache-keys
|
|
name: Write builder layer cache keys
|
|
- restore_cache:
|
|
keys:
|
|
- cache006-copy-source_21dd_{{checksum ".buildcache/cache-keys/copy-source-21dd30d3110c6bd6831b9295d43d6007a276763f"}}
|
|
- cache006-warm-go-build-vendor-cache_202e_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-202ef0ffb92864c99426f3bbcf24097abf79b796"}}
|
|
- cache006-build-static-assets_5d03_{{checksum ".buildcache/cache-keys/build-static-assets-5d03b27bdb30353a4b10b43aaeed34d1843ea016"}}
|
|
- cache006-build-ui_8c08_{{checksum ".buildcache/cache-keys/build-ui-8c0888ac60d74cc3c80ff1e66f92529854029bb8"}}
|
|
- cache006-ui-dependencies_a323_{{checksum ".buildcache/cache-keys/ui-dependencies-a323ed865ff8f01132ebbcfdb26cd46637ee0537"}}
|
|
- cache006-install-yarn_f6bc_{{checksum ".buildcache/cache-keys/install-yarn-f6bc3cf1c8120fc6fbc6a7815f1414ea4a92b347"}}
|
|
- cache006-set-workdir_6821_{{checksum ".buildcache/cache-keys/set-workdir-68217e0df446776a522c173819319331eab24bfd"}}
|
|
- cache006-install-go-tools_4930_{{checksum ".buildcache/cache-keys/install-go-tools-493003a45b9bf13a3740054d1ed1e50aa66e0981"}}
|
|
- cache006-install-go_04fa_{{checksum ".buildcache/cache-keys/install-go-04fac374a5ab393a607df72e77bce85e18dd3856"}}
|
|
- cache006-base_cd50_{{checksum ".buildcache/cache-keys/base-cd50335c2217aa98d45d50d7ef941dfd1289b070"}}
|
|
name: Restore build layer cache
|
|
- run:
|
|
command: |
|
|
make -C packages*.lock load-builder-cache
|
|
name: Load whatever builder cache we have (if any) into the Docker daemon
|
|
no_output_timeout: 30m
|
|
- run:
|
|
command: |2
|
|
|
|
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
|
|
name: Compile Package
|
|
- run:
|
|
command: ls -lahR .buildcache/packages
|
|
name: List packages
|
|
- save_cache:
|
|
key: cache006-package-4100a546c7a2deb7ac3bea5970bedfed2eebe64c-{{checksum ".buildcache/cache-keys/package-4100a546c7a2deb7ac3bea5970bedfed2eebe64c"}}
|
|
name: Saving package cache
|
|
paths:
|
|
- .buildcache/packages/store
|
|
- run:
|
|
command: |
|
|
if [ -f .buildcache/archives/08-warm-go-build-vendor-cache-202ef0ffb92864c99426f3bbcf24097abf79b796.tar.gz ]; then
|
|
echo "Builder image already cached, skipping cache step."
|
|
circleci-agent step halt
|
|
fi
|
|
name: Check builder cache status
|
|
- run:
|
|
command: make -f packages*.lock/layer.mk 08-warm-go-build-vendor-cache-202ef0ffb92864c99426f3bbcf24097abf79b796-save
|
|
name: Prepare build layers for caching
|
|
- save_cache:
|
|
key: cache006-warm-go-build-vendor-cache_202e_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-202ef0ffb92864c99426f3bbcf24097abf79b796"}}
|
|
name: Save build layer cache
|
|
paths:
|
|
- .buildcache/archives/08-warm-go-build-vendor-cache-202ef0ffb92864c99426f3bbcf24097abf79b796.tar.gz
|
|
build-go-dev:
|
|
machine: true
|
|
shell: /usr/bin/env bash -euo pipefail -c
|
|
working_directory: /go/src/github.com/hashicorp/vault
|
|
steps:
|
|
- run:
|
|
command: |
|
|
[ -n "$GO_VERSION" ] || { echo "You must set GO_VERSION"; exit 1; }
|
|
# Install Go
|
|
curl -sSLO "https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz"
|
|
sudo rm -rf /usr/local/go
|
|
sudo tar -C /usr/local -xzf "go${GO_VERSION}.linux-amd64.tar.gz"
|
|
rm -f "go${GO_VERSION}.linux-amd64.tar.gz"
|
|
GOPATH="/go"
|
|
mkdir $GOPATH 2>/dev/null || { sudo mkdir $GOPATH && sudo chmod 777 $GOPATH; }
|
|
echo "export GOPATH='$GOPATH'" >> "$BASH_ENV"
|
|
echo "export PATH='$PATH:$GOPATH/bin:/usr/local/go/bin'" >> "$BASH_ENV"
|
|
|
|
echo "$ go version"
|
|
go version
|
|
name: Setup Go
|
|
working_directory: ~/
|
|
- checkout
|
|
- attach_workspace:
|
|
at: .
|
|
- run:
|
|
command: |
|
|
# Move dev UI assets to expected location
|
|
rm -rf ./pkg
|
|
mkdir ./pkg
|
|
|
|
# Build dev binary
|
|
make ci-bootstrap dev
|
|
name: Build dev binary
|
|
- persist_to_workspace:
|
|
paths:
|
|
- bin
|
|
root: .
|
|
environment:
|
|
- CIRCLECI_CLI_VERSION: 0.1.5546
|
|
- GO_TAGS: ''
|
|
- GO_VERSION: 1.14.7
|
|
- GO111MODULE: 'off'
|
|
- GOTESTSUM_VERSION: 0.5.2
|
|
algolia-index:
|
|
docker:
|
|
- image: node:12
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
command: |
|
|
if [ "$CIRCLE_REPOSITORY_URL" != "git@github.com:hashicorp/vault.git" ]; then
|
|
echo "Not Vault OSS Repo, not indexing Algolia"
|
|
exit 0
|
|
fi
|
|
cd website/
|
|
npm install
|
|
node scripts/index_search_content.js
|
|
name: Push content to Algolia Index
|
|
linux_386_package:
|
|
docker:
|
|
- image: circleci/buildpack-deps
|
|
shell: /usr/bin/env bash -euo pipefail -c
|
|
environment:
|
|
- AUTO_INSTALL_TOOLS: 'YES'
|
|
- BUILDKIT_PROGRESS: plain
|
|
- PRODUCT_REVISION: ''
|
|
- PACKAGE_SPEC_ID: 281190f33a5f3e27aa6bcd886810bcdd7e0160e2
|
|
steps:
|
|
- setup_remote_docker:
|
|
version: 19.03.12
|
|
- add_ssh_keys:
|
|
fingerprints:
|
|
- c6:96:98:82:dc:04:6c:39:dd:ac:83:05:e3:15:1c:98
|
|
- checkout
|
|
- run:
|
|
command: make -C packages*.lock write-package-cache-key
|
|
name: Write package cache key
|
|
- restore_cache:
|
|
key: cache006-package-281190f33a5f3e27aa6bcd886810bcdd7e0160e2-{{checksum ".buildcache/cache-keys/package-281190f33a5f3e27aa6bcd886810bcdd7e0160e2"}}
|
|
name: Restore package cache
|
|
- run:
|
|
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
|
|
name: Check the cache status.
|
|
- run:
|
|
command: make -C packages*.lock write-builder-cache-keys
|
|
name: Write builder layer cache keys
|
|
- restore_cache:
|
|
keys:
|
|
- cache006-copy-source_b31f_{{checksum ".buildcache/cache-keys/copy-source-b31f38efa9553e222b791fa52d76ab248f318d6a"}}
|
|
- cache006-warm-go-build-vendor-cache_eac3_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-eac34e5daaf2ee2e27fe39448b62d8cdff4e800e"}}
|
|
- cache006-build-static-assets_5d03_{{checksum ".buildcache/cache-keys/build-static-assets-5d03b27bdb30353a4b10b43aaeed34d1843ea016"}}
|
|
- cache006-build-ui_8c08_{{checksum ".buildcache/cache-keys/build-ui-8c0888ac60d74cc3c80ff1e66f92529854029bb8"}}
|
|
- cache006-ui-dependencies_a323_{{checksum ".buildcache/cache-keys/ui-dependencies-a323ed865ff8f01132ebbcfdb26cd46637ee0537"}}
|
|
- cache006-install-yarn_f6bc_{{checksum ".buildcache/cache-keys/install-yarn-f6bc3cf1c8120fc6fbc6a7815f1414ea4a92b347"}}
|
|
- cache006-set-workdir_6821_{{checksum ".buildcache/cache-keys/set-workdir-68217e0df446776a522c173819319331eab24bfd"}}
|
|
- cache006-install-go-tools_4930_{{checksum ".buildcache/cache-keys/install-go-tools-493003a45b9bf13a3740054d1ed1e50aa66e0981"}}
|
|
- cache006-install-go_04fa_{{checksum ".buildcache/cache-keys/install-go-04fac374a5ab393a607df72e77bce85e18dd3856"}}
|
|
- cache006-base_cd50_{{checksum ".buildcache/cache-keys/base-cd50335c2217aa98d45d50d7ef941dfd1289b070"}}
|
|
name: Restore build layer cache
|
|
- run:
|
|
command: |
|
|
make -C packages*.lock load-builder-cache
|
|
name: Load whatever builder cache we have (if any) into the Docker daemon
|
|
no_output_timeout: 30m
|
|
- run:
|
|
command: |2
|
|
|
|
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
|
|
name: Compile Package
|
|
- run:
|
|
command: ls -lahR .buildcache/packages
|
|
name: List packages
|
|
- save_cache:
|
|
key: cache006-package-281190f33a5f3e27aa6bcd886810bcdd7e0160e2-{{checksum ".buildcache/cache-keys/package-281190f33a5f3e27aa6bcd886810bcdd7e0160e2"}}
|
|
name: Saving package cache
|
|
paths:
|
|
- .buildcache/packages/store
|
|
- run:
|
|
command: |
|
|
if [ -f .buildcache/archives/08-warm-go-build-vendor-cache-eac34e5daaf2ee2e27fe39448b62d8cdff4e800e.tar.gz ]; then
|
|
echo "Builder image already cached, skipping cache step."
|
|
circleci-agent step halt
|
|
fi
|
|
name: Check builder cache status
|
|
- run:
|
|
command: make -f packages*.lock/layer.mk 08-warm-go-build-vendor-cache-eac34e5daaf2ee2e27fe39448b62d8cdff4e800e-save
|
|
name: Prepare build layers for caching
|
|
- save_cache:
|
|
key: cache006-warm-go-build-vendor-cache_eac3_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-eac34e5daaf2ee2e27fe39448b62d8cdff4e800e"}}
|
|
name: Save build layer cache
|
|
paths:
|
|
- .buildcache/archives/08-warm-go-build-vendor-cache-eac34e5daaf2ee2e27fe39448b62d8cdff4e800e.tar.gz
|
|
test-go-remote-docker:
|
|
docker:
|
|
- image: circleci/golang:1.14.7-stretch
|
|
resource_class: large
|
|
working_directory: /go/src/github.com/hashicorp/vault
|
|
parallelism: 8
|
|
steps:
|
|
- run:
|
|
command: |
|
|
# If the branch being tested starts with ui/ or docs/ we want to exit the job without failing
|
|
[[ "$CIRCLE_BRANCH" = ui/* || "$CIRCLE_BRANCH" = docs/* ]] && {
|
|
# stop the job from this step
|
|
circleci-agent step halt
|
|
}
|
|
# exit with success either way
|
|
exit 0
|
|
name: Check branch name
|
|
working_directory: ~/
|
|
- checkout
|
|
- setup_remote_docker:
|
|
docker_layer_caching: true
|
|
version: 18.09.3
|
|
- run:
|
|
command: |
|
|
TZ=GMT date '+%Y%m%d' > /tmp/go-cache-key
|
|
name: Compute test cache key
|
|
- restore_cache:
|
|
keys:
|
|
- go-test-cache-date-v1-{{ checksum "/tmp/go-cache-key" }}
|
|
- run:
|
|
command: |
|
|
set -x
|
|
|
|
case "" in
|
|
*-race*) export VAULT_CI_GO_TEST_RACE=1;;
|
|
esac
|
|
|
|
# Install CircleCI CLI
|
|
curl -sSL \
|
|
"https://github.com/CircleCI-Public/circleci-cli/releases/download/v${CIRCLECI_CLI_VERSION}/circleci-cli_${CIRCLECI_CLI_VERSION}_linux_amd64.tar.gz" \
|
|
| sudo tar --overwrite -xz \
|
|
-C /usr/local/bin \
|
|
"circleci-cli_${CIRCLECI_CLI_VERSION}_linux_amd64/circleci"
|
|
|
|
USE_DOCKER=0
|
|
USE_DOCKER=1
|
|
|
|
# Split Go tests by prior test times. If use_docker is true, only run
|
|
# tests that depend on docker, otherwise only those that don't.
|
|
if [ $USE_DOCKER == 1 ]; then
|
|
package_names=$(go list -test -json ./... |
|
|
jq -r 'select(.Deps != null) |
|
|
select(any(.Deps[] ; contains("github.com/hashicorp/vault/helper/testhelpers/docker"))) |
|
|
.ForTest | select(. != null)' |
|
|
sort -u | circleci tests split --split-by=timings --timings-type=classname)
|
|
else
|
|
package_names=$(go list -test -json ./... |
|
|
jq -r 'select(.Deps != null) |
|
|
select(all(.Deps[] ; contains("github.com/hashicorp/vault/helper/testhelpers/docker")|not)) |
|
|
.ForTest | select(. != null)' |
|
|
sort -u | circleci tests split --split-by=timings --timings-type=classname)
|
|
fi
|
|
|
|
# After running tests split step, we are now running the following steps
|
|
# in multiple different containers, each getting a different subset of
|
|
# the test packages in their package_names variable. Each container
|
|
# has its own remote docker VM.
|
|
|
|
make prep
|
|
mkdir -p test-results/go-test
|
|
|
|
# Create a docker network for our testcontainer
|
|
if [ $USE_DOCKER == 1 ]; then
|
|
# Despite the fact that we're using a circleci image (thus getting the
|
|
# version they chose for the docker cli) and that we're specifying a
|
|
# docker version to use for the remote docker instances, we occasionally
|
|
# see "client version too new, max supported version 1.39" errors for
|
|
# reasons unclear.
|
|
export DOCKER_API_VERSION=1.39
|
|
|
|
export TEST_DOCKER_NETWORK_ID=$(docker network list -q -f 'name=vaulttest')
|
|
if [ -z $TEST_DOCKER_NETWORK_ID ]; then
|
|
TEST_DOCKER_NETWORK_ID=$(docker network create vaulttest)
|
|
fi
|
|
|
|
# Start a docker testcontainer to run the tests in
|
|
docker run -d -e TEST_DOCKER_NETWORK_ID \
|
|
-e DOCKER_CERT_PATH -e DOCKER_HOST -e DOCKER_MACHINE_NAME -e DOCKER_TLS_VERIFY -e NO_PROXY \
|
|
-e VAULT_TEST_LOG_DIR=/tmp/testlogs \
|
|
--network vaulttest --name \
|
|
testcontainer circleci/golang:1.14.7-stretch \
|
|
tail -f /dev/null
|
|
|
|
# Run tests
|
|
test -d /tmp/go-cache && docker cp /tmp/go-cache testcontainer:/tmp/gocache
|
|
docker exec testcontainer sh -c 'mkdir -p /go/src/github.com/hashicorp/vault'
|
|
docker cp . testcontainer:/go/src/github.com/hashicorp/vault/
|
|
docker cp $DOCKER_CERT_PATH/ testcontainer:$DOCKER_CERT_PATH
|
|
|
|
docker exec -w /go/src/github.com/hashicorp/vault/ \
|
|
-e GO111MODULE -e CIRCLECI -e GOCACHE=/tmp/gocache -e VAULT_CI_GO_TEST_RACE \
|
|
testcontainer \
|
|
gotestsum --format=short-verbose \
|
|
--junitfile test-results/go-test/results.xml \
|
|
--jsonfile test-results/go-test/results.json \
|
|
-- \
|
|
-tags "${GO_TAGS}" \
|
|
-timeout=60m \
|
|
-parallel=20 \
|
|
\
|
|
${package_names}
|
|
else
|
|
GOCACHE=/tmp/go-cache \
|
|
gotestsum --format=short-verbose \
|
|
--junitfile test-results/go-test/results.xml \
|
|
--jsonfile test-results/go-test/results.json \
|
|
-- \
|
|
-tags "${GO_TAGS}" \
|
|
-timeout=60m \
|
|
-parallel=20 \
|
|
\
|
|
${package_names}
|
|
fi
|
|
name: Run Go tests
|
|
no_output_timeout: 60m
|
|
- run:
|
|
command: |
|
|
docker cp testcontainer:/go/src/github.com/hashicorp/vault/test-results .
|
|
docker cp testcontainer:/tmp/gocache /tmp/go-cache
|
|
name: Copy test results
|
|
when: always
|
|
- store_artifacts:
|
|
path: test-results
|
|
- store_test_results:
|
|
path: test-results
|
|
- store_artifacts:
|
|
path: /tmp/testlogs
|
|
environment:
|
|
- CIRCLECI_CLI_VERSION: 0.1.5546
|
|
- GO_TAGS: ''
|
|
- GO111MODULE: 'off'
|
|
freebsd_386_package:
|
|
docker:
|
|
- image: circleci/buildpack-deps
|
|
shell: /usr/bin/env bash -euo pipefail -c
|
|
environment:
|
|
- AUTO_INSTALL_TOOLS: 'YES'
|
|
- BUILDKIT_PROGRESS: plain
|
|
- PRODUCT_REVISION: ''
|
|
- PACKAGE_SPEC_ID: beaf7ce640bd8bbb15ddfdb3c7b199032dbd0b60
|
|
steps:
|
|
- setup_remote_docker:
|
|
version: 19.03.12
|
|
- add_ssh_keys:
|
|
fingerprints:
|
|
- c6:96:98:82:dc:04:6c:39:dd:ac:83:05:e3:15:1c:98
|
|
- checkout
|
|
- run:
|
|
command: make -C packages*.lock write-package-cache-key
|
|
name: Write package cache key
|
|
- restore_cache:
|
|
key: cache006-package-beaf7ce640bd8bbb15ddfdb3c7b199032dbd0b60-{{checksum ".buildcache/cache-keys/package-beaf7ce640bd8bbb15ddfdb3c7b199032dbd0b60"}}
|
|
name: Restore package cache
|
|
- run:
|
|
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
|
|
name: Check the cache status.
|
|
- run:
|
|
command: make -C packages*.lock write-builder-cache-keys
|
|
name: Write builder layer cache keys
|
|
- restore_cache:
|
|
keys:
|
|
- cache006-copy-source_bf33_{{checksum ".buildcache/cache-keys/copy-source-bf3395f720fd39ee12ee1bdda6d9ff3de1f9b025"}}
|
|
- cache006-warm-go-build-vendor-cache_f071_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-f071c4c6ddd555cce3092b98f8b19115eb23f372"}}
|
|
- cache006-build-static-assets_5d03_{{checksum ".buildcache/cache-keys/build-static-assets-5d03b27bdb30353a4b10b43aaeed34d1843ea016"}}
|
|
- cache006-build-ui_8c08_{{checksum ".buildcache/cache-keys/build-ui-8c0888ac60d74cc3c80ff1e66f92529854029bb8"}}
|
|
- cache006-ui-dependencies_a323_{{checksum ".buildcache/cache-keys/ui-dependencies-a323ed865ff8f01132ebbcfdb26cd46637ee0537"}}
|
|
- cache006-install-yarn_f6bc_{{checksum ".buildcache/cache-keys/install-yarn-f6bc3cf1c8120fc6fbc6a7815f1414ea4a92b347"}}
|
|
- cache006-set-workdir_6821_{{checksum ".buildcache/cache-keys/set-workdir-68217e0df446776a522c173819319331eab24bfd"}}
|
|
- cache006-install-go-tools_4930_{{checksum ".buildcache/cache-keys/install-go-tools-493003a45b9bf13a3740054d1ed1e50aa66e0981"}}
|
|
- cache006-install-go_04fa_{{checksum ".buildcache/cache-keys/install-go-04fac374a5ab393a607df72e77bce85e18dd3856"}}
|
|
- cache006-base_cd50_{{checksum ".buildcache/cache-keys/base-cd50335c2217aa98d45d50d7ef941dfd1289b070"}}
|
|
name: Restore build layer cache
|
|
- run:
|
|
command: |
|
|
make -C packages*.lock load-builder-cache
|
|
name: Load whatever builder cache we have (if any) into the Docker daemon
|
|
no_output_timeout: 30m
|
|
- run:
|
|
command: |2
|
|
|
|
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
|
|
name: Compile Package
|
|
- run:
|
|
command: ls -lahR .buildcache/packages
|
|
name: List packages
|
|
- save_cache:
|
|
key: cache006-package-beaf7ce640bd8bbb15ddfdb3c7b199032dbd0b60-{{checksum ".buildcache/cache-keys/package-beaf7ce640bd8bbb15ddfdb3c7b199032dbd0b60"}}
|
|
name: Saving package cache
|
|
paths:
|
|
- .buildcache/packages/store
|
|
- run:
|
|
command: |
|
|
if [ -f .buildcache/archives/08-warm-go-build-vendor-cache-f071c4c6ddd555cce3092b98f8b19115eb23f372.tar.gz ]; then
|
|
echo "Builder image already cached, skipping cache step."
|
|
circleci-agent step halt
|
|
fi
|
|
name: Check builder cache status
|
|
- run:
|
|
command: make -f packages*.lock/layer.mk 08-warm-go-build-vendor-cache-f071c4c6ddd555cce3092b98f8b19115eb23f372-save
|
|
name: Prepare build layers for caching
|
|
- save_cache:
|
|
key: cache006-warm-go-build-vendor-cache_f071_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-f071c4c6ddd555cce3092b98f8b19115eb23f372"}}
|
|
name: Save build layer cache
|
|
paths:
|
|
- .buildcache/archives/08-warm-go-build-vendor-cache-f071c4c6ddd555cce3092b98f8b19115eb23f372.tar.gz
|
|
test-go-race:
|
|
docker:
|
|
- image: circleci/golang:1.14.7-stretch
|
|
resource_class: xlarge
|
|
working_directory: /go/src/github.com/hashicorp/vault
|
|
parallelism: 8
|
|
steps:
|
|
- run:
|
|
command: |
|
|
# If the branch being tested starts with ui/ or docs/ we want to exit the job without failing
|
|
[[ "$CIRCLE_BRANCH" = ui/* || "$CIRCLE_BRANCH" = docs/* ]] && {
|
|
# stop the job from this step
|
|
circleci-agent step halt
|
|
}
|
|
# exit with success either way
|
|
exit 0
|
|
name: Check branch name
|
|
working_directory: ~/
|
|
- checkout
|
|
- run:
|
|
command: |
|
|
TZ=GMT date '+%Y%m%d' > /tmp/go-cache-key
|
|
name: Compute test cache key
|
|
- restore_cache:
|
|
keys:
|
|
- go-test-cache-date-v1-{{ checksum "/tmp/go-cache-key" }}
|
|
- run:
|
|
command: |
|
|
set -x
|
|
|
|
case "-race" in
|
|
*-race*) export VAULT_CI_GO_TEST_RACE=1;;
|
|
esac
|
|
|
|
# Install CircleCI CLI
|
|
curl -sSL \
|
|
"https://github.com/CircleCI-Public/circleci-cli/releases/download/v${CIRCLECI_CLI_VERSION}/circleci-cli_${CIRCLECI_CLI_VERSION}_linux_amd64.tar.gz" \
|
|
| sudo tar --overwrite -xz \
|
|
-C /usr/local/bin \
|
|
"circleci-cli_${CIRCLECI_CLI_VERSION}_linux_amd64/circleci"
|
|
|
|
USE_DOCKER=0
|
|
|
|
# Split Go tests by prior test times. If use_docker is true, only run
|
|
# tests that depend on docker, otherwise only those that don't.
|
|
if [ $USE_DOCKER == 1 ]; then
|
|
package_names=$(go list -test -json ./... |
|
|
jq -r 'select(.Deps != null) |
|
|
select(any(.Deps[] ; contains("github.com/hashicorp/vault/helper/testhelpers/docker"))) |
|
|
.ForTest | select(. != null)' |
|
|
sort -u | circleci tests split --split-by=timings --timings-type=classname)
|
|
else
|
|
package_names=$(go list -test -json ./... |
|
|
jq -r 'select(.Deps != null) |
|
|
select(all(.Deps[] ; contains("github.com/hashicorp/vault/helper/testhelpers/docker")|not)) |
|
|
.ForTest | select(. != null)' |
|
|
sort -u | circleci tests split --split-by=timings --timings-type=classname)
|
|
fi
|
|
|
|
# After running tests split step, we are now running the following steps
|
|
# in multiple different containers, each getting a different subset of
|
|
# the test packages in their package_names variable. Each container
|
|
# has its own remote docker VM.
|
|
|
|
make prep
|
|
mkdir -p test-results/go-test
|
|
|
|
# Create a docker network for our testcontainer
|
|
if [ $USE_DOCKER == 1 ]; then
|
|
# Despite the fact that we're using a circleci image (thus getting the
|
|
# version they chose for the docker cli) and that we're specifying a
|
|
# docker version to use for the remote docker instances, we occasionally
|
|
# see "client version too new, max supported version 1.39" errors for
|
|
# reasons unclear.
|
|
export DOCKER_API_VERSION=1.39
|
|
|
|
export TEST_DOCKER_NETWORK_ID=$(docker network list -q -f 'name=vaulttest')
|
|
if [ -z $TEST_DOCKER_NETWORK_ID ]; then
|
|
TEST_DOCKER_NETWORK_ID=$(docker network create vaulttest)
|
|
fi
|
|
|
|
# Start a docker testcontainer to run the tests in
|
|
docker run -d -e TEST_DOCKER_NETWORK_ID \
|
|
-e DOCKER_CERT_PATH -e DOCKER_HOST -e DOCKER_MACHINE_NAME -e DOCKER_TLS_VERIFY -e NO_PROXY \
|
|
-e VAULT_TEST_LOG_DIR=/tmp/testlogs \
|
|
--network vaulttest --name \
|
|
testcontainer circleci/golang:1.14.7-stretch \
|
|
tail -f /dev/null
|
|
|
|
# Run tests
|
|
test -d /tmp/go-cache && docker cp /tmp/go-cache testcontainer:/tmp/gocache
|
|
docker exec testcontainer sh -c 'mkdir -p /go/src/github.com/hashicorp/vault'
|
|
docker cp . testcontainer:/go/src/github.com/hashicorp/vault/
|
|
docker cp $DOCKER_CERT_PATH/ testcontainer:$DOCKER_CERT_PATH
|
|
|
|
docker exec -w /go/src/github.com/hashicorp/vault/ \
|
|
-e GO111MODULE -e CIRCLECI -e GOCACHE=/tmp/gocache -e VAULT_CI_GO_TEST_RACE \
|
|
testcontainer \
|
|
gotestsum --format=short-verbose \
|
|
--junitfile test-results/go-test/results.xml \
|
|
--jsonfile test-results/go-test/results.json \
|
|
-- \
|
|
-tags "${GO_TAGS}" \
|
|
-timeout=60m \
|
|
-parallel=20 \
|
|
-race \
|
|
${package_names}
|
|
else
|
|
GOCACHE=/tmp/go-cache \
|
|
gotestsum --format=short-verbose \
|
|
--junitfile test-results/go-test/results.xml \
|
|
--jsonfile test-results/go-test/results.json \
|
|
-- \
|
|
-tags "${GO_TAGS}" \
|
|
-timeout=60m \
|
|
-parallel=20 \
|
|
-race \
|
|
${package_names}
|
|
fi
|
|
name: Run Go tests
|
|
no_output_timeout: 60m
|
|
- store_artifacts:
|
|
path: test-results
|
|
- store_test_results:
|
|
path: test-results
|
|
- store_artifacts:
|
|
path: /tmp/testlogs
|
|
environment:
|
|
- CIRCLECI_CLI_VERSION: 0.1.5546
|
|
- GO_TAGS: ''
|
|
- GO111MODULE: 'off'
|
|
freebsd_amd64_package:
|
|
docker:
|
|
- image: circleci/buildpack-deps
|
|
shell: /usr/bin/env bash -euo pipefail -c
|
|
environment:
|
|
- AUTO_INSTALL_TOOLS: 'YES'
|
|
- BUILDKIT_PROGRESS: plain
|
|
- PRODUCT_REVISION: ''
|
|
- PACKAGE_SPEC_ID: d5a2eed6cd62f28a96e9966923d4a3319c143b09
|
|
steps:
|
|
- setup_remote_docker:
|
|
version: 19.03.12
|
|
- add_ssh_keys:
|
|
fingerprints:
|
|
- c6:96:98:82:dc:04:6c:39:dd:ac:83:05:e3:15:1c:98
|
|
- checkout
|
|
- run:
|
|
command: make -C packages*.lock write-package-cache-key
|
|
name: Write package cache key
|
|
- restore_cache:
|
|
key: cache006-package-d5a2eed6cd62f28a96e9966923d4a3319c143b09-{{checksum ".buildcache/cache-keys/package-d5a2eed6cd62f28a96e9966923d4a3319c143b09"}}
|
|
name: Restore package cache
|
|
- run:
|
|
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
|
|
name: Check the cache status.
|
|
- run:
|
|
command: make -C packages*.lock write-builder-cache-keys
|
|
name: Write builder layer cache keys
|
|
- restore_cache:
|
|
keys:
|
|
- cache006-copy-source_5267_{{checksum ".buildcache/cache-keys/copy-source-5267866774b268cf9a62123148a091787d930b6a"}}
|
|
- cache006-warm-go-build-vendor-cache_dbf4_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-dbf4add3b5adae072d1b2aa03b81ca3ea68bdf40"}}
|
|
- cache006-build-static-assets_5d03_{{checksum ".buildcache/cache-keys/build-static-assets-5d03b27bdb30353a4b10b43aaeed34d1843ea016"}}
|
|
- cache006-build-ui_8c08_{{checksum ".buildcache/cache-keys/build-ui-8c0888ac60d74cc3c80ff1e66f92529854029bb8"}}
|
|
- cache006-ui-dependencies_a323_{{checksum ".buildcache/cache-keys/ui-dependencies-a323ed865ff8f01132ebbcfdb26cd46637ee0537"}}
|
|
- cache006-install-yarn_f6bc_{{checksum ".buildcache/cache-keys/install-yarn-f6bc3cf1c8120fc6fbc6a7815f1414ea4a92b347"}}
|
|
- cache006-set-workdir_6821_{{checksum ".buildcache/cache-keys/set-workdir-68217e0df446776a522c173819319331eab24bfd"}}
|
|
- cache006-install-go-tools_4930_{{checksum ".buildcache/cache-keys/install-go-tools-493003a45b9bf13a3740054d1ed1e50aa66e0981"}}
|
|
- cache006-install-go_04fa_{{checksum ".buildcache/cache-keys/install-go-04fac374a5ab393a607df72e77bce85e18dd3856"}}
|
|
- cache006-base_cd50_{{checksum ".buildcache/cache-keys/base-cd50335c2217aa98d45d50d7ef941dfd1289b070"}}
|
|
name: Restore build layer cache
|
|
- run:
|
|
command: |
|
|
make -C packages*.lock load-builder-cache
|
|
name: Load whatever builder cache we have (if any) into the Docker daemon
|
|
no_output_timeout: 30m
|
|
- run:
|
|
command: |2
|
|
|
|
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
|
|
name: Compile Package
|
|
- run:
|
|
command: ls -lahR .buildcache/packages
|
|
name: List packages
|
|
- save_cache:
|
|
key: cache006-package-d5a2eed6cd62f28a96e9966923d4a3319c143b09-{{checksum ".buildcache/cache-keys/package-d5a2eed6cd62f28a96e9966923d4a3319c143b09"}}
|
|
name: Saving package cache
|
|
paths:
|
|
- .buildcache/packages/store
|
|
- run:
|
|
command: |
|
|
if [ -f .buildcache/archives/08-warm-go-build-vendor-cache-dbf4add3b5adae072d1b2aa03b81ca3ea68bdf40.tar.gz ]; then
|
|
echo "Builder image already cached, skipping cache step."
|
|
circleci-agent step halt
|
|
fi
|
|
name: Check builder cache status
|
|
- run:
|
|
command: make -f packages*.lock/layer.mk 08-warm-go-build-vendor-cache-dbf4add3b5adae072d1b2aa03b81ca3ea68bdf40-save
|
|
name: Prepare build layers for caching
|
|
- save_cache:
|
|
key: cache006-warm-go-build-vendor-cache_dbf4_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-dbf4add3b5adae072d1b2aa03b81ca3ea68bdf40"}}
|
|
name: Save build layer cache
|
|
paths:
|
|
- .buildcache/archives/08-warm-go-build-vendor-cache-dbf4add3b5adae072d1b2aa03b81ca3ea68bdf40.tar.gz
|
|
openbsd_386_package:
|
|
docker:
|
|
- image: circleci/buildpack-deps
|
|
shell: /usr/bin/env bash -euo pipefail -c
|
|
environment:
|
|
- AUTO_INSTALL_TOOLS: 'YES'
|
|
- BUILDKIT_PROGRESS: plain
|
|
- PRODUCT_REVISION: ''
|
|
- PACKAGE_SPEC_ID: 8de43fa1e99a3de7d649ba2949bbf83a7f0b55ef
|
|
steps:
|
|
- setup_remote_docker:
|
|
version: 19.03.12
|
|
- add_ssh_keys:
|
|
fingerprints:
|
|
- c6:96:98:82:dc:04:6c:39:dd:ac:83:05:e3:15:1c:98
|
|
- checkout
|
|
- run:
|
|
command: make -C packages*.lock write-package-cache-key
|
|
name: Write package cache key
|
|
- restore_cache:
|
|
key: cache006-package-8de43fa1e99a3de7d649ba2949bbf83a7f0b55ef-{{checksum ".buildcache/cache-keys/package-8de43fa1e99a3de7d649ba2949bbf83a7f0b55ef"}}
|
|
name: Restore package cache
|
|
- run:
|
|
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
|
|
name: Check the cache status.
|
|
- run:
|
|
command: make -C packages*.lock write-builder-cache-keys
|
|
name: Write builder layer cache keys
|
|
- restore_cache:
|
|
keys:
|
|
- cache006-copy-source_464e_{{checksum ".buildcache/cache-keys/copy-source-464e219313ce099f513f930c71907cf6703efae6"}}
|
|
- cache006-warm-go-build-vendor-cache_c945_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-c945f0cf094b431ff2e9ad299e0ea277f805a848"}}
|
|
- cache006-build-static-assets_5d03_{{checksum ".buildcache/cache-keys/build-static-assets-5d03b27bdb30353a4b10b43aaeed34d1843ea016"}}
|
|
- cache006-build-ui_8c08_{{checksum ".buildcache/cache-keys/build-ui-8c0888ac60d74cc3c80ff1e66f92529854029bb8"}}
|
|
- cache006-ui-dependencies_a323_{{checksum ".buildcache/cache-keys/ui-dependencies-a323ed865ff8f01132ebbcfdb26cd46637ee0537"}}
|
|
- cache006-install-yarn_f6bc_{{checksum ".buildcache/cache-keys/install-yarn-f6bc3cf1c8120fc6fbc6a7815f1414ea4a92b347"}}
|
|
- cache006-set-workdir_6821_{{checksum ".buildcache/cache-keys/set-workdir-68217e0df446776a522c173819319331eab24bfd"}}
|
|
- cache006-install-go-tools_4930_{{checksum ".buildcache/cache-keys/install-go-tools-493003a45b9bf13a3740054d1ed1e50aa66e0981"}}
|
|
- cache006-install-go_04fa_{{checksum ".buildcache/cache-keys/install-go-04fac374a5ab393a607df72e77bce85e18dd3856"}}
|
|
- cache006-base_cd50_{{checksum ".buildcache/cache-keys/base-cd50335c2217aa98d45d50d7ef941dfd1289b070"}}
|
|
name: Restore build layer cache
|
|
- run:
|
|
command: |
|
|
make -C packages*.lock load-builder-cache
|
|
name: Load whatever builder cache we have (if any) into the Docker daemon
|
|
no_output_timeout: 30m
|
|
- run:
|
|
command: |2
|
|
|
|
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
|
|
name: Compile Package
|
|
- run:
|
|
command: ls -lahR .buildcache/packages
|
|
name: List packages
|
|
- save_cache:
|
|
key: cache006-package-8de43fa1e99a3de7d649ba2949bbf83a7f0b55ef-{{checksum ".buildcache/cache-keys/package-8de43fa1e99a3de7d649ba2949bbf83a7f0b55ef"}}
|
|
name: Saving package cache
|
|
paths:
|
|
- .buildcache/packages/store
|
|
- run:
|
|
command: |
|
|
if [ -f .buildcache/archives/08-warm-go-build-vendor-cache-c945f0cf094b431ff2e9ad299e0ea277f805a848.tar.gz ]; then
|
|
echo "Builder image already cached, skipping cache step."
|
|
circleci-agent step halt
|
|
fi
|
|
name: Check builder cache status
|
|
- run:
|
|
command: make -f packages*.lock/layer.mk 08-warm-go-build-vendor-cache-c945f0cf094b431ff2e9ad299e0ea277f805a848-save
|
|
name: Prepare build layers for caching
|
|
- save_cache:
|
|
key: cache006-warm-go-build-vendor-cache_c945_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-c945f0cf094b431ff2e9ad299e0ea277f805a848"}}
|
|
name: Save build layer cache
|
|
paths:
|
|
- .buildcache/archives/08-warm-go-build-vendor-cache-c945f0cf094b431ff2e9ad299e0ea277f805a848.tar.gz
|
|
linux_amd64_package:
|
|
docker:
|
|
- image: circleci/buildpack-deps
|
|
shell: /usr/bin/env bash -euo pipefail -c
|
|
environment:
|
|
- AUTO_INSTALL_TOOLS: 'YES'
|
|
- BUILDKIT_PROGRESS: plain
|
|
- PRODUCT_REVISION: ''
|
|
- PACKAGE_SPEC_ID: e244c2d20b9417e0abadb35e73997f117916e00c
|
|
steps:
|
|
- setup_remote_docker:
|
|
version: 19.03.12
|
|
- add_ssh_keys:
|
|
fingerprints:
|
|
- c6:96:98:82:dc:04:6c:39:dd:ac:83:05:e3:15:1c:98
|
|
- checkout
|
|
- run:
|
|
command: make -C packages*.lock write-package-cache-key
|
|
name: Write package cache key
|
|
- restore_cache:
|
|
key: cache006-package-e244c2d20b9417e0abadb35e73997f117916e00c-{{checksum ".buildcache/cache-keys/package-e244c2d20b9417e0abadb35e73997f117916e00c"}}
|
|
name: Restore package cache
|
|
- run:
|
|
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
|
|
name: Check the cache status.
|
|
- run:
|
|
command: make -C packages*.lock write-builder-cache-keys
|
|
name: Write builder layer cache keys
|
|
- restore_cache:
|
|
keys:
|
|
- cache006-copy-source_9f9c_{{checksum ".buildcache/cache-keys/copy-source-9f9caeebd82a6346d02c04066e8739ec3701ff9f"}}
|
|
- cache006-warm-go-build-vendor-cache_e3b9_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-e3b9c5412c92965e6f51f2a069a104754bb8247c"}}
|
|
- cache006-build-static-assets_5d03_{{checksum ".buildcache/cache-keys/build-static-assets-5d03b27bdb30353a4b10b43aaeed34d1843ea016"}}
|
|
- cache006-build-ui_8c08_{{checksum ".buildcache/cache-keys/build-ui-8c0888ac60d74cc3c80ff1e66f92529854029bb8"}}
|
|
- cache006-ui-dependencies_a323_{{checksum ".buildcache/cache-keys/ui-dependencies-a323ed865ff8f01132ebbcfdb26cd46637ee0537"}}
|
|
- cache006-install-yarn_f6bc_{{checksum ".buildcache/cache-keys/install-yarn-f6bc3cf1c8120fc6fbc6a7815f1414ea4a92b347"}}
|
|
- cache006-set-workdir_6821_{{checksum ".buildcache/cache-keys/set-workdir-68217e0df446776a522c173819319331eab24bfd"}}
|
|
- cache006-install-go-tools_4930_{{checksum ".buildcache/cache-keys/install-go-tools-493003a45b9bf13a3740054d1ed1e50aa66e0981"}}
|
|
- cache006-install-go_04fa_{{checksum ".buildcache/cache-keys/install-go-04fac374a5ab393a607df72e77bce85e18dd3856"}}
|
|
- cache006-base_cd50_{{checksum ".buildcache/cache-keys/base-cd50335c2217aa98d45d50d7ef941dfd1289b070"}}
|
|
name: Restore build layer cache
|
|
- run:
|
|
command: |
|
|
make -C packages*.lock load-builder-cache
|
|
name: Load whatever builder cache we have (if any) into the Docker daemon
|
|
no_output_timeout: 30m
|
|
- run:
|
|
command: |2
|
|
|
|
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
|
|
name: Compile Package
|
|
- run:
|
|
command: ls -lahR .buildcache/packages
|
|
name: List packages
|
|
- save_cache:
|
|
key: cache006-package-e244c2d20b9417e0abadb35e73997f117916e00c-{{checksum ".buildcache/cache-keys/package-e244c2d20b9417e0abadb35e73997f117916e00c"}}
|
|
name: Saving package cache
|
|
paths:
|
|
- .buildcache/packages/store
|
|
- run:
|
|
command: |
|
|
if [ -f .buildcache/archives/08-warm-go-build-vendor-cache-e3b9c5412c92965e6f51f2a069a104754bb8247c.tar.gz ]; then
|
|
echo "Builder image already cached, skipping cache step."
|
|
circleci-agent step halt
|
|
fi
|
|
name: Check builder cache status
|
|
- run:
|
|
command: make -f packages*.lock/layer.mk 08-warm-go-build-vendor-cache-e3b9c5412c92965e6f51f2a069a104754bb8247c-save
|
|
name: Prepare build layers for caching
|
|
- save_cache:
|
|
key: cache006-warm-go-build-vendor-cache_e3b9_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-e3b9c5412c92965e6f51f2a069a104754bb8247c"}}
|
|
name: Save build layer cache
|
|
paths:
|
|
- .buildcache/archives/08-warm-go-build-vendor-cache-e3b9c5412c92965e6f51f2a069a104754bb8247c.tar.gz
|
|
website-docker-image:
|
|
docker:
|
|
- image: circleci/buildpack-deps
|
|
shell: /usr/bin/env bash -euo pipefail -c
|
|
steps:
|
|
- checkout
|
|
- setup_remote_docker
|
|
- run:
|
|
command: |
|
|
IMAGE_TAG="$(git rev-list -n1 HEAD -- website/Dockerfile website/package-lock.json)"
|
|
echo "Using $IMAGE_TAG"
|
|
if [ "$CIRCLE_REPOSITORY_URL" != "git@github.com:hashicorp/vault.git" ]; then
|
|
echo "Not Vault OSS Repo, not building website docker image"
|
|
elif curl https://hub.docker.com/v2/repositories/hashicorp/vault-website/tags/$IMAGE_TAG -fsL > /dev/null; then
|
|
echo "Dependencies have not changed, not building a new website docker image."
|
|
else
|
|
cd website/
|
|
docker build -t hashicorp/vault-website:$IMAGE_TAG .
|
|
docker tag hashicorp/vault-website:$IMAGE_TAG hashicorp/vault-website:latest
|
|
docker login -u $WEBSITE_DOCKER_USER -p $WEBSITE_DOCKER_PASS
|
|
docker push hashicorp/vault-website
|
|
fi
|
|
name: Build Docker Image if Necessary
|
|
solaris_amd64_package:
|
|
docker:
|
|
- image: circleci/buildpack-deps
|
|
shell: /usr/bin/env bash -euo pipefail -c
|
|
environment:
|
|
- AUTO_INSTALL_TOOLS: 'YES'
|
|
- BUILDKIT_PROGRESS: plain
|
|
- PRODUCT_REVISION: ''
|
|
- PACKAGE_SPEC_ID: 573d1e91d855d987e7c7f1179074a88ec04b69e0
|
|
steps:
|
|
- setup_remote_docker:
|
|
version: 19.03.12
|
|
- add_ssh_keys:
|
|
fingerprints:
|
|
- c6:96:98:82:dc:04:6c:39:dd:ac:83:05:e3:15:1c:98
|
|
- checkout
|
|
- run:
|
|
command: make -C packages*.lock write-package-cache-key
|
|
name: Write package cache key
|
|
- restore_cache:
|
|
key: cache006-package-573d1e91d855d987e7c7f1179074a88ec04b69e0-{{checksum ".buildcache/cache-keys/package-573d1e91d855d987e7c7f1179074a88ec04b69e0"}}
|
|
name: Restore package cache
|
|
- run:
|
|
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
|
|
name: Check the cache status.
|
|
- run:
|
|
command: make -C packages*.lock write-builder-cache-keys
|
|
name: Write builder layer cache keys
|
|
- restore_cache:
|
|
keys:
|
|
- cache006-copy-source_4528_{{checksum ".buildcache/cache-keys/copy-source-4528b4536c148202824ecd0e713084a662aa86d9"}}
|
|
- cache006-warm-go-build-vendor-cache_f424_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-f42498429cc80394af1aea1ae8261b59f98d4bfd"}}
|
|
- cache006-build-static-assets_5d03_{{checksum ".buildcache/cache-keys/build-static-assets-5d03b27bdb30353a4b10b43aaeed34d1843ea016"}}
|
|
- cache006-build-ui_8c08_{{checksum ".buildcache/cache-keys/build-ui-8c0888ac60d74cc3c80ff1e66f92529854029bb8"}}
|
|
- cache006-ui-dependencies_a323_{{checksum ".buildcache/cache-keys/ui-dependencies-a323ed865ff8f01132ebbcfdb26cd46637ee0537"}}
|
|
- cache006-install-yarn_f6bc_{{checksum ".buildcache/cache-keys/install-yarn-f6bc3cf1c8120fc6fbc6a7815f1414ea4a92b347"}}
|
|
- cache006-set-workdir_6821_{{checksum ".buildcache/cache-keys/set-workdir-68217e0df446776a522c173819319331eab24bfd"}}
|
|
- cache006-install-go-tools_4930_{{checksum ".buildcache/cache-keys/install-go-tools-493003a45b9bf13a3740054d1ed1e50aa66e0981"}}
|
|
- cache006-install-go_04fa_{{checksum ".buildcache/cache-keys/install-go-04fac374a5ab393a607df72e77bce85e18dd3856"}}
|
|
- cache006-base_cd50_{{checksum ".buildcache/cache-keys/base-cd50335c2217aa98d45d50d7ef941dfd1289b070"}}
|
|
name: Restore build layer cache
|
|
- run:
|
|
command: |
|
|
make -C packages*.lock load-builder-cache
|
|
name: Load whatever builder cache we have (if any) into the Docker daemon
|
|
no_output_timeout: 30m
|
|
- run:
|
|
command: |2
|
|
|
|
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
|
|
name: Compile Package
|
|
- run:
|
|
command: ls -lahR .buildcache/packages
|
|
name: List packages
|
|
- save_cache:
|
|
key: cache006-package-573d1e91d855d987e7c7f1179074a88ec04b69e0-{{checksum ".buildcache/cache-keys/package-573d1e91d855d987e7c7f1179074a88ec04b69e0"}}
|
|
name: Saving package cache
|
|
paths:
|
|
- .buildcache/packages/store
|
|
- run:
|
|
command: |
|
|
if [ -f .buildcache/archives/08-warm-go-build-vendor-cache-f42498429cc80394af1aea1ae8261b59f98d4bfd.tar.gz ]; then
|
|
echo "Builder image already cached, skipping cache step."
|
|
circleci-agent step halt
|
|
fi
|
|
name: Check builder cache status
|
|
- run:
|
|
command: make -f packages*.lock/layer.mk 08-warm-go-build-vendor-cache-f42498429cc80394af1aea1ae8261b59f98d4bfd-save
|
|
name: Prepare build layers for caching
|
|
- save_cache:
|
|
key: cache006-warm-go-build-vendor-cache_f424_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-f42498429cc80394af1aea1ae8261b59f98d4bfd"}}
|
|
name: Save build layer cache
|
|
paths:
|
|
- .buildcache/archives/08-warm-go-build-vendor-cache-f42498429cc80394af1aea1ae8261b59f98d4bfd.tar.gz
|
|
test-go:
|
|
docker:
|
|
- image: circleci/golang:1.14.7-stretch
|
|
resource_class: xlarge
|
|
working_directory: /go/src/github.com/hashicorp/vault
|
|
parallelism: 8
|
|
steps:
|
|
- run:
|
|
command: |
|
|
# If the branch being tested starts with ui/ or docs/ we want to exit the job without failing
|
|
[[ "$CIRCLE_BRANCH" = ui/* || "$CIRCLE_BRANCH" = docs/* ]] && {
|
|
# stop the job from this step
|
|
circleci-agent step halt
|
|
}
|
|
# exit with success either way
|
|
exit 0
|
|
name: Check branch name
|
|
working_directory: ~/
|
|
- checkout
|
|
- run:
|
|
command: |
|
|
TZ=GMT date '+%Y%m%d' > /tmp/go-cache-key
|
|
name: Compute test cache key
|
|
- restore_cache:
|
|
keys:
|
|
- go-test-cache-date-v1-{{ checksum "/tmp/go-cache-key" }}
|
|
- run:
|
|
command: |
|
|
set -x
|
|
|
|
case "" in
|
|
*-race*) export VAULT_CI_GO_TEST_RACE=1;;
|
|
esac
|
|
|
|
# Install CircleCI CLI
|
|
curl -sSL \
|
|
"https://github.com/CircleCI-Public/circleci-cli/releases/download/v${CIRCLECI_CLI_VERSION}/circleci-cli_${CIRCLECI_CLI_VERSION}_linux_amd64.tar.gz" \
|
|
| sudo tar --overwrite -xz \
|
|
-C /usr/local/bin \
|
|
"circleci-cli_${CIRCLECI_CLI_VERSION}_linux_amd64/circleci"
|
|
|
|
USE_DOCKER=0
|
|
|
|
# Split Go tests by prior test times. If use_docker is true, only run
|
|
# tests that depend on docker, otherwise only those that don't.
|
|
if [ $USE_DOCKER == 1 ]; then
|
|
package_names=$(go list -test -json ./... |
|
|
jq -r 'select(.Deps != null) |
|
|
select(any(.Deps[] ; contains("github.com/hashicorp/vault/helper/testhelpers/docker"))) |
|
|
.ForTest | select(. != null)' |
|
|
sort -u | circleci tests split --split-by=timings --timings-type=classname)
|
|
else
|
|
package_names=$(go list -test -json ./... |
|
|
jq -r 'select(.Deps != null) |
|
|
select(all(.Deps[] ; contains("github.com/hashicorp/vault/helper/testhelpers/docker")|not)) |
|
|
.ForTest | select(. != null)' |
|
|
sort -u | circleci tests split --split-by=timings --timings-type=classname)
|
|
fi
|
|
|
|
# After running tests split step, we are now running the following steps
|
|
# in multiple different containers, each getting a different subset of
|
|
# the test packages in their package_names variable. Each container
|
|
# has its own remote docker VM.
|
|
|
|
make prep
|
|
mkdir -p test-results/go-test
|
|
|
|
# Create a docker network for our testcontainer
|
|
if [ $USE_DOCKER == 1 ]; then
|
|
# Despite the fact that we're using a circleci image (thus getting the
|
|
# version they chose for the docker cli) and that we're specifying a
|
|
# docker version to use for the remote docker instances, we occasionally
|
|
# see "client version too new, max supported version 1.39" errors for
|
|
# reasons unclear.
|
|
export DOCKER_API_VERSION=1.39
|
|
|
|
export TEST_DOCKER_NETWORK_ID=$(docker network list -q -f 'name=vaulttest')
|
|
if [ -z $TEST_DOCKER_NETWORK_ID ]; then
|
|
TEST_DOCKER_NETWORK_ID=$(docker network create vaulttest)
|
|
fi
|
|
|
|
# Start a docker testcontainer to run the tests in
|
|
docker run -d -e TEST_DOCKER_NETWORK_ID \
|
|
-e DOCKER_CERT_PATH -e DOCKER_HOST -e DOCKER_MACHINE_NAME -e DOCKER_TLS_VERIFY -e NO_PROXY \
|
|
-e VAULT_TEST_LOG_DIR=/tmp/testlogs \
|
|
--network vaulttest --name \
|
|
testcontainer circleci/golang:1.14.7-stretch \
|
|
tail -f /dev/null
|
|
|
|
# Run tests
|
|
test -d /tmp/go-cache && docker cp /tmp/go-cache testcontainer:/tmp/gocache
|
|
docker exec testcontainer sh -c 'mkdir -p /go/src/github.com/hashicorp/vault'
|
|
docker cp . testcontainer:/go/src/github.com/hashicorp/vault/
|
|
docker cp $DOCKER_CERT_PATH/ testcontainer:$DOCKER_CERT_PATH
|
|
|
|
docker exec -w /go/src/github.com/hashicorp/vault/ \
|
|
-e GO111MODULE -e CIRCLECI -e GOCACHE=/tmp/gocache -e VAULT_CI_GO_TEST_RACE \
|
|
testcontainer \
|
|
gotestsum --format=short-verbose \
|
|
--junitfile test-results/go-test/results.xml \
|
|
--jsonfile test-results/go-test/results.json \
|
|
-- \
|
|
-tags "${GO_TAGS}" \
|
|
-timeout=60m \
|
|
-parallel=20 \
|
|
\
|
|
${package_names}
|
|
else
|
|
GOCACHE=/tmp/go-cache \
|
|
gotestsum --format=short-verbose \
|
|
--junitfile test-results/go-test/results.xml \
|
|
--jsonfile test-results/go-test/results.json \
|
|
-- \
|
|
-tags "${GO_TAGS}" \
|
|
-timeout=60m \
|
|
-parallel=20 \
|
|
\
|
|
${package_names}
|
|
fi
|
|
name: Run Go tests
|
|
no_output_timeout: 60m
|
|
- store_artifacts:
|
|
path: test-results
|
|
- store_test_results:
|
|
path: test-results
|
|
- store_artifacts:
|
|
path: /tmp/testlogs
|
|
environment:
|
|
- CIRCLECI_CLI_VERSION: 0.1.5546
|
|
- GO_TAGS: ''
|
|
- GO111MODULE: 'off'
|
|
test-go-nightly:
|
|
machine: true
|
|
shell: /usr/bin/env bash -euo pipefail -c
|
|
working_directory: /go/src/github.com/hashicorp/vault
|
|
steps:
|
|
- run:
|
|
command: |
|
|
# If the branch being tested starts with ui/ or docs/ we want to exit the job without failing
|
|
[[ "$CIRCLE_BRANCH" = ui/* || "$CIRCLE_BRANCH" = docs/* ]] && {
|
|
# stop the job from this step
|
|
circleci-agent step halt
|
|
}
|
|
# exit with success either way
|
|
exit 0
|
|
name: Check branch name
|
|
working_directory: ~/
|
|
- run:
|
|
command: |
|
|
[ -n "$GO_VERSION" ] || { echo "You must set GO_VERSION"; exit 1; }
|
|
# Install Go
|
|
curl -sSLO "https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz"
|
|
sudo rm -rf /usr/local/go
|
|
sudo tar -C /usr/local -xzf "go${GO_VERSION}.linux-amd64.tar.gz"
|
|
rm -f "go${GO_VERSION}.linux-amd64.tar.gz"
|
|
GOPATH="/go"
|
|
mkdir $GOPATH 2>/dev/null || { sudo mkdir $GOPATH && sudo chmod 777 $GOPATH; }
|
|
echo "export GOPATH='$GOPATH'" >> "$BASH_ENV"
|
|
echo "export PATH='$PATH:$GOPATH/bin:/usr/local/go/bin'" >> "$BASH_ENV"
|
|
|
|
echo "$ go version"
|
|
go version
|
|
name: Setup Go
|
|
working_directory: ~/
|
|
- checkout
|
|
- run:
|
|
command: |
|
|
TZ=GMT date '+%Y%m%d' > /tmp/go-cache-key
|
|
name: Compute test cache key
|
|
- restore_cache:
|
|
keys:
|
|
- go-test-cache-date-v1-{{ checksum "/tmp/go-cache-key" }}
|
|
- run:
|
|
command: |
|
|
set -x
|
|
|
|
case "" in
|
|
*-race*) export VAULT_CI_GO_TEST_RACE=1;;
|
|
esac
|
|
|
|
# Install CircleCI CLI
|
|
curl -sSL \
|
|
"https://github.com/CircleCI-Public/circleci-cli/releases/download/v${CIRCLECI_CLI_VERSION}/circleci-cli_${CIRCLECI_CLI_VERSION}_linux_amd64.tar.gz" \
|
|
| sudo tar --overwrite -xz \
|
|
-C /usr/local/bin \
|
|
"circleci-cli_${CIRCLECI_CLI_VERSION}_linux_amd64/circleci"
|
|
|
|
USE_DOCKER=0
|
|
|
|
# Split Go tests by prior test times. If use_docker is true, only run
|
|
# tests that depend on docker, otherwise only those that don't.
|
|
if [ $USE_DOCKER == 1 ]; then
|
|
package_names=$(go list -test -json ./... |
|
|
jq -r 'select(.Deps != null) |
|
|
select(any(.Deps[] ; contains("github.com/hashicorp/vault/helper/testhelpers/docker"))) |
|
|
.ForTest | select(. != null)' |
|
|
sort -u | circleci tests split --split-by=timings --timings-type=classname)
|
|
else
|
|
package_names=$(go list -test -json ./... |
|
|
jq -r 'select(.Deps != null) |
|
|
select(all(.Deps[] ; contains("github.com/hashicorp/vault/helper/testhelpers/docker")|not)) |
|
|
.ForTest | select(. != null)' |
|
|
sort -u | circleci tests split --split-by=timings --timings-type=classname)
|
|
fi
|
|
|
|
# After running tests split step, we are now running the following steps
|
|
# in multiple different containers, each getting a different subset of
|
|
# the test packages in their package_names variable. Each container
|
|
# has its own remote docker VM.
|
|
|
|
make prep
|
|
mkdir -p test-results/go-test
|
|
|
|
# Create a docker network for our testcontainer
|
|
if [ $USE_DOCKER == 1 ]; then
|
|
# Despite the fact that we're using a circleci image (thus getting the
|
|
# version they chose for the docker cli) and that we're specifying a
|
|
# docker version to use for the remote docker instances, we occasionally
|
|
# see "client version too new, max supported version 1.39" errors for
|
|
# reasons unclear.
|
|
export DOCKER_API_VERSION=1.39
|
|
|
|
export TEST_DOCKER_NETWORK_ID=$(docker network list -q -f 'name=vaulttest')
|
|
if [ -z $TEST_DOCKER_NETWORK_ID ]; then
|
|
TEST_DOCKER_NETWORK_ID=$(docker network create vaulttest)
|
|
fi
|
|
|
|
# Start a docker testcontainer to run the tests in
|
|
docker run -d -e TEST_DOCKER_NETWORK_ID \
|
|
-e DOCKER_CERT_PATH -e DOCKER_HOST -e DOCKER_MACHINE_NAME -e DOCKER_TLS_VERIFY -e NO_PROXY \
|
|
-e VAULT_TEST_LOG_DIR=/tmp/testlogs \
|
|
--network vaulttest --name \
|
|
testcontainer circleci/golang:1.14.7-stretch \
|
|
tail -f /dev/null
|
|
|
|
# Run tests
|
|
test -d /tmp/go-cache && docker cp /tmp/go-cache testcontainer:/tmp/gocache
|
|
docker exec testcontainer sh -c 'mkdir -p /go/src/github.com/hashicorp/vault'
|
|
docker cp . testcontainer:/go/src/github.com/hashicorp/vault/
|
|
docker cp $DOCKER_CERT_PATH/ testcontainer:$DOCKER_CERT_PATH
|
|
|
|
docker exec -w /go/src/github.com/hashicorp/vault/ \
|
|
-e GO111MODULE -e CIRCLECI -e GOCACHE=/tmp/gocache -e VAULT_CI_GO_TEST_RACE \
|
|
testcontainer \
|
|
gotestsum --format=short-verbose \
|
|
--junitfile test-results/go-test/results.xml \
|
|
--jsonfile test-results/go-test/results.json \
|
|
-- \
|
|
-tags "${GO_TAGS}" \
|
|
-timeout=60m \
|
|
-parallel=20 \
|
|
\
|
|
${package_names}
|
|
else
|
|
GOCACHE=/tmp/go-cache \
|
|
gotestsum --format=short-verbose \
|
|
--junitfile test-results/go-test/results.xml \
|
|
--jsonfile test-results/go-test/results.json \
|
|
-- \
|
|
-tags "${GO_TAGS}" \
|
|
-timeout=60m \
|
|
-parallel=20 \
|
|
\
|
|
${package_names}
|
|
fi
|
|
name: Run Go tests
|
|
no_output_timeout: 60m
|
|
- save_cache:
|
|
key: go-test-cache-date-v1-{{ checksum "/tmp/go-cache-key" }}
|
|
paths:
|
|
- /tmp/go-cache
|
|
when: always
|
|
- store_artifacts:
|
|
path: test-results
|
|
- store_test_results:
|
|
path: test-results
|
|
- store_artifacts:
|
|
path: /tmp/testlogs
|
|
environment:
|
|
- CIRCLECI_CLI_VERSION: 0.1.5546
|
|
- GO_TAGS: ''
|
|
- GO_VERSION: 1.14.7
|
|
- GO111MODULE: 'off'
|
|
- GOTESTSUM_VERSION: 0.5.2
|
|
netbsd_amd64_package:
|
|
docker:
|
|
- image: circleci/buildpack-deps
|
|
shell: /usr/bin/env bash -euo pipefail -c
|
|
environment:
|
|
- AUTO_INSTALL_TOOLS: 'YES'
|
|
- BUILDKIT_PROGRESS: plain
|
|
- PRODUCT_REVISION: ''
|
|
- PACKAGE_SPEC_ID: 9c418ea86d484862e6a7dfd55fecab8b86bbb708
|
|
steps:
|
|
- setup_remote_docker:
|
|
version: 19.03.12
|
|
- add_ssh_keys:
|
|
fingerprints:
|
|
- c6:96:98:82:dc:04:6c:39:dd:ac:83:05:e3:15:1c:98
|
|
- checkout
|
|
- run:
|
|
command: make -C packages*.lock write-package-cache-key
|
|
name: Write package cache key
|
|
- restore_cache:
|
|
key: cache006-package-9c418ea86d484862e6a7dfd55fecab8b86bbb708-{{checksum ".buildcache/cache-keys/package-9c418ea86d484862e6a7dfd55fecab8b86bbb708"}}
|
|
name: Restore package cache
|
|
- run:
|
|
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
|
|
name: Check the cache status.
|
|
- run:
|
|
command: make -C packages*.lock write-builder-cache-keys
|
|
name: Write builder layer cache keys
|
|
- restore_cache:
|
|
keys:
|
|
- cache006-copy-source_f351_{{checksum ".buildcache/cache-keys/copy-source-f35125307b0be0b9878bbe88776ef811deab97e5"}}
|
|
- cache006-warm-go-build-vendor-cache_2daf_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-2daf717df8a6c95f32d3420ccd3be4752ad38011"}}
|
|
- cache006-build-static-assets_5d03_{{checksum ".buildcache/cache-keys/build-static-assets-5d03b27bdb30353a4b10b43aaeed34d1843ea016"}}
|
|
- cache006-build-ui_8c08_{{checksum ".buildcache/cache-keys/build-ui-8c0888ac60d74cc3c80ff1e66f92529854029bb8"}}
|
|
- cache006-ui-dependencies_a323_{{checksum ".buildcache/cache-keys/ui-dependencies-a323ed865ff8f01132ebbcfdb26cd46637ee0537"}}
|
|
- cache006-install-yarn_f6bc_{{checksum ".buildcache/cache-keys/install-yarn-f6bc3cf1c8120fc6fbc6a7815f1414ea4a92b347"}}
|
|
- cache006-set-workdir_6821_{{checksum ".buildcache/cache-keys/set-workdir-68217e0df446776a522c173819319331eab24bfd"}}
|
|
- cache006-install-go-tools_4930_{{checksum ".buildcache/cache-keys/install-go-tools-493003a45b9bf13a3740054d1ed1e50aa66e0981"}}
|
|
- cache006-install-go_04fa_{{checksum ".buildcache/cache-keys/install-go-04fac374a5ab393a607df72e77bce85e18dd3856"}}
|
|
- cache006-base_cd50_{{checksum ".buildcache/cache-keys/base-cd50335c2217aa98d45d50d7ef941dfd1289b070"}}
|
|
name: Restore build layer cache
|
|
- run:
|
|
command: |
|
|
make -C packages*.lock load-builder-cache
|
|
name: Load whatever builder cache we have (if any) into the Docker daemon
|
|
no_output_timeout: 30m
|
|
- run:
|
|
command: |2
|
|
|
|
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
|
|
name: Compile Package
|
|
- run:
|
|
command: ls -lahR .buildcache/packages
|
|
name: List packages
|
|
- save_cache:
|
|
key: cache006-package-9c418ea86d484862e6a7dfd55fecab8b86bbb708-{{checksum ".buildcache/cache-keys/package-9c418ea86d484862e6a7dfd55fecab8b86bbb708"}}
|
|
name: Saving package cache
|
|
paths:
|
|
- .buildcache/packages/store
|
|
- run:
|
|
command: |
|
|
if [ -f .buildcache/archives/08-warm-go-build-vendor-cache-2daf717df8a6c95f32d3420ccd3be4752ad38011.tar.gz ]; then
|
|
echo "Builder image already cached, skipping cache step."
|
|
circleci-agent step halt
|
|
fi
|
|
name: Check builder cache status
|
|
- run:
|
|
command: make -f packages*.lock/layer.mk 08-warm-go-build-vendor-cache-2daf717df8a6c95f32d3420ccd3be4752ad38011-save
|
|
name: Prepare build layers for caching
|
|
- save_cache:
|
|
key: cache006-warm-go-build-vendor-cache_2daf_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-2daf717df8a6c95f32d3420ccd3be4752ad38011"}}
|
|
name: Save build layer cache
|
|
paths:
|
|
- .buildcache/archives/08-warm-go-build-vendor-cache-2daf717df8a6c95f32d3420ccd3be4752ad38011.tar.gz
|
|
openbsd_amd64_package:
|
|
docker:
|
|
- image: circleci/buildpack-deps
|
|
shell: /usr/bin/env bash -euo pipefail -c
|
|
environment:
|
|
- AUTO_INSTALL_TOOLS: 'YES'
|
|
- BUILDKIT_PROGRESS: plain
|
|
- PRODUCT_REVISION: ''
|
|
- PACKAGE_SPEC_ID: ae352f28d92b71e59f987251061b200622136b91
|
|
steps:
|
|
- setup_remote_docker:
|
|
version: 19.03.12
|
|
- add_ssh_keys:
|
|
fingerprints:
|
|
- c6:96:98:82:dc:04:6c:39:dd:ac:83:05:e3:15:1c:98
|
|
- checkout
|
|
- run:
|
|
command: make -C packages*.lock write-package-cache-key
|
|
name: Write package cache key
|
|
- restore_cache:
|
|
key: cache006-package-ae352f28d92b71e59f987251061b200622136b91-{{checksum ".buildcache/cache-keys/package-ae352f28d92b71e59f987251061b200622136b91"}}
|
|
name: Restore package cache
|
|
- run:
|
|
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
|
|
name: Check the cache status.
|
|
- run:
|
|
command: make -C packages*.lock write-builder-cache-keys
|
|
name: Write builder layer cache keys
|
|
- restore_cache:
|
|
keys:
|
|
- cache006-copy-source_c18c_{{checksum ".buildcache/cache-keys/copy-source-c18cc2367cdc431088468688b8baf5d7cc8a5c9b"}}
|
|
- cache006-warm-go-build-vendor-cache_12bf_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-12bf088afd7426b615e6193316c7efeda43120b4"}}
|
|
- cache006-build-static-assets_5d03_{{checksum ".buildcache/cache-keys/build-static-assets-5d03b27bdb30353a4b10b43aaeed34d1843ea016"}}
|
|
- cache006-build-ui_8c08_{{checksum ".buildcache/cache-keys/build-ui-8c0888ac60d74cc3c80ff1e66f92529854029bb8"}}
|
|
- cache006-ui-dependencies_a323_{{checksum ".buildcache/cache-keys/ui-dependencies-a323ed865ff8f01132ebbcfdb26cd46637ee0537"}}
|
|
- cache006-install-yarn_f6bc_{{checksum ".buildcache/cache-keys/install-yarn-f6bc3cf1c8120fc6fbc6a7815f1414ea4a92b347"}}
|
|
- cache006-set-workdir_6821_{{checksum ".buildcache/cache-keys/set-workdir-68217e0df446776a522c173819319331eab24bfd"}}
|
|
- cache006-install-go-tools_4930_{{checksum ".buildcache/cache-keys/install-go-tools-493003a45b9bf13a3740054d1ed1e50aa66e0981"}}
|
|
- cache006-install-go_04fa_{{checksum ".buildcache/cache-keys/install-go-04fac374a5ab393a607df72e77bce85e18dd3856"}}
|
|
- cache006-base_cd50_{{checksum ".buildcache/cache-keys/base-cd50335c2217aa98d45d50d7ef941dfd1289b070"}}
|
|
name: Restore build layer cache
|
|
- run:
|
|
command: |
|
|
make -C packages*.lock load-builder-cache
|
|
name: Load whatever builder cache we have (if any) into the Docker daemon
|
|
no_output_timeout: 30m
|
|
- run:
|
|
command: |2
|
|
|
|
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
|
|
name: Compile Package
|
|
- run:
|
|
command: ls -lahR .buildcache/packages
|
|
name: List packages
|
|
- save_cache:
|
|
key: cache006-package-ae352f28d92b71e59f987251061b200622136b91-{{checksum ".buildcache/cache-keys/package-ae352f28d92b71e59f987251061b200622136b91"}}
|
|
name: Saving package cache
|
|
paths:
|
|
- .buildcache/packages/store
|
|
- run:
|
|
command: |
|
|
if [ -f .buildcache/archives/08-warm-go-build-vendor-cache-12bf088afd7426b615e6193316c7efeda43120b4.tar.gz ]; then
|
|
echo "Builder image already cached, skipping cache step."
|
|
circleci-agent step halt
|
|
fi
|
|
name: Check builder cache status
|
|
- run:
|
|
command: make -f packages*.lock/layer.mk 08-warm-go-build-vendor-cache-12bf088afd7426b615e6193316c7efeda43120b4-save
|
|
name: Prepare build layers for caching
|
|
- save_cache:
|
|
key: cache006-warm-go-build-vendor-cache_12bf_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-12bf088afd7426b615e6193316c7efeda43120b4"}}
|
|
name: Save build layer cache
|
|
paths:
|
|
- .buildcache/archives/08-warm-go-build-vendor-cache-12bf088afd7426b615e6193316c7efeda43120b4.tar.gz
|
|
netbsd_386_package:
|
|
docker:
|
|
- image: circleci/buildpack-deps
|
|
shell: /usr/bin/env bash -euo pipefail -c
|
|
environment:
|
|
- AUTO_INSTALL_TOOLS: 'YES'
|
|
- BUILDKIT_PROGRESS: plain
|
|
- PRODUCT_REVISION: ''
|
|
- PACKAGE_SPEC_ID: bf75cfc6c5d05271cff63ed817f7e09f9540eef3
|
|
steps:
|
|
- setup_remote_docker:
|
|
version: 19.03.12
|
|
- add_ssh_keys:
|
|
fingerprints:
|
|
- c6:96:98:82:dc:04:6c:39:dd:ac:83:05:e3:15:1c:98
|
|
- checkout
|
|
- run:
|
|
command: make -C packages*.lock write-package-cache-key
|
|
name: Write package cache key
|
|
- restore_cache:
|
|
key: cache006-package-bf75cfc6c5d05271cff63ed817f7e09f9540eef3-{{checksum ".buildcache/cache-keys/package-bf75cfc6c5d05271cff63ed817f7e09f9540eef3"}}
|
|
name: Restore package cache
|
|
- run:
|
|
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
|
|
name: Check the cache status.
|
|
- run:
|
|
command: make -C packages*.lock write-builder-cache-keys
|
|
name: Write builder layer cache keys
|
|
- restore_cache:
|
|
keys:
|
|
- cache006-copy-source_c016_{{checksum ".buildcache/cache-keys/copy-source-c01601ec6ea0f60a2403cb5a29d70b0c08241428"}}
|
|
- cache006-warm-go-build-vendor-cache_66e5_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-66e5f57dc50bf5c80b57f8aa5c77147b1a188f8c"}}
|
|
- cache006-build-static-assets_5d03_{{checksum ".buildcache/cache-keys/build-static-assets-5d03b27bdb30353a4b10b43aaeed34d1843ea016"}}
|
|
- cache006-build-ui_8c08_{{checksum ".buildcache/cache-keys/build-ui-8c0888ac60d74cc3c80ff1e66f92529854029bb8"}}
|
|
- cache006-ui-dependencies_a323_{{checksum ".buildcache/cache-keys/ui-dependencies-a323ed865ff8f01132ebbcfdb26cd46637ee0537"}}
|
|
- cache006-install-yarn_f6bc_{{checksum ".buildcache/cache-keys/install-yarn-f6bc3cf1c8120fc6fbc6a7815f1414ea4a92b347"}}
|
|
- cache006-set-workdir_6821_{{checksum ".buildcache/cache-keys/set-workdir-68217e0df446776a522c173819319331eab24bfd"}}
|
|
- cache006-install-go-tools_4930_{{checksum ".buildcache/cache-keys/install-go-tools-493003a45b9bf13a3740054d1ed1e50aa66e0981"}}
|
|
- cache006-install-go_04fa_{{checksum ".buildcache/cache-keys/install-go-04fac374a5ab393a607df72e77bce85e18dd3856"}}
|
|
- cache006-base_cd50_{{checksum ".buildcache/cache-keys/base-cd50335c2217aa98d45d50d7ef941dfd1289b070"}}
|
|
name: Restore build layer cache
|
|
- run:
|
|
command: |
|
|
make -C packages*.lock load-builder-cache
|
|
name: Load whatever builder cache we have (if any) into the Docker daemon
|
|
no_output_timeout: 30m
|
|
- run:
|
|
command: |2
|
|
|
|
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
|
|
name: Compile Package
|
|
- run:
|
|
command: ls -lahR .buildcache/packages
|
|
name: List packages
|
|
- save_cache:
|
|
key: cache006-package-bf75cfc6c5d05271cff63ed817f7e09f9540eef3-{{checksum ".buildcache/cache-keys/package-bf75cfc6c5d05271cff63ed817f7e09f9540eef3"}}
|
|
name: Saving package cache
|
|
paths:
|
|
- .buildcache/packages/store
|
|
- run:
|
|
command: |
|
|
if [ -f .buildcache/archives/08-warm-go-build-vendor-cache-66e5f57dc50bf5c80b57f8aa5c77147b1a188f8c.tar.gz ]; then
|
|
echo "Builder image already cached, skipping cache step."
|
|
circleci-agent step halt
|
|
fi
|
|
name: Check builder cache status
|
|
- run:
|
|
command: make -f packages*.lock/layer.mk 08-warm-go-build-vendor-cache-66e5f57dc50bf5c80b57f8aa5c77147b1a188f8c-save
|
|
name: Prepare build layers for caching
|
|
- save_cache:
|
|
key: cache006-warm-go-build-vendor-cache_66e5_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-66e5f57dc50bf5c80b57f8aa5c77147b1a188f8c"}}
|
|
name: Save build layer cache
|
|
paths:
|
|
- .buildcache/archives/08-warm-go-build-vendor-cache-66e5f57dc50bf5c80b57f8aa5c77147b1a188f8c.tar.gz
|
|
freebsd_arm_package:
|
|
docker:
|
|
- image: circleci/buildpack-deps
|
|
shell: /usr/bin/env bash -euo pipefail -c
|
|
environment:
|
|
- AUTO_INSTALL_TOOLS: 'YES'
|
|
- BUILDKIT_PROGRESS: plain
|
|
- PRODUCT_REVISION: ''
|
|
- PACKAGE_SPEC_ID: 05e17ce0ee458742bbcad189c58cd709ead699e3
|
|
steps:
|
|
- setup_remote_docker:
|
|
version: 19.03.12
|
|
- add_ssh_keys:
|
|
fingerprints:
|
|
- c6:96:98:82:dc:04:6c:39:dd:ac:83:05:e3:15:1c:98
|
|
- checkout
|
|
- run:
|
|
command: make -C packages*.lock write-package-cache-key
|
|
name: Write package cache key
|
|
- restore_cache:
|
|
key: cache006-package-05e17ce0ee458742bbcad189c58cd709ead699e3-{{checksum ".buildcache/cache-keys/package-05e17ce0ee458742bbcad189c58cd709ead699e3"}}
|
|
name: Restore package cache
|
|
- run:
|
|
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
|
|
name: Check the cache status.
|
|
- run:
|
|
command: make -C packages*.lock write-builder-cache-keys
|
|
name: Write builder layer cache keys
|
|
- restore_cache:
|
|
keys:
|
|
- cache006-copy-source_810a_{{checksum ".buildcache/cache-keys/copy-source-810ab6ed75ddab8380a8142c74d41360619b0c29"}}
|
|
- cache006-warm-go-build-vendor-cache_4f40_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-4f409d29ffae0b3ec57b8459021b3c67105e257a"}}
|
|
- cache006-build-static-assets_5d03_{{checksum ".buildcache/cache-keys/build-static-assets-5d03b27bdb30353a4b10b43aaeed34d1843ea016"}}
|
|
- cache006-build-ui_8c08_{{checksum ".buildcache/cache-keys/build-ui-8c0888ac60d74cc3c80ff1e66f92529854029bb8"}}
|
|
- cache006-ui-dependencies_a323_{{checksum ".buildcache/cache-keys/ui-dependencies-a323ed865ff8f01132ebbcfdb26cd46637ee0537"}}
|
|
- cache006-install-yarn_f6bc_{{checksum ".buildcache/cache-keys/install-yarn-f6bc3cf1c8120fc6fbc6a7815f1414ea4a92b347"}}
|
|
- cache006-set-workdir_6821_{{checksum ".buildcache/cache-keys/set-workdir-68217e0df446776a522c173819319331eab24bfd"}}
|
|
- cache006-install-go-tools_4930_{{checksum ".buildcache/cache-keys/install-go-tools-493003a45b9bf13a3740054d1ed1e50aa66e0981"}}
|
|
- cache006-install-go_04fa_{{checksum ".buildcache/cache-keys/install-go-04fac374a5ab393a607df72e77bce85e18dd3856"}}
|
|
- cache006-base_cd50_{{checksum ".buildcache/cache-keys/base-cd50335c2217aa98d45d50d7ef941dfd1289b070"}}
|
|
name: Restore build layer cache
|
|
- run:
|
|
command: |
|
|
make -C packages*.lock load-builder-cache
|
|
name: Load whatever builder cache we have (if any) into the Docker daemon
|
|
no_output_timeout: 30m
|
|
- run:
|
|
command: |2
|
|
|
|
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
|
|
name: Compile Package
|
|
- run:
|
|
command: ls -lahR .buildcache/packages
|
|
name: List packages
|
|
- save_cache:
|
|
key: cache006-package-05e17ce0ee458742bbcad189c58cd709ead699e3-{{checksum ".buildcache/cache-keys/package-05e17ce0ee458742bbcad189c58cd709ead699e3"}}
|
|
name: Saving package cache
|
|
paths:
|
|
- .buildcache/packages/store
|
|
- run:
|
|
command: |
|
|
if [ -f .buildcache/archives/08-warm-go-build-vendor-cache-4f409d29ffae0b3ec57b8459021b3c67105e257a.tar.gz ]; then
|
|
echo "Builder image already cached, skipping cache step."
|
|
circleci-agent step halt
|
|
fi
|
|
name: Check builder cache status
|
|
- run:
|
|
command: make -f packages*.lock/layer.mk 08-warm-go-build-vendor-cache-4f409d29ffae0b3ec57b8459021b3c67105e257a-save
|
|
name: Prepare build layers for caching
|
|
- save_cache:
|
|
key: cache006-warm-go-build-vendor-cache_4f40_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-4f409d29ffae0b3ec57b8459021b3c67105e257a"}}
|
|
name: Save build layer cache
|
|
paths:
|
|
- .buildcache/archives/08-warm-go-build-vendor-cache-4f409d29ffae0b3ec57b8459021b3c67105e257a.tar.gz
|
|
windows_amd64_package:
|
|
docker:
|
|
- image: circleci/buildpack-deps
|
|
shell: /usr/bin/env bash -euo pipefail -c
|
|
environment:
|
|
- AUTO_INSTALL_TOOLS: 'YES'
|
|
- BUILDKIT_PROGRESS: plain
|
|
- PRODUCT_REVISION: ''
|
|
- PACKAGE_SPEC_ID: 91b9f04147548016ff75ff09603178cf650ff352
|
|
steps:
|
|
- setup_remote_docker:
|
|
version: 19.03.12
|
|
- add_ssh_keys:
|
|
fingerprints:
|
|
- c6:96:98:82:dc:04:6c:39:dd:ac:83:05:e3:15:1c:98
|
|
- checkout
|
|
- run:
|
|
command: make -C packages*.lock write-package-cache-key
|
|
name: Write package cache key
|
|
- restore_cache:
|
|
key: cache006-package-91b9f04147548016ff75ff09603178cf650ff352-{{checksum ".buildcache/cache-keys/package-91b9f04147548016ff75ff09603178cf650ff352"}}
|
|
name: Restore package cache
|
|
- run:
|
|
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
|
|
name: Check the cache status.
|
|
- run:
|
|
command: make -C packages*.lock write-builder-cache-keys
|
|
name: Write builder layer cache keys
|
|
- restore_cache:
|
|
keys:
|
|
- cache006-copy-source_68b9_{{checksum ".buildcache/cache-keys/copy-source-68b94ea302e6776db837cd8ed34c15b8cdcc0aab"}}
|
|
- cache006-warm-go-build-vendor-cache_796e_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-796e8ac227854e08a3a3394f23dee54006eb40eb"}}
|
|
- cache006-build-static-assets_5d03_{{checksum ".buildcache/cache-keys/build-static-assets-5d03b27bdb30353a4b10b43aaeed34d1843ea016"}}
|
|
- cache006-build-ui_8c08_{{checksum ".buildcache/cache-keys/build-ui-8c0888ac60d74cc3c80ff1e66f92529854029bb8"}}
|
|
- cache006-ui-dependencies_a323_{{checksum ".buildcache/cache-keys/ui-dependencies-a323ed865ff8f01132ebbcfdb26cd46637ee0537"}}
|
|
- cache006-install-yarn_f6bc_{{checksum ".buildcache/cache-keys/install-yarn-f6bc3cf1c8120fc6fbc6a7815f1414ea4a92b347"}}
|
|
- cache006-set-workdir_6821_{{checksum ".buildcache/cache-keys/set-workdir-68217e0df446776a522c173819319331eab24bfd"}}
|
|
- cache006-install-go-tools_4930_{{checksum ".buildcache/cache-keys/install-go-tools-493003a45b9bf13a3740054d1ed1e50aa66e0981"}}
|
|
- cache006-install-go_04fa_{{checksum ".buildcache/cache-keys/install-go-04fac374a5ab393a607df72e77bce85e18dd3856"}}
|
|
- cache006-base_cd50_{{checksum ".buildcache/cache-keys/base-cd50335c2217aa98d45d50d7ef941dfd1289b070"}}
|
|
name: Restore build layer cache
|
|
- run:
|
|
command: |
|
|
make -C packages*.lock load-builder-cache
|
|
name: Load whatever builder cache we have (if any) into the Docker daemon
|
|
no_output_timeout: 30m
|
|
- run:
|
|
command: |2
|
|
|
|
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
|
|
name: Compile Package
|
|
- run:
|
|
command: ls -lahR .buildcache/packages
|
|
name: List packages
|
|
- save_cache:
|
|
key: cache006-package-91b9f04147548016ff75ff09603178cf650ff352-{{checksum ".buildcache/cache-keys/package-91b9f04147548016ff75ff09603178cf650ff352"}}
|
|
name: Saving package cache
|
|
paths:
|
|
- .buildcache/packages/store
|
|
- run:
|
|
command: |
|
|
if [ -f .buildcache/archives/08-warm-go-build-vendor-cache-796e8ac227854e08a3a3394f23dee54006eb40eb.tar.gz ]; then
|
|
echo "Builder image already cached, skipping cache step."
|
|
circleci-agent step halt
|
|
fi
|
|
name: Check builder cache status
|
|
- run:
|
|
command: make -f packages*.lock/layer.mk 08-warm-go-build-vendor-cache-796e8ac227854e08a3a3394f23dee54006eb40eb-save
|
|
name: Prepare build layers for caching
|
|
- save_cache:
|
|
key: cache006-warm-go-build-vendor-cache_796e_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-796e8ac227854e08a3a3394f23dee54006eb40eb"}}
|
|
name: Save build layer cache
|
|
paths:
|
|
- .buildcache/archives/08-warm-go-build-vendor-cache-796e8ac227854e08a3a3394f23dee54006eb40eb.tar.gz
|
|
pre-flight-checks:
|
|
docker:
|
|
- image: circleci/buildpack-deps
|
|
environment:
|
|
- CCI_VERSION: 0.1.5691
|
|
shell: /usr/bin/env bash -euo pipefail
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
command: |
|
|
export CCI_PATH=/tmp/circleci-cli/$CCI_VERSION
|
|
mkdir -p $CCI_PATH
|
|
NAME=circleci-cli_${CCI_VERSION}_${ARCH}
|
|
URL=$BASE/v${CCI_VERSION}/${NAME}.tar.gz
|
|
curl -sSL $URL \
|
|
| tar --overwrite --strip-components=1 -xz -C $CCI_PATH "${NAME}/circleci"
|
|
# Add circleci to the path for subsequent steps.
|
|
echo "export PATH=$CCI_PATH:\$PATH" >> $BASH_ENV
|
|
# Done, print some debug info.
|
|
set -x
|
|
. $BASH_ENV
|
|
which circleci
|
|
circleci version
|
|
environment:
|
|
ARCH: linux_amd64
|
|
BASE: https://github.com/CircleCI-Public/circleci-cli/releases/download
|
|
name: Install CircleCI CLI
|
|
- run:
|
|
command: make ci-verify
|
|
test-go-race-remote-docker:
|
|
docker:
|
|
- image: circleci/golang:1.14.7-stretch
|
|
resource_class: xlarge
|
|
working_directory: /go/src/github.com/hashicorp/vault
|
|
parallelism: 8
|
|
steps:
|
|
- run:
|
|
command: |
|
|
# If the branch being tested starts with ui/ or docs/ we want to exit the job without failing
|
|
[[ "$CIRCLE_BRANCH" = ui/* || "$CIRCLE_BRANCH" = docs/* ]] && {
|
|
# stop the job from this step
|
|
circleci-agent step halt
|
|
}
|
|
# exit with success either way
|
|
exit 0
|
|
name: Check branch name
|
|
working_directory: ~/
|
|
- checkout
|
|
- setup_remote_docker:
|
|
docker_layer_caching: true
|
|
version: 18.09.3
|
|
- run:
|
|
command: |
|
|
TZ=GMT date '+%Y%m%d' > /tmp/go-cache-key
|
|
name: Compute test cache key
|
|
- restore_cache:
|
|
keys:
|
|
- go-test-cache-date-v1-{{ checksum "/tmp/go-cache-key" }}
|
|
- run:
|
|
command: |
|
|
set -x
|
|
|
|
case "-race" in
|
|
*-race*) export VAULT_CI_GO_TEST_RACE=1;;
|
|
esac
|
|
|
|
# Install CircleCI CLI
|
|
curl -sSL \
|
|
"https://github.com/CircleCI-Public/circleci-cli/releases/download/v${CIRCLECI_CLI_VERSION}/circleci-cli_${CIRCLECI_CLI_VERSION}_linux_amd64.tar.gz" \
|
|
| sudo tar --overwrite -xz \
|
|
-C /usr/local/bin \
|
|
"circleci-cli_${CIRCLECI_CLI_VERSION}_linux_amd64/circleci"
|
|
|
|
USE_DOCKER=0
|
|
USE_DOCKER=1
|
|
|
|
# Split Go tests by prior test times. If use_docker is true, only run
|
|
# tests that depend on docker, otherwise only those that don't.
|
|
if [ $USE_DOCKER == 1 ]; then
|
|
package_names=$(go list -test -json ./... |
|
|
jq -r 'select(.Deps != null) |
|
|
select(any(.Deps[] ; contains("github.com/hashicorp/vault/helper/testhelpers/docker"))) |
|
|
.ForTest | select(. != null)' |
|
|
sort -u | circleci tests split --split-by=timings --timings-type=classname)
|
|
else
|
|
package_names=$(go list -test -json ./... |
|
|
jq -r 'select(.Deps != null) |
|
|
select(all(.Deps[] ; contains("github.com/hashicorp/vault/helper/testhelpers/docker")|not)) |
|
|
.ForTest | select(. != null)' |
|
|
sort -u | circleci tests split --split-by=timings --timings-type=classname)
|
|
fi
|
|
|
|
# After running tests split step, we are now running the following steps
|
|
# in multiple different containers, each getting a different subset of
|
|
# the test packages in their package_names variable. Each container
|
|
# has its own remote docker VM.
|
|
|
|
make prep
|
|
mkdir -p test-results/go-test
|
|
|
|
# Create a docker network for our testcontainer
|
|
if [ $USE_DOCKER == 1 ]; then
|
|
# Despite the fact that we're using a circleci image (thus getting the
|
|
# version they chose for the docker cli) and that we're specifying a
|
|
# docker version to use for the remote docker instances, we occasionally
|
|
# see "client version too new, max supported version 1.39" errors for
|
|
# reasons unclear.
|
|
export DOCKER_API_VERSION=1.39
|
|
|
|
export TEST_DOCKER_NETWORK_ID=$(docker network list -q -f 'name=vaulttest')
|
|
if [ -z $TEST_DOCKER_NETWORK_ID ]; then
|
|
TEST_DOCKER_NETWORK_ID=$(docker network create vaulttest)
|
|
fi
|
|
|
|
# Start a docker testcontainer to run the tests in
|
|
docker run -d -e TEST_DOCKER_NETWORK_ID \
|
|
-e DOCKER_CERT_PATH -e DOCKER_HOST -e DOCKER_MACHINE_NAME -e DOCKER_TLS_VERIFY -e NO_PROXY \
|
|
-e VAULT_TEST_LOG_DIR=/tmp/testlogs \
|
|
--network vaulttest --name \
|
|
testcontainer circleci/golang:1.14.7-stretch \
|
|
tail -f /dev/null
|
|
|
|
# Run tests
|
|
test -d /tmp/go-cache && docker cp /tmp/go-cache testcontainer:/tmp/gocache
|
|
docker exec testcontainer sh -c 'mkdir -p /go/src/github.com/hashicorp/vault'
|
|
docker cp . testcontainer:/go/src/github.com/hashicorp/vault/
|
|
docker cp $DOCKER_CERT_PATH/ testcontainer:$DOCKER_CERT_PATH
|
|
|
|
docker exec -w /go/src/github.com/hashicorp/vault/ \
|
|
-e GO111MODULE -e CIRCLECI -e GOCACHE=/tmp/gocache -e VAULT_CI_GO_TEST_RACE \
|
|
testcontainer \
|
|
gotestsum --format=short-verbose \
|
|
--junitfile test-results/go-test/results.xml \
|
|
--jsonfile test-results/go-test/results.json \
|
|
-- \
|
|
-tags "${GO_TAGS}" \
|
|
-timeout=60m \
|
|
-parallel=20 \
|
|
-race \
|
|
${package_names}
|
|
else
|
|
GOCACHE=/tmp/go-cache \
|
|
gotestsum --format=short-verbose \
|
|
--junitfile test-results/go-test/results.xml \
|
|
--jsonfile test-results/go-test/results.json \
|
|
-- \
|
|
-tags "${GO_TAGS}" \
|
|
-timeout=60m \
|
|
-parallel=20 \
|
|
-race \
|
|
${package_names}
|
|
fi
|
|
name: Run Go tests
|
|
no_output_timeout: 60m
|
|
- run:
|
|
command: |
|
|
docker cp testcontainer:/go/src/github.com/hashicorp/vault/test-results .
|
|
docker cp testcontainer:/tmp/gocache /tmp/go-cache
|
|
name: Copy test results
|
|
when: always
|
|
- store_artifacts:
|
|
path: test-results
|
|
- store_test_results:
|
|
path: test-results
|
|
- store_artifacts:
|
|
path: /tmp/testlogs
|
|
environment:
|
|
- CIRCLECI_CLI_VERSION: 0.1.5546
|
|
- GO_TAGS: ''
|
|
- GO111MODULE: 'off'
|
|
workflows:
|
|
build-standalone:
|
|
jobs:
|
|
- build-common-layers
|
|
- darwin_386_package:
|
|
requires:
|
|
- build-common-layers
|
|
- darwin_amd64_package:
|
|
requires:
|
|
- build-common-layers
|
|
- freebsd_386_package:
|
|
requires:
|
|
- build-common-layers
|
|
- freebsd_amd64_package:
|
|
requires:
|
|
- build-common-layers
|
|
- freebsd_arm_package:
|
|
requires:
|
|
- build-common-layers
|
|
- linux_386_package:
|
|
requires:
|
|
- build-common-layers
|
|
- linux_amd64_package:
|
|
requires:
|
|
- build-common-layers
|
|
- linux_arm_package:
|
|
requires:
|
|
- build-common-layers
|
|
- linux_arm64_package:
|
|
requires:
|
|
- build-common-layers
|
|
- netbsd_386_package:
|
|
requires:
|
|
- build-common-layers
|
|
- netbsd_amd64_package:
|
|
requires:
|
|
- build-common-layers
|
|
- openbsd_386_package:
|
|
requires:
|
|
- build-common-layers
|
|
- openbsd_amd64_package:
|
|
requires:
|
|
- build-common-layers
|
|
- solaris_amd64_package:
|
|
requires:
|
|
- build-common-layers
|
|
- windows_386_package:
|
|
requires:
|
|
- build-common-layers
|
|
- windows_amd64_package:
|
|
requires:
|
|
- build-common-layers
|
|
- bundle-releases:
|
|
requires:
|
|
- darwin_386_package
|
|
- darwin_amd64_package
|
|
- freebsd_386_package
|
|
- freebsd_amd64_package
|
|
- freebsd_arm_package
|
|
- linux_386_package
|
|
- linux_amd64_package
|
|
- linux_arm_package
|
|
- linux_arm64_package
|
|
- netbsd_386_package
|
|
- netbsd_amd64_package
|
|
- openbsd_386_package
|
|
- openbsd_amd64_package
|
|
- solaris_amd64_package
|
|
- windows_386_package
|
|
- windows_amd64_package
|
|
ci:
|
|
jobs:
|
|
- pre-flight-checks
|
|
- install-ui-dependencies:
|
|
requires:
|
|
- pre-flight-checks
|
|
- build-go-dev:
|
|
requires:
|
|
- pre-flight-checks
|
|
- test-ui:
|
|
requires:
|
|
- install-ui-dependencies
|
|
- build-go-dev
|
|
- test-ui-browserstack:
|
|
filters:
|
|
branches:
|
|
ignore: /pull\/[0-9]+/
|
|
requires:
|
|
- install-ui-dependencies
|
|
- build-go-dev
|
|
- test-go:
|
|
filters:
|
|
branches:
|
|
ignore:
|
|
- /^docs\/.*/
|
|
- /^ui\/.*/
|
|
requires:
|
|
- pre-flight-checks
|
|
- test-go-remote-docker:
|
|
filters:
|
|
branches:
|
|
ignore:
|
|
- /^docs\/.*/
|
|
- /^ui\/.*/
|
|
requires:
|
|
- pre-flight-checks
|
|
- test-go-race:
|
|
filters:
|
|
branches:
|
|
ignore:
|
|
- /^docs\/.*/
|
|
- /^ui\/.*/
|
|
requires:
|
|
- pre-flight-checks
|
|
- test-go-race-remote-docker:
|
|
filters:
|
|
branches:
|
|
ignore:
|
|
- /^docs\/.*/
|
|
- /^ui\/.*/
|
|
requires:
|
|
- pre-flight-checks
|
|
- website-docker-image:
|
|
filters:
|
|
branches:
|
|
only:
|
|
- master
|
|
context: vault-docs
|
|
- algolia-index:
|
|
filters:
|
|
branches:
|
|
only:
|
|
- stable-website
|
|
context: vault-docs
|
|
nightly-cachebuilder:
|
|
jobs:
|
|
- pre-flight-checks
|
|
- test-go-nightly
|
|
triggers:
|
|
- schedule:
|
|
cron: 0 9 * * *
|
|
filters:
|
|
branches:
|
|
only:
|
|
- master
|
|
version: 2
|