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