### *** ### 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: docker.mirror.hashicorp.services/circleci/buildpack-deps shell: /usr/bin/env bash -euo pipefail -c steps: - checkout: path: . - run: command: make -C packages*.lock write-all-package-cache-keys name: Write all package cache keys - run: command: mkdir -p .buildcache && echo "*" > .buildcache/.gitignore name: Ignore .buildcache - restore_cache: key: package-4d5c8238521df42de23b52310a3415cb695d4fb2-{{checksum ".buildcache/cache-keys/package-4d5c8238521df42de23b52310a3415cb695d4fb2"}} name: Restore package cache - restore_cache: key: package-83aaf1a9b14f45042b699ab313455cd2b4ee9fb1-{{checksum ".buildcache/cache-keys/package-83aaf1a9b14f45042b699ab313455cd2b4ee9fb1"}} name: Restore package cache - restore_cache: key: package-3c4c0cb1790bac5865da0757a8c3c87ac65eb5a6-{{checksum ".buildcache/cache-keys/package-3c4c0cb1790bac5865da0757a8c3c87ac65eb5a6"}} name: Restore package cache - restore_cache: key: package-bf03c8c1695d649ed9d6cb3f1f8bb250b81c38c3-{{checksum ".buildcache/cache-keys/package-bf03c8c1695d649ed9d6cb3f1f8bb250b81c38c3"}} name: Restore package cache - restore_cache: key: package-4ee502a4b97ff101017ea1960bd6227412c377fd-{{checksum ".buildcache/cache-keys/package-4ee502a4b97ff101017ea1960bd6227412c377fd"}} name: Restore package cache - restore_cache: key: package-48ce5c746842cfb9ae9dcad50fa1bab08b863d62-{{checksum ".buildcache/cache-keys/package-48ce5c746842cfb9ae9dcad50fa1bab08b863d62"}} name: Restore package cache - restore_cache: key: package-e1dbfb4cbd89fa9b6009bffa7733c6e22cebb88e-{{checksum ".buildcache/cache-keys/package-e1dbfb4cbd89fa9b6009bffa7733c6e22cebb88e"}} name: Restore package cache - restore_cache: key: package-eb9624410547ae13b947829605b4a69f4e2355cf-{{checksum ".buildcache/cache-keys/package-eb9624410547ae13b947829605b4a69f4e2355cf"}} name: Restore package cache - restore_cache: key: package-52a4092a18c67dacc6e2132f451231d3c0ad5350-{{checksum ".buildcache/cache-keys/package-52a4092a18c67dacc6e2132f451231d3c0ad5350"}} name: Restore package cache - restore_cache: key: package-5eda110323a6276136c3a32f79d69463852f91d7-{{checksum ".buildcache/cache-keys/package-5eda110323a6276136c3a32f79d69463852f91d7"}} name: Restore package cache - restore_cache: key: package-45fa55a76efbe60e12a7e950e86b5a8b9101f0a5-{{checksum ".buildcache/cache-keys/package-45fa55a76efbe60e12a7e950e86b5a8b9101f0a5"}} name: Restore package cache - restore_cache: key: package-288879a49947b0156f67341dfa2e52d65d4d63fe-{{checksum ".buildcache/cache-keys/package-288879a49947b0156f67341dfa2e52d65d4d63fe"}} name: Restore package cache - restore_cache: key: package-a7d37f46fa8a266d4fcc5e257d939c457d2c1c26-{{checksum ".buildcache/cache-keys/package-a7d37f46fa8a266d4fcc5e257d939c457d2c1c26"}} name: Restore package cache - restore_cache: key: package-9e98262d3fcde7a4f5343f7fe25e21756ded9a77-{{checksum ".buildcache/cache-keys/package-9e98262d3fcde7a4f5343f7fe25e21756ded9a77"}} name: Restore package cache - restore_cache: key: package-54ebb851411a86b0f05499d1275f45b64b74c032-{{checksum ".buildcache/cache-keys/package-54ebb851411a86b0f05499d1275f45b64b74c032"}} name: Restore package cache - restore_cache: key: package-ad5e8d34df02b5ad2dd18d56208d1806c3f2a721-{{checksum ".buildcache/cache-keys/package-ad5e8d34df02b5ad2dd18d56208d1806c3f2a721"}} name: Restore package cache - run: command: make package-meta-all name: Write Package Metadata - 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-d4738432dabd028a.yml name: Update Lockfile Name - run: command: tar -czf packages-d4738432dabd028a.tar.gz .buildcache/packages lockfile-d4738432dabd028a.yml name: Create Raw Package Tarball - run: command: tar -czf meta-d4738432dabd028a.tar.gz .buildcache/packages/store/*.json lockfile-d4738432dabd028a.yml name: Create Metadata Tarball - store_artifacts: path: lockfile-d4738432dabd028a.yml - store_artifacts: path: packages-d4738432dabd028a.tar.gz - store_artifacts: path: meta-d4738432dabd028a.tar.gz - store_artifacts: path: .buildcache/packages environment: - AUTO_INSTALL_TOOLS: 'YES' - BUILDKIT_PROGRESS: plain - PRODUCT_REVISION: '' darwin_amd64_package: docker: - image: docker.mirror.hashicorp.services/circleci/buildpack-deps shell: /usr/bin/env bash -euo pipefail -c environment: - AUTO_INSTALL_TOOLS: 'YES' - BUILDKIT_PROGRESS: plain - PRODUCT_REVISION: '' - PACKAGE_SPEC_ID: 83aaf1a9b14f45042b699ab313455cd2b4ee9fb1 steps: - setup_remote_docker: docker_layer_caching: false 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: path: . - run: command: make -C packages*.lock write-package-cache-key name: Write package cache key - restore_cache: key: package-83aaf1a9b14f45042b699ab313455cd2b4ee9fb1-{{checksum ".buildcache/cache-keys/package-83aaf1a9b14f45042b699ab313455cd2b4ee9fb1"}} name: Restore package cache - run: command: |2 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 cache status - run: command: make -C packages*.lock write-builder-cache-keys name: Write builder layer cache keys - restore_cache: key: copy-source_4fbd_{{checksum ".buildcache/cache-keys/copy-source-4fbd883dbd1ea85319e94369ecd85de99f7ec129"}} keys: - warm-go-build-vendor-cache_2d2f_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-2d2f851f7fd3b3d15efa5eddfb198a2fc0fee7c2"}} - build-static-assets_c16c_{{checksum ".buildcache/cache-keys/build-static-assets-c16c92ba6efaac1d8ce78e253494d5990e673532"}} - build-ui_d410_{{checksum ".buildcache/cache-keys/build-ui-d4103be58748b6e071db728cbd54220aa1e4326e"}} - ui-dependencies_91f5_{{checksum ".buildcache/cache-keys/ui-dependencies-91f59cc67fec4697ade6f0c892970ba7bd23e0a8"}} - install-yarn_bbaf_{{checksum ".buildcache/cache-keys/install-yarn-bbaf7b58ff71fac3d054dba364ea5aa9169cf9f7"}} - set-workdir_f573_{{checksum ".buildcache/cache-keys/set-workdir-f57397d33d7a62ba66ebcc200ecf774e5b8bda25"}} - install-go-tools_93ff_{{checksum ".buildcache/cache-keys/install-go-tools-93ff4bda3b82e8d26d9ed37fb2b8843639dd4761"}} - install-go_8dde_{{checksum ".buildcache/cache-keys/install-go-8dde98d41082e5612aa95b0984d75c52c11c2802"}} - base_c6cd_{{checksum ".buildcache/cache-keys/base-c6cdf1b224722d2520e082320f2a71875913247c"}} name: 'Restore Builder Image Cache: copy-source' - 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: package-83aaf1a9b14f45042b699ab313455cd2b4ee9fb1-{{checksum ".buildcache/cache-keys/package-83aaf1a9b14f45042b699ab313455cd2b4ee9fb1"}} name: Save package cache paths: - .buildcache/packages/store windows_386_package: docker: - image: docker.mirror.hashicorp.services/circleci/buildpack-deps shell: /usr/bin/env bash -euo pipefail -c environment: - AUTO_INSTALL_TOOLS: 'YES' - BUILDKIT_PROGRESS: plain - PRODUCT_REVISION: '' - PACKAGE_SPEC_ID: 54ebb851411a86b0f05499d1275f45b64b74c032 steps: - setup_remote_docker: docker_layer_caching: false 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: path: . - run: command: make -C packages*.lock write-package-cache-key name: Write package cache key - restore_cache: key: package-54ebb851411a86b0f05499d1275f45b64b74c032-{{checksum ".buildcache/cache-keys/package-54ebb851411a86b0f05499d1275f45b64b74c032"}} name: Restore package cache - run: command: |2 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 cache status - run: command: make -C packages*.lock write-builder-cache-keys name: Write builder layer cache keys - restore_cache: key: copy-source_4fbd_{{checksum ".buildcache/cache-keys/copy-source-4fbd883dbd1ea85319e94369ecd85de99f7ec129"}} keys: - warm-go-build-vendor-cache_2d2f_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-2d2f851f7fd3b3d15efa5eddfb198a2fc0fee7c2"}} - build-static-assets_c16c_{{checksum ".buildcache/cache-keys/build-static-assets-c16c92ba6efaac1d8ce78e253494d5990e673532"}} - build-ui_d410_{{checksum ".buildcache/cache-keys/build-ui-d4103be58748b6e071db728cbd54220aa1e4326e"}} - ui-dependencies_91f5_{{checksum ".buildcache/cache-keys/ui-dependencies-91f59cc67fec4697ade6f0c892970ba7bd23e0a8"}} - install-yarn_bbaf_{{checksum ".buildcache/cache-keys/install-yarn-bbaf7b58ff71fac3d054dba364ea5aa9169cf9f7"}} - set-workdir_f573_{{checksum ".buildcache/cache-keys/set-workdir-f57397d33d7a62ba66ebcc200ecf774e5b8bda25"}} - install-go-tools_93ff_{{checksum ".buildcache/cache-keys/install-go-tools-93ff4bda3b82e8d26d9ed37fb2b8843639dd4761"}} - install-go_8dde_{{checksum ".buildcache/cache-keys/install-go-8dde98d41082e5612aa95b0984d75c52c11c2802"}} - base_c6cd_{{checksum ".buildcache/cache-keys/base-c6cdf1b224722d2520e082320f2a71875913247c"}} name: 'Restore Builder Image Cache: copy-source' - 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: package-54ebb851411a86b0f05499d1275f45b64b74c032-{{checksum ".buildcache/cache-keys/package-54ebb851411a86b0f05499d1275f45b64b74c032"}} name: Save package cache paths: - .buildcache/packages/store install-ui-dependencies: docker: - image: docker.mirror.hashicorp.services/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: path: . - run: command: make -C packages*.lock write-builder-cache-keys name: Write builder layer cache keys - restore_cache: key: build-ui_d410_{{checksum ".buildcache/cache-keys/build-ui-d4103be58748b6e071db728cbd54220aa1e4326e"}} keys: - ui-dependencies_91f5_{{checksum ".buildcache/cache-keys/ui-dependencies-91f59cc67fec4697ade6f0c892970ba7bd23e0a8"}} - install-yarn_bbaf_{{checksum ".buildcache/cache-keys/install-yarn-bbaf7b58ff71fac3d054dba364ea5aa9169cf9f7"}} - set-workdir_f573_{{checksum ".buildcache/cache-keys/set-workdir-f57397d33d7a62ba66ebcc200ecf774e5b8bda25"}} - install-go-tools_93ff_{{checksum ".buildcache/cache-keys/install-go-tools-93ff4bda3b82e8d26d9ed37fb2b8843639dd4761"}} - install-go_8dde_{{checksum ".buildcache/cache-keys/install-go-8dde98d41082e5612aa95b0984d75c52c11c2802"}} - base_c6cd_{{checksum ".buildcache/cache-keys/base-c6cdf1b224722d2520e082320f2a71875913247c"}} name: 'Restore Layer Cache: build-ui' - run: command: LAYER_SPEC_ID=06-build-ui-d4103be58748b6e071db728cbd54220aa1e4326e make -C packages*.lock load-builder-cache name: Load whatever builder cache we have (if any) into the Docker daemon - 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-c6cdf1b224722d2520e082320f2a71875913247c-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-8dde98d41082e5612aa95b0984d75c52c11c2802-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-93ff4bda3b82e8d26d9ed37fb2b8843639dd4761-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-f57397d33d7a62ba66ebcc200ecf774e5b8bda25-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-bbaf7b58ff71fac3d054dba364ea5aa9169cf9f7-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-91f59cc67fec4697ade6f0c892970ba7bd23e0a8-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-d4103be58748b6e071db728cbd54220aa1e4326e-image name: Build build-ui 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-d4103be58748b6e071db728cbd54220aa1e4326e-save name: Build build-ui layer - save_cache: key: build-ui_d410_{{checksum ".buildcache/cache-keys/build-ui-d4103be58748b6e071db728cbd54220aa1e4326e"}} name: 'Save Layer Cache: build-ui' paths: - .buildcache/archives/06-build-ui-d4103be58748b6e071db728cbd54220aa1e4326e.tar.gz environment: - AUTO_INSTALL_TOOLS: 'YES' - BUILDKIT_PROGRESS: plain - PRODUCT_REVISION: '' linux_arm64_package: docker: - image: docker.mirror.hashicorp.services/circleci/buildpack-deps shell: /usr/bin/env bash -euo pipefail -c environment: - AUTO_INSTALL_TOOLS: 'YES' - BUILDKIT_PROGRESS: plain - PRODUCT_REVISION: '' - PACKAGE_SPEC_ID: 52a4092a18c67dacc6e2132f451231d3c0ad5350 steps: - setup_remote_docker: docker_layer_caching: false 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: path: . - run: command: make -C packages*.lock write-package-cache-key name: Write package cache key - restore_cache: key: package-52a4092a18c67dacc6e2132f451231d3c0ad5350-{{checksum ".buildcache/cache-keys/package-52a4092a18c67dacc6e2132f451231d3c0ad5350"}} name: Restore package cache - run: command: |2 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 cache status - run: command: make -C packages*.lock write-builder-cache-keys name: Write builder layer cache keys - restore_cache: key: copy-source_4fbd_{{checksum ".buildcache/cache-keys/copy-source-4fbd883dbd1ea85319e94369ecd85de99f7ec129"}} keys: - warm-go-build-vendor-cache_2d2f_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-2d2f851f7fd3b3d15efa5eddfb198a2fc0fee7c2"}} - build-static-assets_c16c_{{checksum ".buildcache/cache-keys/build-static-assets-c16c92ba6efaac1d8ce78e253494d5990e673532"}} - build-ui_d410_{{checksum ".buildcache/cache-keys/build-ui-d4103be58748b6e071db728cbd54220aa1e4326e"}} - ui-dependencies_91f5_{{checksum ".buildcache/cache-keys/ui-dependencies-91f59cc67fec4697ade6f0c892970ba7bd23e0a8"}} - install-yarn_bbaf_{{checksum ".buildcache/cache-keys/install-yarn-bbaf7b58ff71fac3d054dba364ea5aa9169cf9f7"}} - set-workdir_f573_{{checksum ".buildcache/cache-keys/set-workdir-f57397d33d7a62ba66ebcc200ecf774e5b8bda25"}} - install-go-tools_93ff_{{checksum ".buildcache/cache-keys/install-go-tools-93ff4bda3b82e8d26d9ed37fb2b8843639dd4761"}} - install-go_8dde_{{checksum ".buildcache/cache-keys/install-go-8dde98d41082e5612aa95b0984d75c52c11c2802"}} - base_c6cd_{{checksum ".buildcache/cache-keys/base-c6cdf1b224722d2520e082320f2a71875913247c"}} name: 'Restore Builder Image Cache: copy-source' - 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: package-52a4092a18c67dacc6e2132f451231d3c0ad5350-{{checksum ".buildcache/cache-keys/package-52a4092a18c67dacc6e2132f451231d3c0ad5350"}} name: Save package cache paths: - .buildcache/packages/store test-ui: docker: - image: docker.mirror.hashicorp.services/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: docker.mirror.hashicorp.services/circleci/buildpack-deps shell: /usr/bin/env bash -euo pipefail -c environment: - AUTO_INSTALL_TOOLS: 'YES' - BUILDKIT_PROGRESS: plain - PRODUCT_REVISION: '' - PACKAGE_SPEC_ID: eb9624410547ae13b947829605b4a69f4e2355cf steps: - setup_remote_docker: docker_layer_caching: false 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: path: . - run: command: make -C packages*.lock write-package-cache-key name: Write package cache key - restore_cache: key: package-eb9624410547ae13b947829605b4a69f4e2355cf-{{checksum ".buildcache/cache-keys/package-eb9624410547ae13b947829605b4a69f4e2355cf"}} name: Restore package cache - run: command: |2 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 cache status - run: command: make -C packages*.lock write-builder-cache-keys name: Write builder layer cache keys - restore_cache: key: copy-source_4fbd_{{checksum ".buildcache/cache-keys/copy-source-4fbd883dbd1ea85319e94369ecd85de99f7ec129"}} keys: - warm-go-build-vendor-cache_2d2f_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-2d2f851f7fd3b3d15efa5eddfb198a2fc0fee7c2"}} - build-static-assets_c16c_{{checksum ".buildcache/cache-keys/build-static-assets-c16c92ba6efaac1d8ce78e253494d5990e673532"}} - build-ui_d410_{{checksum ".buildcache/cache-keys/build-ui-d4103be58748b6e071db728cbd54220aa1e4326e"}} - ui-dependencies_91f5_{{checksum ".buildcache/cache-keys/ui-dependencies-91f59cc67fec4697ade6f0c892970ba7bd23e0a8"}} - install-yarn_bbaf_{{checksum ".buildcache/cache-keys/install-yarn-bbaf7b58ff71fac3d054dba364ea5aa9169cf9f7"}} - set-workdir_f573_{{checksum ".buildcache/cache-keys/set-workdir-f57397d33d7a62ba66ebcc200ecf774e5b8bda25"}} - install-go-tools_93ff_{{checksum ".buildcache/cache-keys/install-go-tools-93ff4bda3b82e8d26d9ed37fb2b8843639dd4761"}} - install-go_8dde_{{checksum ".buildcache/cache-keys/install-go-8dde98d41082e5612aa95b0984d75c52c11c2802"}} - base_c6cd_{{checksum ".buildcache/cache-keys/base-c6cdf1b224722d2520e082320f2a71875913247c"}} name: 'Restore Builder Image Cache: copy-source' - 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: package-eb9624410547ae13b947829605b4a69f4e2355cf-{{checksum ".buildcache/cache-keys/package-eb9624410547ae13b947829605b4a69f4e2355cf"}} name: Save package cache paths: - .buildcache/packages/store test-ui-browserstack: docker: - image: docker.mirror.hashicorp.services/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: docker.mirror.hashicorp.services/circleci/buildpack-deps shell: /usr/bin/env bash -euo pipefail -c environment: - AUTO_INSTALL_TOOLS: 'YES' - BUILDKIT_PROGRESS: plain - PRODUCT_REVISION: '' - PACKAGE_SPEC_ID: 4d5c8238521df42de23b52310a3415cb695d4fb2 steps: - setup_remote_docker: docker_layer_caching: false 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: path: . - run: command: make -C packages*.lock write-package-cache-key name: Write package cache key - restore_cache: key: package-4d5c8238521df42de23b52310a3415cb695d4fb2-{{checksum ".buildcache/cache-keys/package-4d5c8238521df42de23b52310a3415cb695d4fb2"}} name: Restore package cache - run: command: |2 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 cache status - run: command: make -C packages*.lock write-builder-cache-keys name: Write builder layer cache keys - restore_cache: key: copy-source_4fbd_{{checksum ".buildcache/cache-keys/copy-source-4fbd883dbd1ea85319e94369ecd85de99f7ec129"}} keys: - warm-go-build-vendor-cache_2d2f_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-2d2f851f7fd3b3d15efa5eddfb198a2fc0fee7c2"}} - build-static-assets_c16c_{{checksum ".buildcache/cache-keys/build-static-assets-c16c92ba6efaac1d8ce78e253494d5990e673532"}} - build-ui_d410_{{checksum ".buildcache/cache-keys/build-ui-d4103be58748b6e071db728cbd54220aa1e4326e"}} - ui-dependencies_91f5_{{checksum ".buildcache/cache-keys/ui-dependencies-91f59cc67fec4697ade6f0c892970ba7bd23e0a8"}} - install-yarn_bbaf_{{checksum ".buildcache/cache-keys/install-yarn-bbaf7b58ff71fac3d054dba364ea5aa9169cf9f7"}} - set-workdir_f573_{{checksum ".buildcache/cache-keys/set-workdir-f57397d33d7a62ba66ebcc200ecf774e5b8bda25"}} - install-go-tools_93ff_{{checksum ".buildcache/cache-keys/install-go-tools-93ff4bda3b82e8d26d9ed37fb2b8843639dd4761"}} - install-go_8dde_{{checksum ".buildcache/cache-keys/install-go-8dde98d41082e5612aa95b0984d75c52c11c2802"}} - base_c6cd_{{checksum ".buildcache/cache-keys/base-c6cdf1b224722d2520e082320f2a71875913247c"}} name: 'Restore Builder Image Cache: copy-source' - 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: package-4d5c8238521df42de23b52310a3415cb695d4fb2-{{checksum ".buildcache/cache-keys/package-4d5c8238521df42de23b52310a3415cb695d4fb2"}} name: Save package cache paths: - .buildcache/packages/store 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.15.3 - 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: docker.mirror.hashicorp.services/circleci/buildpack-deps shell: /usr/bin/env bash -euo pipefail -c environment: - AUTO_INSTALL_TOOLS: 'YES' - BUILDKIT_PROGRESS: plain - PRODUCT_REVISION: '' - PACKAGE_SPEC_ID: 48ce5c746842cfb9ae9dcad50fa1bab08b863d62 steps: - setup_remote_docker: docker_layer_caching: false 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: path: . - run: command: make -C packages*.lock write-package-cache-key name: Write package cache key - restore_cache: key: package-48ce5c746842cfb9ae9dcad50fa1bab08b863d62-{{checksum ".buildcache/cache-keys/package-48ce5c746842cfb9ae9dcad50fa1bab08b863d62"}} name: Restore package cache - run: command: |2 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 cache status - run: command: make -C packages*.lock write-builder-cache-keys name: Write builder layer cache keys - restore_cache: key: copy-source_4fbd_{{checksum ".buildcache/cache-keys/copy-source-4fbd883dbd1ea85319e94369ecd85de99f7ec129"}} keys: - warm-go-build-vendor-cache_2d2f_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-2d2f851f7fd3b3d15efa5eddfb198a2fc0fee7c2"}} - build-static-assets_c16c_{{checksum ".buildcache/cache-keys/build-static-assets-c16c92ba6efaac1d8ce78e253494d5990e673532"}} - build-ui_d410_{{checksum ".buildcache/cache-keys/build-ui-d4103be58748b6e071db728cbd54220aa1e4326e"}} - ui-dependencies_91f5_{{checksum ".buildcache/cache-keys/ui-dependencies-91f59cc67fec4697ade6f0c892970ba7bd23e0a8"}} - install-yarn_bbaf_{{checksum ".buildcache/cache-keys/install-yarn-bbaf7b58ff71fac3d054dba364ea5aa9169cf9f7"}} - set-workdir_f573_{{checksum ".buildcache/cache-keys/set-workdir-f57397d33d7a62ba66ebcc200ecf774e5b8bda25"}} - install-go-tools_93ff_{{checksum ".buildcache/cache-keys/install-go-tools-93ff4bda3b82e8d26d9ed37fb2b8843639dd4761"}} - install-go_8dde_{{checksum ".buildcache/cache-keys/install-go-8dde98d41082e5612aa95b0984d75c52c11c2802"}} - base_c6cd_{{checksum ".buildcache/cache-keys/base-c6cdf1b224722d2520e082320f2a71875913247c"}} name: 'Restore Builder Image Cache: copy-source' - 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: package-48ce5c746842cfb9ae9dcad50fa1bab08b863d62-{{checksum ".buildcache/cache-keys/package-48ce5c746842cfb9ae9dcad50fa1bab08b863d62"}} name: Save package cache paths: - .buildcache/packages/store test-go-remote-docker: docker: - image: docker.mirror.hashicorp.services/circleci/golang:1.15.3-buster 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: docker.mirror.hashicorp.services/circleci/buildpack-deps shell: /usr/bin/env bash -euo pipefail -c environment: - AUTO_INSTALL_TOOLS: 'YES' - BUILDKIT_PROGRESS: plain - PRODUCT_REVISION: '' - PACKAGE_SPEC_ID: 3c4c0cb1790bac5865da0757a8c3c87ac65eb5a6 steps: - setup_remote_docker: docker_layer_caching: false 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: path: . - run: command: make -C packages*.lock write-package-cache-key name: Write package cache key - restore_cache: key: package-3c4c0cb1790bac5865da0757a8c3c87ac65eb5a6-{{checksum ".buildcache/cache-keys/package-3c4c0cb1790bac5865da0757a8c3c87ac65eb5a6"}} name: Restore package cache - run: command: |2 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 cache status - run: command: make -C packages*.lock write-builder-cache-keys name: Write builder layer cache keys - restore_cache: key: copy-source_4fbd_{{checksum ".buildcache/cache-keys/copy-source-4fbd883dbd1ea85319e94369ecd85de99f7ec129"}} keys: - warm-go-build-vendor-cache_2d2f_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-2d2f851f7fd3b3d15efa5eddfb198a2fc0fee7c2"}} - build-static-assets_c16c_{{checksum ".buildcache/cache-keys/build-static-assets-c16c92ba6efaac1d8ce78e253494d5990e673532"}} - build-ui_d410_{{checksum ".buildcache/cache-keys/build-ui-d4103be58748b6e071db728cbd54220aa1e4326e"}} - ui-dependencies_91f5_{{checksum ".buildcache/cache-keys/ui-dependencies-91f59cc67fec4697ade6f0c892970ba7bd23e0a8"}} - install-yarn_bbaf_{{checksum ".buildcache/cache-keys/install-yarn-bbaf7b58ff71fac3d054dba364ea5aa9169cf9f7"}} - set-workdir_f573_{{checksum ".buildcache/cache-keys/set-workdir-f57397d33d7a62ba66ebcc200ecf774e5b8bda25"}} - install-go-tools_93ff_{{checksum ".buildcache/cache-keys/install-go-tools-93ff4bda3b82e8d26d9ed37fb2b8843639dd4761"}} - install-go_8dde_{{checksum ".buildcache/cache-keys/install-go-8dde98d41082e5612aa95b0984d75c52c11c2802"}} - base_c6cd_{{checksum ".buildcache/cache-keys/base-c6cdf1b224722d2520e082320f2a71875913247c"}} name: 'Restore Builder Image Cache: copy-source' - 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: package-3c4c0cb1790bac5865da0757a8c3c87ac65eb5a6-{{checksum ".buildcache/cache-keys/package-3c4c0cb1790bac5865da0757a8c3c87ac65eb5a6"}} name: Save package cache paths: - .buildcache/packages/store test-go-race: docker: - image: docker.mirror.hashicorp.services/circleci/golang:1.15.3-buster 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: docker.mirror.hashicorp.services/circleci/buildpack-deps shell: /usr/bin/env bash -euo pipefail -c environment: - AUTO_INSTALL_TOOLS: 'YES' - BUILDKIT_PROGRESS: plain - PRODUCT_REVISION: '' - PACKAGE_SPEC_ID: bf03c8c1695d649ed9d6cb3f1f8bb250b81c38c3 steps: - setup_remote_docker: docker_layer_caching: false 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: path: . - run: command: make -C packages*.lock write-package-cache-key name: Write package cache key - restore_cache: key: package-bf03c8c1695d649ed9d6cb3f1f8bb250b81c38c3-{{checksum ".buildcache/cache-keys/package-bf03c8c1695d649ed9d6cb3f1f8bb250b81c38c3"}} name: Restore package cache - run: command: |2 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 cache status - run: command: make -C packages*.lock write-builder-cache-keys name: Write builder layer cache keys - restore_cache: key: copy-source_4fbd_{{checksum ".buildcache/cache-keys/copy-source-4fbd883dbd1ea85319e94369ecd85de99f7ec129"}} keys: - warm-go-build-vendor-cache_2d2f_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-2d2f851f7fd3b3d15efa5eddfb198a2fc0fee7c2"}} - build-static-assets_c16c_{{checksum ".buildcache/cache-keys/build-static-assets-c16c92ba6efaac1d8ce78e253494d5990e673532"}} - build-ui_d410_{{checksum ".buildcache/cache-keys/build-ui-d4103be58748b6e071db728cbd54220aa1e4326e"}} - ui-dependencies_91f5_{{checksum ".buildcache/cache-keys/ui-dependencies-91f59cc67fec4697ade6f0c892970ba7bd23e0a8"}} - install-yarn_bbaf_{{checksum ".buildcache/cache-keys/install-yarn-bbaf7b58ff71fac3d054dba364ea5aa9169cf9f7"}} - set-workdir_f573_{{checksum ".buildcache/cache-keys/set-workdir-f57397d33d7a62ba66ebcc200ecf774e5b8bda25"}} - install-go-tools_93ff_{{checksum ".buildcache/cache-keys/install-go-tools-93ff4bda3b82e8d26d9ed37fb2b8843639dd4761"}} - install-go_8dde_{{checksum ".buildcache/cache-keys/install-go-8dde98d41082e5612aa95b0984d75c52c11c2802"}} - base_c6cd_{{checksum ".buildcache/cache-keys/base-c6cdf1b224722d2520e082320f2a71875913247c"}} name: 'Restore Builder Image Cache: copy-source' - 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: package-bf03c8c1695d649ed9d6cb3f1f8bb250b81c38c3-{{checksum ".buildcache/cache-keys/package-bf03c8c1695d649ed9d6cb3f1f8bb250b81c38c3"}} name: Save package cache paths: - .buildcache/packages/store openbsd_386_package: docker: - image: docker.mirror.hashicorp.services/circleci/buildpack-deps shell: /usr/bin/env bash -euo pipefail -c environment: - AUTO_INSTALL_TOOLS: 'YES' - BUILDKIT_PROGRESS: plain - PRODUCT_REVISION: '' - PACKAGE_SPEC_ID: 288879a49947b0156f67341dfa2e52d65d4d63fe steps: - setup_remote_docker: docker_layer_caching: false 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: path: . - run: command: make -C packages*.lock write-package-cache-key name: Write package cache key - restore_cache: key: package-288879a49947b0156f67341dfa2e52d65d4d63fe-{{checksum ".buildcache/cache-keys/package-288879a49947b0156f67341dfa2e52d65d4d63fe"}} name: Restore package cache - run: command: |2 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 cache status - run: command: make -C packages*.lock write-builder-cache-keys name: Write builder layer cache keys - restore_cache: key: copy-source_4fbd_{{checksum ".buildcache/cache-keys/copy-source-4fbd883dbd1ea85319e94369ecd85de99f7ec129"}} keys: - warm-go-build-vendor-cache_2d2f_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-2d2f851f7fd3b3d15efa5eddfb198a2fc0fee7c2"}} - build-static-assets_c16c_{{checksum ".buildcache/cache-keys/build-static-assets-c16c92ba6efaac1d8ce78e253494d5990e673532"}} - build-ui_d410_{{checksum ".buildcache/cache-keys/build-ui-d4103be58748b6e071db728cbd54220aa1e4326e"}} - ui-dependencies_91f5_{{checksum ".buildcache/cache-keys/ui-dependencies-91f59cc67fec4697ade6f0c892970ba7bd23e0a8"}} - install-yarn_bbaf_{{checksum ".buildcache/cache-keys/install-yarn-bbaf7b58ff71fac3d054dba364ea5aa9169cf9f7"}} - set-workdir_f573_{{checksum ".buildcache/cache-keys/set-workdir-f57397d33d7a62ba66ebcc200ecf774e5b8bda25"}} - install-go-tools_93ff_{{checksum ".buildcache/cache-keys/install-go-tools-93ff4bda3b82e8d26d9ed37fb2b8843639dd4761"}} - install-go_8dde_{{checksum ".buildcache/cache-keys/install-go-8dde98d41082e5612aa95b0984d75c52c11c2802"}} - base_c6cd_{{checksum ".buildcache/cache-keys/base-c6cdf1b224722d2520e082320f2a71875913247c"}} name: 'Restore Builder Image Cache: copy-source' - 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: package-288879a49947b0156f67341dfa2e52d65d4d63fe-{{checksum ".buildcache/cache-keys/package-288879a49947b0156f67341dfa2e52d65d4d63fe"}} name: Save package cache paths: - .buildcache/packages/store linux_amd64_package: docker: - image: docker.mirror.hashicorp.services/circleci/buildpack-deps shell: /usr/bin/env bash -euo pipefail -c environment: - AUTO_INSTALL_TOOLS: 'YES' - BUILDKIT_PROGRESS: plain - PRODUCT_REVISION: '' - PACKAGE_SPEC_ID: e1dbfb4cbd89fa9b6009bffa7733c6e22cebb88e steps: - setup_remote_docker: docker_layer_caching: false 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: path: . - run: command: make -C packages*.lock write-package-cache-key name: Write package cache key - restore_cache: key: package-e1dbfb4cbd89fa9b6009bffa7733c6e22cebb88e-{{checksum ".buildcache/cache-keys/package-e1dbfb4cbd89fa9b6009bffa7733c6e22cebb88e"}} name: Restore package cache - run: command: |2 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 cache status - run: command: make -C packages*.lock write-builder-cache-keys name: Write builder layer cache keys - restore_cache: key: copy-source_4fbd_{{checksum ".buildcache/cache-keys/copy-source-4fbd883dbd1ea85319e94369ecd85de99f7ec129"}} keys: - warm-go-build-vendor-cache_2d2f_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-2d2f851f7fd3b3d15efa5eddfb198a2fc0fee7c2"}} - build-static-assets_c16c_{{checksum ".buildcache/cache-keys/build-static-assets-c16c92ba6efaac1d8ce78e253494d5990e673532"}} - build-ui_d410_{{checksum ".buildcache/cache-keys/build-ui-d4103be58748b6e071db728cbd54220aa1e4326e"}} - ui-dependencies_91f5_{{checksum ".buildcache/cache-keys/ui-dependencies-91f59cc67fec4697ade6f0c892970ba7bd23e0a8"}} - install-yarn_bbaf_{{checksum ".buildcache/cache-keys/install-yarn-bbaf7b58ff71fac3d054dba364ea5aa9169cf9f7"}} - set-workdir_f573_{{checksum ".buildcache/cache-keys/set-workdir-f57397d33d7a62ba66ebcc200ecf774e5b8bda25"}} - install-go-tools_93ff_{{checksum ".buildcache/cache-keys/install-go-tools-93ff4bda3b82e8d26d9ed37fb2b8843639dd4761"}} - install-go_8dde_{{checksum ".buildcache/cache-keys/install-go-8dde98d41082e5612aa95b0984d75c52c11c2802"}} - base_c6cd_{{checksum ".buildcache/cache-keys/base-c6cdf1b224722d2520e082320f2a71875913247c"}} name: 'Restore Builder Image Cache: copy-source' - 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: package-e1dbfb4cbd89fa9b6009bffa7733c6e22cebb88e-{{checksum ".buildcache/cache-keys/package-e1dbfb4cbd89fa9b6009bffa7733c6e22cebb88e"}} name: Save package cache paths: - .buildcache/packages/store 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: docker.mirror.hashicorp.services/circleci/buildpack-deps shell: /usr/bin/env bash -euo pipefail -c environment: - AUTO_INSTALL_TOOLS: 'YES' - BUILDKIT_PROGRESS: plain - PRODUCT_REVISION: '' - PACKAGE_SPEC_ID: 9e98262d3fcde7a4f5343f7fe25e21756ded9a77 steps: - setup_remote_docker: docker_layer_caching: false 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: path: . - run: command: make -C packages*.lock write-package-cache-key name: Write package cache key - restore_cache: key: package-9e98262d3fcde7a4f5343f7fe25e21756ded9a77-{{checksum ".buildcache/cache-keys/package-9e98262d3fcde7a4f5343f7fe25e21756ded9a77"}} name: Restore package cache - run: command: |2 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 cache status - run: command: make -C packages*.lock write-builder-cache-keys name: Write builder layer cache keys - restore_cache: key: copy-source_4fbd_{{checksum ".buildcache/cache-keys/copy-source-4fbd883dbd1ea85319e94369ecd85de99f7ec129"}} keys: - warm-go-build-vendor-cache_2d2f_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-2d2f851f7fd3b3d15efa5eddfb198a2fc0fee7c2"}} - build-static-assets_c16c_{{checksum ".buildcache/cache-keys/build-static-assets-c16c92ba6efaac1d8ce78e253494d5990e673532"}} - build-ui_d410_{{checksum ".buildcache/cache-keys/build-ui-d4103be58748b6e071db728cbd54220aa1e4326e"}} - ui-dependencies_91f5_{{checksum ".buildcache/cache-keys/ui-dependencies-91f59cc67fec4697ade6f0c892970ba7bd23e0a8"}} - install-yarn_bbaf_{{checksum ".buildcache/cache-keys/install-yarn-bbaf7b58ff71fac3d054dba364ea5aa9169cf9f7"}} - set-workdir_f573_{{checksum ".buildcache/cache-keys/set-workdir-f57397d33d7a62ba66ebcc200ecf774e5b8bda25"}} - install-go-tools_93ff_{{checksum ".buildcache/cache-keys/install-go-tools-93ff4bda3b82e8d26d9ed37fb2b8843639dd4761"}} - install-go_8dde_{{checksum ".buildcache/cache-keys/install-go-8dde98d41082e5612aa95b0984d75c52c11c2802"}} - base_c6cd_{{checksum ".buildcache/cache-keys/base-c6cdf1b224722d2520e082320f2a71875913247c"}} name: 'Restore Builder Image Cache: copy-source' - 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: package-9e98262d3fcde7a4f5343f7fe25e21756ded9a77-{{checksum ".buildcache/cache-keys/package-9e98262d3fcde7a4f5343f7fe25e21756ded9a77"}} name: Save package cache paths: - .buildcache/packages/store test-go: docker: - image: docker.mirror.hashicorp.services/circleci/golang:1.15.3-buster 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.15.3 - GO111MODULE: 'off' - GOTESTSUM_VERSION: 0.5.2 netbsd_amd64_package: docker: - image: docker.mirror.hashicorp.services/circleci/buildpack-deps shell: /usr/bin/env bash -euo pipefail -c environment: - AUTO_INSTALL_TOOLS: 'YES' - BUILDKIT_PROGRESS: plain - PRODUCT_REVISION: '' - PACKAGE_SPEC_ID: 45fa55a76efbe60e12a7e950e86b5a8b9101f0a5 steps: - setup_remote_docker: docker_layer_caching: false 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: path: . - run: command: make -C packages*.lock write-package-cache-key name: Write package cache key - restore_cache: key: package-45fa55a76efbe60e12a7e950e86b5a8b9101f0a5-{{checksum ".buildcache/cache-keys/package-45fa55a76efbe60e12a7e950e86b5a8b9101f0a5"}} name: Restore package cache - run: command: |2 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 cache status - run: command: make -C packages*.lock write-builder-cache-keys name: Write builder layer cache keys - restore_cache: key: copy-source_4fbd_{{checksum ".buildcache/cache-keys/copy-source-4fbd883dbd1ea85319e94369ecd85de99f7ec129"}} keys: - warm-go-build-vendor-cache_2d2f_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-2d2f851f7fd3b3d15efa5eddfb198a2fc0fee7c2"}} - build-static-assets_c16c_{{checksum ".buildcache/cache-keys/build-static-assets-c16c92ba6efaac1d8ce78e253494d5990e673532"}} - build-ui_d410_{{checksum ".buildcache/cache-keys/build-ui-d4103be58748b6e071db728cbd54220aa1e4326e"}} - ui-dependencies_91f5_{{checksum ".buildcache/cache-keys/ui-dependencies-91f59cc67fec4697ade6f0c892970ba7bd23e0a8"}} - install-yarn_bbaf_{{checksum ".buildcache/cache-keys/install-yarn-bbaf7b58ff71fac3d054dba364ea5aa9169cf9f7"}} - set-workdir_f573_{{checksum ".buildcache/cache-keys/set-workdir-f57397d33d7a62ba66ebcc200ecf774e5b8bda25"}} - install-go-tools_93ff_{{checksum ".buildcache/cache-keys/install-go-tools-93ff4bda3b82e8d26d9ed37fb2b8843639dd4761"}} - install-go_8dde_{{checksum ".buildcache/cache-keys/install-go-8dde98d41082e5612aa95b0984d75c52c11c2802"}} - base_c6cd_{{checksum ".buildcache/cache-keys/base-c6cdf1b224722d2520e082320f2a71875913247c"}} name: 'Restore Builder Image Cache: copy-source' - 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: package-45fa55a76efbe60e12a7e950e86b5a8b9101f0a5-{{checksum ".buildcache/cache-keys/package-45fa55a76efbe60e12a7e950e86b5a8b9101f0a5"}} name: Save package cache paths: - .buildcache/packages/store openbsd_amd64_package: docker: - image: docker.mirror.hashicorp.services/circleci/buildpack-deps shell: /usr/bin/env bash -euo pipefail -c environment: - AUTO_INSTALL_TOOLS: 'YES' - BUILDKIT_PROGRESS: plain - PRODUCT_REVISION: '' - PACKAGE_SPEC_ID: a7d37f46fa8a266d4fcc5e257d939c457d2c1c26 steps: - setup_remote_docker: docker_layer_caching: false 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: path: . - run: command: make -C packages*.lock write-package-cache-key name: Write package cache key - restore_cache: key: package-a7d37f46fa8a266d4fcc5e257d939c457d2c1c26-{{checksum ".buildcache/cache-keys/package-a7d37f46fa8a266d4fcc5e257d939c457d2c1c26"}} name: Restore package cache - run: command: |2 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 cache status - run: command: make -C packages*.lock write-builder-cache-keys name: Write builder layer cache keys - restore_cache: key: copy-source_4fbd_{{checksum ".buildcache/cache-keys/copy-source-4fbd883dbd1ea85319e94369ecd85de99f7ec129"}} keys: - warm-go-build-vendor-cache_2d2f_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-2d2f851f7fd3b3d15efa5eddfb198a2fc0fee7c2"}} - build-static-assets_c16c_{{checksum ".buildcache/cache-keys/build-static-assets-c16c92ba6efaac1d8ce78e253494d5990e673532"}} - build-ui_d410_{{checksum ".buildcache/cache-keys/build-ui-d4103be58748b6e071db728cbd54220aa1e4326e"}} - ui-dependencies_91f5_{{checksum ".buildcache/cache-keys/ui-dependencies-91f59cc67fec4697ade6f0c892970ba7bd23e0a8"}} - install-yarn_bbaf_{{checksum ".buildcache/cache-keys/install-yarn-bbaf7b58ff71fac3d054dba364ea5aa9169cf9f7"}} - set-workdir_f573_{{checksum ".buildcache/cache-keys/set-workdir-f57397d33d7a62ba66ebcc200ecf774e5b8bda25"}} - install-go-tools_93ff_{{checksum ".buildcache/cache-keys/install-go-tools-93ff4bda3b82e8d26d9ed37fb2b8843639dd4761"}} - install-go_8dde_{{checksum ".buildcache/cache-keys/install-go-8dde98d41082e5612aa95b0984d75c52c11c2802"}} - base_c6cd_{{checksum ".buildcache/cache-keys/base-c6cdf1b224722d2520e082320f2a71875913247c"}} name: 'Restore Builder Image Cache: copy-source' - 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: package-a7d37f46fa8a266d4fcc5e257d939c457d2c1c26-{{checksum ".buildcache/cache-keys/package-a7d37f46fa8a266d4fcc5e257d939c457d2c1c26"}} name: Save package cache paths: - .buildcache/packages/store netbsd_386_package: docker: - image: docker.mirror.hashicorp.services/circleci/buildpack-deps shell: /usr/bin/env bash -euo pipefail -c environment: - AUTO_INSTALL_TOOLS: 'YES' - BUILDKIT_PROGRESS: plain - PRODUCT_REVISION: '' - PACKAGE_SPEC_ID: 5eda110323a6276136c3a32f79d69463852f91d7 steps: - setup_remote_docker: docker_layer_caching: false 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: path: . - run: command: make -C packages*.lock write-package-cache-key name: Write package cache key - restore_cache: key: package-5eda110323a6276136c3a32f79d69463852f91d7-{{checksum ".buildcache/cache-keys/package-5eda110323a6276136c3a32f79d69463852f91d7"}} name: Restore package cache - run: command: |2 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 cache status - run: command: make -C packages*.lock write-builder-cache-keys name: Write builder layer cache keys - restore_cache: key: copy-source_4fbd_{{checksum ".buildcache/cache-keys/copy-source-4fbd883dbd1ea85319e94369ecd85de99f7ec129"}} keys: - warm-go-build-vendor-cache_2d2f_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-2d2f851f7fd3b3d15efa5eddfb198a2fc0fee7c2"}} - build-static-assets_c16c_{{checksum ".buildcache/cache-keys/build-static-assets-c16c92ba6efaac1d8ce78e253494d5990e673532"}} - build-ui_d410_{{checksum ".buildcache/cache-keys/build-ui-d4103be58748b6e071db728cbd54220aa1e4326e"}} - ui-dependencies_91f5_{{checksum ".buildcache/cache-keys/ui-dependencies-91f59cc67fec4697ade6f0c892970ba7bd23e0a8"}} - install-yarn_bbaf_{{checksum ".buildcache/cache-keys/install-yarn-bbaf7b58ff71fac3d054dba364ea5aa9169cf9f7"}} - set-workdir_f573_{{checksum ".buildcache/cache-keys/set-workdir-f57397d33d7a62ba66ebcc200ecf774e5b8bda25"}} - install-go-tools_93ff_{{checksum ".buildcache/cache-keys/install-go-tools-93ff4bda3b82e8d26d9ed37fb2b8843639dd4761"}} - install-go_8dde_{{checksum ".buildcache/cache-keys/install-go-8dde98d41082e5612aa95b0984d75c52c11c2802"}} - base_c6cd_{{checksum ".buildcache/cache-keys/base-c6cdf1b224722d2520e082320f2a71875913247c"}} name: 'Restore Builder Image Cache: copy-source' - 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: package-5eda110323a6276136c3a32f79d69463852f91d7-{{checksum ".buildcache/cache-keys/package-5eda110323a6276136c3a32f79d69463852f91d7"}} name: Save package cache paths: - .buildcache/packages/store freebsd_arm_package: docker: - image: docker.mirror.hashicorp.services/circleci/buildpack-deps shell: /usr/bin/env bash -euo pipefail -c environment: - AUTO_INSTALL_TOOLS: 'YES' - BUILDKIT_PROGRESS: plain - PRODUCT_REVISION: '' - PACKAGE_SPEC_ID: 4ee502a4b97ff101017ea1960bd6227412c377fd steps: - setup_remote_docker: docker_layer_caching: false 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: path: . - run: command: make -C packages*.lock write-package-cache-key name: Write package cache key - restore_cache: key: package-4ee502a4b97ff101017ea1960bd6227412c377fd-{{checksum ".buildcache/cache-keys/package-4ee502a4b97ff101017ea1960bd6227412c377fd"}} name: Restore package cache - run: command: |2 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 cache status - run: command: make -C packages*.lock write-builder-cache-keys name: Write builder layer cache keys - restore_cache: key: copy-source_4fbd_{{checksum ".buildcache/cache-keys/copy-source-4fbd883dbd1ea85319e94369ecd85de99f7ec129"}} keys: - warm-go-build-vendor-cache_2d2f_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-2d2f851f7fd3b3d15efa5eddfb198a2fc0fee7c2"}} - build-static-assets_c16c_{{checksum ".buildcache/cache-keys/build-static-assets-c16c92ba6efaac1d8ce78e253494d5990e673532"}} - build-ui_d410_{{checksum ".buildcache/cache-keys/build-ui-d4103be58748b6e071db728cbd54220aa1e4326e"}} - ui-dependencies_91f5_{{checksum ".buildcache/cache-keys/ui-dependencies-91f59cc67fec4697ade6f0c892970ba7bd23e0a8"}} - install-yarn_bbaf_{{checksum ".buildcache/cache-keys/install-yarn-bbaf7b58ff71fac3d054dba364ea5aa9169cf9f7"}} - set-workdir_f573_{{checksum ".buildcache/cache-keys/set-workdir-f57397d33d7a62ba66ebcc200ecf774e5b8bda25"}} - install-go-tools_93ff_{{checksum ".buildcache/cache-keys/install-go-tools-93ff4bda3b82e8d26d9ed37fb2b8843639dd4761"}} - install-go_8dde_{{checksum ".buildcache/cache-keys/install-go-8dde98d41082e5612aa95b0984d75c52c11c2802"}} - base_c6cd_{{checksum ".buildcache/cache-keys/base-c6cdf1b224722d2520e082320f2a71875913247c"}} name: 'Restore Builder Image Cache: copy-source' - 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: package-4ee502a4b97ff101017ea1960bd6227412c377fd-{{checksum ".buildcache/cache-keys/package-4ee502a4b97ff101017ea1960bd6227412c377fd"}} name: Save package cache paths: - .buildcache/packages/store windows_amd64_package: docker: - image: docker.mirror.hashicorp.services/circleci/buildpack-deps shell: /usr/bin/env bash -euo pipefail -c environment: - AUTO_INSTALL_TOOLS: 'YES' - BUILDKIT_PROGRESS: plain - PRODUCT_REVISION: '' - PACKAGE_SPEC_ID: ad5e8d34df02b5ad2dd18d56208d1806c3f2a721 steps: - setup_remote_docker: docker_layer_caching: false 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: path: . - run: command: make -C packages*.lock write-package-cache-key name: Write package cache key - restore_cache: key: package-ad5e8d34df02b5ad2dd18d56208d1806c3f2a721-{{checksum ".buildcache/cache-keys/package-ad5e8d34df02b5ad2dd18d56208d1806c3f2a721"}} name: Restore package cache - run: command: |2 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 cache status - run: command: make -C packages*.lock write-builder-cache-keys name: Write builder layer cache keys - restore_cache: key: copy-source_4fbd_{{checksum ".buildcache/cache-keys/copy-source-4fbd883dbd1ea85319e94369ecd85de99f7ec129"}} keys: - warm-go-build-vendor-cache_2d2f_{{checksum ".buildcache/cache-keys/warm-go-build-vendor-cache-2d2f851f7fd3b3d15efa5eddfb198a2fc0fee7c2"}} - build-static-assets_c16c_{{checksum ".buildcache/cache-keys/build-static-assets-c16c92ba6efaac1d8ce78e253494d5990e673532"}} - build-ui_d410_{{checksum ".buildcache/cache-keys/build-ui-d4103be58748b6e071db728cbd54220aa1e4326e"}} - ui-dependencies_91f5_{{checksum ".buildcache/cache-keys/ui-dependencies-91f59cc67fec4697ade6f0c892970ba7bd23e0a8"}} - install-yarn_bbaf_{{checksum ".buildcache/cache-keys/install-yarn-bbaf7b58ff71fac3d054dba364ea5aa9169cf9f7"}} - set-workdir_f573_{{checksum ".buildcache/cache-keys/set-workdir-f57397d33d7a62ba66ebcc200ecf774e5b8bda25"}} - install-go-tools_93ff_{{checksum ".buildcache/cache-keys/install-go-tools-93ff4bda3b82e8d26d9ed37fb2b8843639dd4761"}} - install-go_8dde_{{checksum ".buildcache/cache-keys/install-go-8dde98d41082e5612aa95b0984d75c52c11c2802"}} - base_c6cd_{{checksum ".buildcache/cache-keys/base-c6cdf1b224722d2520e082320f2a71875913247c"}} name: 'Restore Builder Image Cache: copy-source' - 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: package-ad5e8d34df02b5ad2dd18d56208d1806c3f2a721-{{checksum ".buildcache/cache-keys/package-ad5e8d34df02b5ad2dd18d56208d1806c3f2a721"}} name: Save package cache paths: - .buildcache/packages/store 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: docker.mirror.hashicorp.services/circleci/golang:1.15.3-buster 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-d4738432dabd028a: jobs: - build-common-layers - darwin_386_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 - 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 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