Skip to content

Commit

Permalink
backport of commit 60959fe
Browse files Browse the repository at this point in the history
  • Loading branch information
hellobontempo committed Aug 26, 2022
1 parent ce0cab5 commit 0d999a0
Show file tree
Hide file tree
Showing 3,235 changed files with 83,792 additions and 164,548 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
232 changes: 128 additions & 104 deletions .circleci/config.yml

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions .circleci/config/commands/go_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ parameters:
default: false
go_image:
type: string
default: "docker.mirror.hashicorp.services/cimg/go:1.18.5"
default: "docker.mirror.hashicorp.services/cimg/go:1.17.13"
use_docker:
type: boolean
default: false
Expand All @@ -38,7 +38,7 @@ steps:
environment:
GOPRIVATE: 'github.com/hashicorp/*'
command: |
set -exo pipefail
set -x
EXTRA_TAGS=
case "<< parameters.extra_flags >>" in
Expand All @@ -65,21 +65,21 @@ steps:
for dir in "${modules[@]}"
do
pushd "$dir"
# On its own line so that -e will fail the tests if we detect errors here.
go list -test -json ./... > test-list.json
# 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.
# The appended true condition ensures the command will succeed if no packages are found
if [ $USE_DOCKER == 1 ]; then
package_names=$(< test-list.json jq -r 'select(.Deps != null) |
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 | grep -v vault/integ | circleci tests split --split-by=timings --timings-type=classname || true)
sort -u | grep -v vault/integ | circleci tests split --split-by=timings --timings-type=classname) || true
else
package_names=$(< test-list.json jq -r 'select(.Deps != null) |
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 | grep -v vault/integ | circleci tests split --split-by=timings --timings-type=classname || true)
sort -u | grep -v vault/integ | circleci tests split --split-by=timings --timings-type=classname) || true
fi
# Move back into root directory
popd
Expand Down
28 changes: 12 additions & 16 deletions .circleci/config/executors/@executors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,51 +3,47 @@ go-machine:
image: ubuntu-2004:202201-02
shell: /usr/bin/env bash -euo pipefail -c
environment:
CIRCLECI_CLI_VERSION: 0.1.5546 # Pin CircleCI CLI to patch version (ex: 1.2.3)
GO_VERSION: 1.18.5 # Pin Go to patch version (ex: 1.2.3)
GOTESTSUM_VERSION: 0.5.2 # Pin gotestsum to patch version (ex: 1.2.3)
GOFUMPT_VERSION: 0.2.1 # Pin gofumpt to patch version (ex: 1.2.3)
CIRCLECI_CLI_VERSION: 0.1.5546 # Pin CircleCI CLI to patch version (ex: 1.2.3)
GO_VERSION: 1.17.13 # Pin Go to patch version (ex: 1.2.3)
GOTESTSUM_VERSION: 0.5.2 # Pin gotestsum to patch version (ex: 1.2.3)
GO_TAGS: ""
working_directory: /home/circleci/go/src/github.com/hashicorp/vault
node:
docker:
- image: docker.mirror.hashicorp.services/circleci/node:14-browsers
environment:
# See https://git.io/vdao3 for details.
JOBS: 2
- image: docker.mirror.hashicorp.services/node:14-buster
shell: /usr/bin/env bash -euo pipefail -c
working_directory: /home/circleci/go/src/github.com/hashicorp/vault
python:
docker:
- image: docker.mirror.hashicorp.services/python:3-alpine
shell: /usr/bin/env bash -euo pipefail -c
working_directory: /home/circleci/go/src/github.com/hashicorp/vault
semgrep:
alpine:
docker:
- image: docker.mirror.hashicorp.services/returntocorp/semgrep:0.106.0
- image: docker.mirror.hashicorp.services/alpine:3.13
shell: /bin/sh
working_directory: /home/circleci/go/src/github.com/hashicorp/vault
docker-env-go-test-remote-docker:
resource_class: medium
docker:
- image: "docker.mirror.hashicorp.services/cimg/go:1.18.5"
- image: "docker.mirror.hashicorp.services/cimg/go:1.17.13"
environment:
CIRCLECI_CLI_VERSION: 0.1.5546 # Pin CircleCI CLI to patch version (ex: 1.2.3)
CIRCLECI_CLI_VERSION: 0.1.5546 # Pin CircleCI CLI to patch version (ex: 1.2.3)
GO_TAGS: ""
working_directory: /home/circleci/go/src/github.com/hashicorp/vault
docker-env-go-test:
resource_class: large
docker:
- image: "docker.mirror.hashicorp.services/cimg/go:1.18.5"
- image: "docker.mirror.hashicorp.services/cimg/go:1.17.13"
environment:
CIRCLECI_CLI_VERSION: 0.1.5546 # Pin CircleCI CLI to patch version (ex: 1.2.3)
CIRCLECI_CLI_VERSION: 0.1.5546 # Pin CircleCI CLI to patch version (ex: 1.2.3)
GO_TAGS: ""
working_directory: /home/circleci/go/src/github.com/hashicorp/vault
docker-env-go-test-race:
resource_class: xlarge
docker:
- image: "docker.mirror.hashicorp.services/cimg/go:1.18.5"
- image: "docker.mirror.hashicorp.services/cimg/go:1.17.13"
environment:
CIRCLECI_CLI_VERSION: 0.1.5546 # Pin CircleCI CLI to patch version (ex: 1.2.3)
CIRCLECI_CLI_VERSION: 0.1.5546 # Pin CircleCI CLI to patch version (ex: 1.2.3)
GO_TAGS: ""
working_directory: /home/circleci/go/src/github.com/hashicorp/vault
14 changes: 14 additions & 0 deletions .circleci/config/jobs/algolia-index.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
docker:
- image: node:12
steps:
- checkout
- run:
name: Push content to Algolia Index
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
16 changes: 0 additions & 16 deletions .circleci/config/jobs/fmt.yml

This file was deleted.

13 changes: 0 additions & 13 deletions .circleci/config/jobs/semgrep.yml

This file was deleted.

13 changes: 13 additions & 0 deletions .circleci/config/jobs/test-ui-browserstack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
executor: node
resource_class: xlarge
steps:
- checkout
- restore_yarn_cache
- attach_workspace:
at: .
- run:
name: Run Browserstack Tests
command: |
# Add ./bin to the PATH so vault binary can be found.
export PATH="${PWD}"/bin:${PATH}
make test-ui-browserstack
12 changes: 12 additions & 0 deletions .circleci/config/jobs/test-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@ steps:
- run:
name: Test UI
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}"
Expand Down
22 changes: 22 additions & 0 deletions .circleci/config/jobs/website-docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
docker:
- image: circleci/buildpack-deps
shell: /usr/bin/env bash -euo pipefail -c
steps:
- checkout
- setup_remote_docker
- run:
name: Build Docker Image if Necessary
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
24 changes: 20 additions & 4 deletions .circleci/config/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
jobs:
- pre-flight-checks
- fmt
- install-ui-dependencies:
requires:
- pre-flight-checks
Expand All @@ -14,6 +13,14 @@ jobs:
# Only main, UI, release and merge branches need to run UI tests.
# We don't filter here however because test-ui is configured in github as
# required so it must run, instead we short-circuit within test-ui.
- test-ui-browserstack:
requires:
- install-ui-dependencies
- build-go-dev
filters:
branches:
# Forked pull requests have CIRCLE_BRANCH set to pull/XXX
ignore: /pull\/[0-9]+/
- test-go:
requires:
- pre-flight-checks
Expand All @@ -30,6 +37,15 @@ jobs:
- test-go-race-remote-docker:
requires:
- pre-flight-checks
- semgrep:
requires:
- pre-flight-checks
- website-docker-image:
context: vault-docs
filters:
branches:
only:
- main
- algolia-index:
context: vault-docs
filters:
branches:
only:
- stable-website
23 changes: 0 additions & 23 deletions .github/workflows/backport.yml

This file was deleted.

Loading

0 comments on commit 0d999a0

Please sign in to comment.