2019-07-26 16:32:13 +00:00
|
|
|
### ***
|
|
|
|
### 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'.
|
|
|
|
### ***
|
2019-05-03 23:05:10 +00:00
|
|
|
version: 2
|
|
|
|
jobs:
|
2019-06-26 14:14:23 +00:00
|
|
|
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
|
2019-05-03 23:05:10 +00:00
|
|
|
install-ui-dependencies:
|
|
|
|
docker:
|
2020-01-15 17:53:18 +00:00
|
|
|
- environment:
|
|
|
|
JOBS: 2
|
|
|
|
image: node:10-buster
|
2019-07-24 13:13:41 +00:00
|
|
|
shell: /usr/bin/env bash -euo pipefail -c
|
2019-11-06 13:15:06 +00:00
|
|
|
working_directory: /go/src/github.com/hashicorp/vault
|
2019-05-03 23:05:10 +00:00
|
|
|
steps:
|
2019-06-11 14:55:53 +00:00
|
|
|
- checkout
|
|
|
|
- restore_cache:
|
2019-11-06 13:15:06 +00:00
|
|
|
key: yarn-lock-v6-{{ checksum "ui/yarn.lock" }}
|
2019-06-11 14:55:53 +00:00
|
|
|
- run:
|
|
|
|
command: |
|
|
|
|
cd ui
|
2019-08-20 15:22:55 +00:00
|
|
|
yarn install
|
2019-06-11 14:55:53 +00:00
|
|
|
npm rebuild node-sass
|
|
|
|
name: Install UI dependencies
|
|
|
|
- save_cache:
|
2019-11-06 13:15:06 +00:00
|
|
|
key: yarn-lock-v6-{{ checksum "ui/yarn.lock" }}
|
2019-06-11 14:55:53 +00:00
|
|
|
paths:
|
|
|
|
- ui/node_modules
|
2019-05-03 23:05:10 +00:00
|
|
|
build-go-dev:
|
2019-11-06 13:15:06 +00:00
|
|
|
machine: true
|
2019-07-24 13:13:41 +00:00
|
|
|
shell: /usr/bin/env bash -euo pipefail -c
|
2019-11-06 13:15:06 +00:00
|
|
|
working_directory: /go/src/github.com/hashicorp/vault
|
2019-05-03 23:05:10 +00:00
|
|
|
steps:
|
2019-11-06 13:15:06 +00:00
|
|
|
- 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: ~/
|
2019-06-11 14:55:53 +00:00
|
|
|
- checkout
|
|
|
|
- attach_workspace:
|
|
|
|
at: .
|
|
|
|
- run:
|
|
|
|
command: |
|
|
|
|
# Move dev UI assets to expected location
|
|
|
|
rm -rf ./pkg
|
|
|
|
mkdir ./pkg
|
2019-05-03 23:05:10 +00:00
|
|
|
|
2019-06-11 14:55:53 +00:00
|
|
|
# Build dev binary
|
|
|
|
make bootstrap dev
|
|
|
|
name: Build dev binary
|
|
|
|
- persist_to_workspace:
|
|
|
|
paths:
|
|
|
|
- bin
|
|
|
|
root: .
|
2019-11-06 13:15:06 +00:00
|
|
|
environment:
|
|
|
|
- CIRCLECI_CLI_VERSION: 0.1.5546
|
|
|
|
- GO_TAGS: ''
|
2020-02-19 07:30:04 +00:00
|
|
|
- GO_VERSION: 1.13.8
|
2019-11-06 13:15:06 +00:00
|
|
|
- GO111MODULE: 'off'
|
|
|
|
- GOTESTSUM_VERSION: 0.3.3
|
2019-05-03 23:05:10 +00:00
|
|
|
test-ui:
|
|
|
|
docker:
|
2020-01-15 17:53:18 +00:00
|
|
|
- environment:
|
|
|
|
JOBS: 2
|
|
|
|
image: node:10-buster
|
2019-07-24 13:13:41 +00:00
|
|
|
shell: /usr/bin/env bash -euo pipefail -c
|
2019-11-06 13:15:06 +00:00
|
|
|
working_directory: /go/src/github.com/hashicorp/vault
|
2019-05-03 23:05:10 +00:00
|
|
|
resource_class: medium+
|
|
|
|
steps:
|
2019-06-11 14:55:53 +00:00
|
|
|
- checkout
|
|
|
|
- restore_cache:
|
2019-11-06 13:15:06 +00:00
|
|
|
key: yarn-lock-v6-{{ checksum "ui/yarn.lock" }}
|
2019-06-11 14:55:53 +00:00
|
|
|
- attach_workspace:
|
|
|
|
at: .
|
|
|
|
- run:
|
|
|
|
command: |
|
2019-07-24 13:13:41 +00:00
|
|
|
set -x
|
2019-05-24 12:02:51 +00:00
|
|
|
|
2019-06-11 14:55:53 +00:00
|
|
|
# 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/*
|
2019-05-24 12:02:51 +00:00
|
|
|
|
2019-06-11 14:55:53 +00:00
|
|
|
# Add ./bin to the PATH so vault binary can be run by Ember tests
|
|
|
|
export PATH="${PWD}/bin:${PATH}"
|
2019-05-24 12:02:51 +00:00
|
|
|
|
2019-06-11 14:55:53 +00:00
|
|
|
# Run Ember tests
|
|
|
|
cd ui
|
|
|
|
mkdir -p test-results/qunit
|
Update ui dependencies (#7244)
* be more specific about node version, and specify a yarn version
* update ember, ember-cli, ember-data, ember-data-model-fragments
* use router handlers to access transition information
* fix shadowing of component helper
* update ivy-codemirror, ember-cli-inject-live-reload
* remove custom router service
* don't use transition.queryParams
* update ember-cli-deprecation-workflow
* refactor kv v1 to use 'path' instead of 'id' on creation
* fix auth-jwt-test and toolbar-link-test
* update ember composable helpers
* remove Ember.copy from test file
* no more deprecations in the workflow
* fix more secret tests
* fix remaining failed tests
* move select component to core because it's used by ttl-picker
* generate new model class for each test instead of reusing an existing one
* fix selectors on kmip tests
* refactor how control groups construct urls from the new transition objects
* add router service override back in, and have it be evented so that we can trigger router events on it
* move stories and markdown files to core if the component lives in core
* update ember-cli, ember-cli-babel, ember-auto-import
* update base64js, date-fns, deepmerge, codemirror, broccoli-asset-rev
* update linting rules
* fix test selectors
* update ember-api-actions, ember-concurrency, ember-load-initializers, escape-string-regexp, normalize.css, prettier-eslint-cli, jsdoc-to-markdown
* remove test-results dir
* update base64js, ember-cli-clipboard, ember-cli-sass, ember-cli-string-helpers, ember-cli-template-lint, ember-cli-uglify, ember-link-action
* fix linting
* run yarn install without restoring from cache
* refactor how tests are run and handle the vault server subprocess
* update makefile for new test task names
* update circle config to use the new yarn task
* fix writing the seal keys when starting the dev server
* remove optional deps from the lockfile
* don't ignore-optional on yarn install
* remove errant console.log
* update ember-basic-dropdown-hover, jsonlint, yargs-parser
* update ember-cli-flash
* add back optionalDeps
* update @babel/core@7.5.5, ember-basic-dropdown@1.1.3, eslint-plugin-ember@6.8.2
* update storybook to the latest release
* add a babel config with targets so that the ember babel plugin works properly
* update ember-resolver, move ember-cli-storybook to devDependencies
* revert normalize.css upgrade
* silence fetchadapter warning for now
* exclude 3rd party array helper now that ember includes one
* fix switch and entity lookup styling
* only add -root suffix if it's not in versions mode
* make sure drop always has an array on the aws role form
* fix labels like we did with the backport
* update eslintignore
* update the yarn version in the docker build file
* update eslint ignore
2019-08-19 20:45:39 +00:00
|
|
|
yarn test:oss
|
2019-06-11 14:55:53 +00:00
|
|
|
name: Test UI
|
|
|
|
- store_artifacts:
|
|
|
|
path: ui/test-results
|
|
|
|
- store_test_results:
|
|
|
|
path: ui/test-results
|
2019-07-24 13:13:41 +00:00
|
|
|
test-ui-browserstack:
|
|
|
|
docker:
|
2020-01-15 17:53:18 +00:00
|
|
|
- environment:
|
|
|
|
JOBS: 2
|
|
|
|
image: node:10-buster
|
2019-07-24 13:13:41 +00:00
|
|
|
shell: /usr/bin/env bash -euo pipefail -c
|
2019-11-06 13:15:06 +00:00
|
|
|
working_directory: /go/src/github.com/hashicorp/vault
|
2019-07-26 16:02:44 +00:00
|
|
|
resource_class: medium+
|
2019-07-24 13:13:41 +00:00
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_cache:
|
2019-11-06 13:15:06 +00:00
|
|
|
key: yarn-lock-v6-{{ checksum "ui/yarn.lock" }}
|
2019-07-24 13:13:41 +00:00
|
|
|
- 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
|
2019-05-03 23:05:10 +00:00
|
|
|
test-go:
|
|
|
|
machine: true
|
2019-07-24 13:13:41 +00:00
|
|
|
shell: /usr/bin/env bash -euo pipefail -c
|
2019-11-06 13:15:06 +00:00
|
|
|
working_directory: /go/src/github.com/hashicorp/vault
|
2019-05-03 23:05:10 +00:00
|
|
|
parallelism: 2
|
2019-06-11 14:55:53 +00:00
|
|
|
steps:
|
|
|
|
- run:
|
|
|
|
command: |
|
2019-11-06 13:15:06 +00:00
|
|
|
[ -n "$GO_VERSION" ] || { echo "You must set GO_VERSION"; exit 1; }
|
2019-06-11 14:55:53 +00:00
|
|
|
# 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"
|
2019-11-06 13:15:06 +00:00
|
|
|
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: |
|
|
|
|
set -x
|
2019-06-11 14:55:53 +00:00
|
|
|
|
|
|
|
# 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"
|
|
|
|
|
|
|
|
# Split Go tests by prior test times
|
|
|
|
package_names=$(go list \
|
|
|
|
-tags "${GO_TAGS}" \
|
|
|
|
./... \
|
|
|
|
| grep -v /integ \
|
|
|
|
| grep -v /vendor/ \
|
|
|
|
| sort \
|
|
|
|
| circleci tests split --split-by=timings --timings-type=classname)
|
|
|
|
|
|
|
|
# Install gotestsum
|
|
|
|
curl -sSL "https://github.com/gotestyourself/gotestsum/releases/download/v${GOTESTSUM_VERSION}/gotestsum_${GOTESTSUM_VERSION}_linux_amd64.tar.gz" \
|
|
|
|
| sudo tar --overwrite -xz -C /usr/local/bin gotestsum
|
|
|
|
|
|
|
|
# Run tests
|
|
|
|
make prep
|
|
|
|
mkdir -p test-results/go-test
|
|
|
|
CGO_ENABLED= \
|
|
|
|
VAULT_ADDR= \
|
|
|
|
VAULT_TOKEN= \
|
|
|
|
VAULT_DEV_ROOT_TOKEN_ID= \
|
|
|
|
VAULT_ACC= \
|
|
|
|
gotestsum --format=short-verbose --junitfile test-results/go-test/results.xml -- \
|
|
|
|
-tags "${GO_TAGS}" \
|
2019-10-14 15:51:53 +00:00
|
|
|
-timeout=60m \
|
2019-06-11 14:55:53 +00:00
|
|
|
-parallel=20 \
|
|
|
|
\
|
|
|
|
${package_names}
|
|
|
|
name: Run Go tests
|
2019-11-12 14:03:42 +00:00
|
|
|
no_output_timeout: 60m
|
2019-06-11 14:55:53 +00:00
|
|
|
- store_artifacts:
|
|
|
|
path: test-results
|
|
|
|
- store_test_results:
|
|
|
|
path: test-results
|
|
|
|
environment:
|
|
|
|
- CIRCLECI_CLI_VERSION: 0.1.5546
|
2019-11-06 13:15:06 +00:00
|
|
|
- GO_TAGS: ''
|
2020-02-19 07:30:04 +00:00
|
|
|
- GO_VERSION: 1.13.8
|
2019-11-06 13:15:06 +00:00
|
|
|
- GO111MODULE: 'off'
|
2019-06-11 14:55:53 +00:00
|
|
|
- GOTESTSUM_VERSION: 0.3.3
|
|
|
|
test-go-race:
|
|
|
|
machine: true
|
2019-07-24 13:13:41 +00:00
|
|
|
shell: /usr/bin/env bash -euo pipefail -c
|
2019-11-06 13:15:06 +00:00
|
|
|
working_directory: /go/src/github.com/hashicorp/vault
|
2019-05-03 23:05:10 +00:00
|
|
|
steps:
|
2019-06-11 14:55:53 +00:00
|
|
|
- run:
|
|
|
|
command: |
|
2019-11-06 13:15:06 +00:00
|
|
|
[ -n "$GO_VERSION" ] || { echo "You must set GO_VERSION"; exit 1; }
|
2019-06-11 14:55:53 +00:00
|
|
|
# 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"
|
2019-11-06 13:15:06 +00:00
|
|
|
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: |
|
|
|
|
set -x
|
2019-05-03 23:05:10 +00:00
|
|
|
|
2019-06-11 14:55:53 +00:00
|
|
|
# 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"
|
|
|
|
|
|
|
|
# Split Go tests by prior test times
|
|
|
|
package_names=$(go list \
|
|
|
|
-tags "${GO_TAGS}" \
|
|
|
|
./... \
|
|
|
|
| grep -v /integ \
|
|
|
|
| grep -v /vendor/ \
|
|
|
|
| sort \
|
|
|
|
| circleci tests split --split-by=timings --timings-type=classname)
|
|
|
|
|
|
|
|
# Install gotestsum
|
|
|
|
curl -sSL "https://github.com/gotestyourself/gotestsum/releases/download/v${GOTESTSUM_VERSION}/gotestsum_${GOTESTSUM_VERSION}_linux_amd64.tar.gz" \
|
|
|
|
| sudo tar --overwrite -xz -C /usr/local/bin gotestsum
|
|
|
|
|
|
|
|
# Run tests
|
|
|
|
make prep
|
|
|
|
mkdir -p test-results/go-test
|
|
|
|
CGO_ENABLED= \
|
|
|
|
VAULT_ADDR= \
|
|
|
|
VAULT_TOKEN= \
|
|
|
|
VAULT_DEV_ROOT_TOKEN_ID= \
|
|
|
|
VAULT_ACC= \
|
|
|
|
gotestsum --format=short-verbose --junitfile test-results/go-test/results.xml -- \
|
|
|
|
-tags "${GO_TAGS}" \
|
2019-10-14 15:51:53 +00:00
|
|
|
-timeout=60m \
|
2019-06-11 14:55:53 +00:00
|
|
|
-parallel=20 \
|
|
|
|
-race \
|
|
|
|
${package_names}
|
|
|
|
name: Run Go tests
|
2019-11-12 14:03:42 +00:00
|
|
|
no_output_timeout: 60m
|
2019-06-11 14:55:53 +00:00
|
|
|
- store_artifacts:
|
|
|
|
path: test-results
|
|
|
|
- store_test_results:
|
|
|
|
path: test-results
|
|
|
|
environment:
|
|
|
|
- CIRCLECI_CLI_VERSION: 0.1.5546
|
2019-11-06 13:15:06 +00:00
|
|
|
- GO_TAGS: ''
|
2020-02-19 07:30:04 +00:00
|
|
|
- GO_VERSION: 1.13.8
|
2019-11-06 13:15:06 +00:00
|
|
|
- GO111MODULE: 'off'
|
2019-06-11 14:55:53 +00:00
|
|
|
- GOTESTSUM_VERSION: 0.3.3
|
2020-01-18 00:18:09 +00:00
|
|
|
website-docker-image:
|
|
|
|
docker:
|
|
|
|
- image: circleci/buildpack-deps
|
|
|
|
shell: /usr/bin/env bash -euo pipefail -c
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- setup_remote_docker
|
|
|
|
- run:
|
|
|
|
command: |
|
2020-02-11 17:03:54 +00:00
|
|
|
# BUILD_FROM_REPO should ALWAYS be the main OSS Vault repo URL.
|
|
|
|
BUILD_FROM_REPO=git@github.com:hashicorp/vault.git
|
|
|
|
[ "$CIRCLE_REPOSITORY_URL" = "$BUILD_FROM_REPO" ] || {
|
|
|
|
echo "Not building website docker image for repo '$CIRCLE_REPOSITORY_URL' - we only build it for $BUILD_FROM_REPO."
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
[ "$CIRCLE_BRANCH" = "master" ] || {
|
|
|
|
echo "Not building website docker image for branch '$CIRCLE_BRANCH' - we only build it for master."
|
|
|
|
exit 0
|
|
|
|
}
|
2020-02-19 07:45:54 +00:00
|
|
|
PACKAGE_LOCK_CHANGED="$( \
|
|
|
|
git diff --name-only $(git log --pretty=format:'%h' -n1 HEAD~1)...HEAD | \
|
|
|
|
grep -c website/package-lock.json; \
|
|
|
|
)" || true
|
2020-02-11 17:03:54 +00:00
|
|
|
[ $PACKAGE_LOCK_CHANGED -gt 0 ] || {
|
|
|
|
echo "Not building a new website docker image - dependencies have not changed."
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
cd website/
|
|
|
|
docker build -t hashicorp/vault-website:$CIRCLE_SHA1 .
|
|
|
|
docker tag hashicorp/vault-website:$CIRCLE_SHA1 hashicorp/vault-website:latest
|
|
|
|
docker login -u $DOCKER_USER -p $DOCKER_PASS
|
|
|
|
docker push hashicorp/vault-website
|
2020-01-18 00:18:09 +00:00
|
|
|
name: Build Docker Image if Necessary
|
2019-06-11 14:55:53 +00:00
|
|
|
workflows:
|
2019-05-03 23:05:10 +00:00
|
|
|
ci:
|
|
|
|
jobs:
|
2019-06-26 14:14:23 +00:00
|
|
|
- pre-flight-checks
|
|
|
|
- install-ui-dependencies:
|
|
|
|
requires:
|
|
|
|
- pre-flight-checks
|
2019-06-11 14:55:53 +00:00
|
|
|
- build-go-dev:
|
|
|
|
requires:
|
2019-11-06 13:15:06 +00:00
|
|
|
- pre-flight-checks
|
2019-06-11 14:55:53 +00:00
|
|
|
- test-ui:
|
|
|
|
requires:
|
|
|
|
- install-ui-dependencies
|
|
|
|
- build-go-dev
|
2019-07-24 13:13:41 +00:00
|
|
|
- test-ui-browserstack:
|
2019-07-25 10:35:12 +00:00
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
ignore: /pull\/[0-9]+/
|
2019-07-24 13:13:41 +00:00
|
|
|
requires:
|
|
|
|
- install-ui-dependencies
|
|
|
|
- build-go-dev
|
2019-06-11 14:55:53 +00:00
|
|
|
- test-go:
|
|
|
|
requires:
|
|
|
|
- build-go-dev
|
|
|
|
- test-go-race:
|
|
|
|
requires:
|
|
|
|
- build-go-dev
|
2020-02-03 17:04:33 +00:00
|
|
|
- website-docker-image:
|
|
|
|
context: vault-docs
|
2019-06-11 14:55:53 +00:00
|
|
|
version: 2
|
|
|
|
|
|
|
|
# Original config.yml file:
|
|
|
|
# commands:
|
|
|
|
# go_test:
|
|
|
|
# description: run go tests
|
|
|
|
# parameters:
|
|
|
|
# extra_flags:
|
|
|
|
# default: \"\"
|
|
|
|
# type: string
|
|
|
|
# steps:
|
|
|
|
# - run:
|
|
|
|
# command: |
|
2019-07-24 13:13:41 +00:00
|
|
|
# set -x
|
2019-06-11 14:55:53 +00:00
|
|
|
#
|
|
|
|
# # 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\"
|
|
|
|
#
|
|
|
|
# # Split Go tests by prior test times
|
|
|
|
# package_names=$(go list \\
|
|
|
|
# -tags \"${GO_TAGS}\" \\
|
|
|
|
# ./... \\
|
|
|
|
# | grep -v /integ \\
|
|
|
|
# | grep -v /vendor/ \\
|
|
|
|
# | sort \\
|
|
|
|
# | circleci tests split --split-by=timings --timings-type=classname)
|
|
|
|
#
|
|
|
|
# # Install gotestsum
|
|
|
|
# curl -sSL \"https://github.com/gotestyourself/gotestsum/releases/download/v${GOTESTSUM_VERSION}/gotestsum_${GOTESTSUM_VERSION}_linux_amd64.tar.gz\" \\
|
|
|
|
# | sudo tar --overwrite -xz -C /usr/local/bin gotestsum
|
|
|
|
#
|
|
|
|
# # Run tests
|
|
|
|
# make prep
|
|
|
|
# mkdir -p test-results/go-test
|
|
|
|
# CGO_ENABLED= \\
|
|
|
|
# VAULT_ADDR= \\
|
|
|
|
# VAULT_TOKEN= \\
|
|
|
|
# VAULT_DEV_ROOT_TOKEN_ID= \\
|
|
|
|
# VAULT_ACC= \\
|
|
|
|
# gotestsum --format=short-verbose --junitfile test-results/go-test/results.xml -- \\
|
|
|
|
# -tags \"${GO_TAGS}\" \\
|
2019-10-14 15:51:53 +00:00
|
|
|
# -timeout=60m \\
|
2019-06-11 14:55:53 +00:00
|
|
|
# -parallel=20 \\
|
|
|
|
# << parameters.extra_flags >> \\
|
|
|
|
# ${package_names}
|
|
|
|
# name: Run Go tests
|
2019-11-12 14:03:42 +00:00
|
|
|
# no_output_timeout: 60m
|
2019-06-11 14:55:53 +00:00
|
|
|
# restore_yarn_cache:
|
|
|
|
# steps:
|
|
|
|
# - restore_cache:
|
2019-11-06 13:15:06 +00:00
|
|
|
# key: yarn-lock-v6-{{ checksum \"ui/yarn.lock\" }}
|
2019-06-11 14:55:53 +00:00
|
|
|
# save_yarn_cache:
|
|
|
|
# steps:
|
|
|
|
# - save_cache:
|
2019-11-06 13:15:06 +00:00
|
|
|
# key: yarn-lock-v6-{{ checksum \"ui/yarn.lock\" }}
|
2019-06-11 14:55:53 +00:00
|
|
|
# paths:
|
|
|
|
# - ui/node_modules
|
2019-11-06 13:15:06 +00:00
|
|
|
# setup-go:
|
|
|
|
# description: |
|
|
|
|
# Ensure the right version of Go is installed and set GOPATH to $HOME/go.
|
|
|
|
# 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: ~/
|
2019-06-11 14:55:53 +00:00
|
|
|
# executors:
|
2019-11-06 13:15:06 +00:00
|
|
|
# alpine:
|
2019-06-11 14:55:53 +00:00
|
|
|
# docker:
|
2019-11-06 13:15:06 +00:00
|
|
|
# - image: alpine:3.10.2
|
|
|
|
# shell: /bin/sh
|
|
|
|
# working_directory: /go/src/github.com/hashicorp/vault
|
2019-06-11 14:55:53 +00:00
|
|
|
# go-machine:
|
|
|
|
# environment:
|
|
|
|
# CIRCLECI_CLI_VERSION: 0.1.5546
|
2019-11-06 13:15:06 +00:00
|
|
|
# GO_TAGS: \"\"
|
2020-02-19 07:30:04 +00:00
|
|
|
# GO_VERSION: 1.13.8
|
2019-11-06 13:15:06 +00:00
|
|
|
# GO111MODULE: \"off\"
|
2019-06-11 14:55:53 +00:00
|
|
|
# GOTESTSUM_VERSION: 0.3.3
|
|
|
|
# machine: true
|
2019-07-24 13:13:41 +00:00
|
|
|
# shell: /usr/bin/env bash -euo pipefail -c
|
2019-11-06 13:15:06 +00:00
|
|
|
# working_directory: /go/src/github.com/hashicorp/vault
|
2019-06-11 14:55:53 +00:00
|
|
|
# node:
|
|
|
|
# docker:
|
2020-01-15 17:53:18 +00:00
|
|
|
# - environment:
|
|
|
|
# JOBS: 2
|
|
|
|
# image: node:10-buster
|
2019-07-24 13:13:41 +00:00
|
|
|
# shell: /usr/bin/env bash -euo pipefail -c
|
2019-11-06 13:15:06 +00:00
|
|
|
# working_directory: /go/src/github.com/hashicorp/vault
|
|
|
|
# python:
|
|
|
|
# docker:
|
|
|
|
# - image: python:3-alpine
|
|
|
|
# shell: /usr/bin/env bash -euo pipefail -c
|
|
|
|
# working_directory: /go/src/github.com/hashicorp/vault
|
2019-06-11 14:55:53 +00:00
|
|
|
# jobs:
|
|
|
|
# build-go-dev:
|
2019-11-06 13:15:06 +00:00
|
|
|
# executor: go-machine
|
2019-06-11 14:55:53 +00:00
|
|
|
# steps:
|
2019-11-06 13:15:06 +00:00
|
|
|
# - setup-go
|
2019-06-11 14:55:53 +00:00
|
|
|
# - checkout
|
|
|
|
# - attach_workspace:
|
|
|
|
# at: .
|
|
|
|
# - run:
|
|
|
|
# command: |
|
|
|
|
# # Move dev UI assets to expected location
|
|
|
|
# rm -rf ./pkg
|
|
|
|
# mkdir ./pkg
|
|
|
|
#
|
|
|
|
# # Build dev binary
|
|
|
|
# make bootstrap dev
|
|
|
|
# name: Build dev binary
|
|
|
|
# - persist_to_workspace:
|
|
|
|
# paths:
|
|
|
|
# - bin
|
|
|
|
# root: .
|
|
|
|
# install-ui-dependencies:
|
|
|
|
# executor: node
|
|
|
|
# steps:
|
|
|
|
# - checkout
|
|
|
|
# - restore_yarn_cache
|
|
|
|
# - run:
|
|
|
|
# command: |
|
|
|
|
# cd ui
|
2019-08-20 15:22:55 +00:00
|
|
|
# yarn install
|
2019-06-11 14:55:53 +00:00
|
|
|
# npm rebuild node-sass
|
|
|
|
# name: Install UI dependencies
|
|
|
|
# - save_yarn_cache
|
2019-06-26 14:14:23 +00:00
|
|
|
# pre-flight-checks:
|
|
|
|
# description: Ensures nothing obvious is broken for faster failures.
|
|
|
|
# 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: make ci-verify
|
2019-06-11 14:55:53 +00:00
|
|
|
# test-go:
|
|
|
|
# executor: go-machine
|
|
|
|
# parallelism: 2
|
|
|
|
# steps:
|
2019-11-06 13:15:06 +00:00
|
|
|
# - setup-go
|
2019-06-11 14:55:53 +00:00
|
|
|
# - checkout
|
|
|
|
# - go_test
|
|
|
|
# - store_artifacts:
|
|
|
|
# path: test-results
|
|
|
|
# - store_test_results:
|
|
|
|
# path: test-results
|
|
|
|
# test-go-race:
|
|
|
|
# executor: go-machine
|
|
|
|
# steps:
|
2019-11-06 13:15:06 +00:00
|
|
|
# - setup-go
|
2019-06-11 14:55:53 +00:00
|
|
|
# - checkout
|
|
|
|
# - go_test:
|
|
|
|
# extra_flags: -race
|
|
|
|
# - store_artifacts:
|
|
|
|
# path: test-results
|
|
|
|
# - store_test_results:
|
|
|
|
# path: test-results
|
|
|
|
# test-ui:
|
|
|
|
# executor: node
|
|
|
|
# resource_class: medium+
|
|
|
|
# steps:
|
|
|
|
# - checkout
|
|
|
|
# - restore_yarn_cache
|
|
|
|
# - attach_workspace:
|
|
|
|
# at: .
|
|
|
|
# - run:
|
|
|
|
# command: |
|
2019-07-24 13:13:41 +00:00
|
|
|
# set -x
|
2019-06-11 14:55:53 +00:00
|
|
|
#
|
|
|
|
# # 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
|
Update ui dependencies (#7244)
* be more specific about node version, and specify a yarn version
* update ember, ember-cli, ember-data, ember-data-model-fragments
* use router handlers to access transition information
* fix shadowing of component helper
* update ivy-codemirror, ember-cli-inject-live-reload
* remove custom router service
* don't use transition.queryParams
* update ember-cli-deprecation-workflow
* refactor kv v1 to use 'path' instead of 'id' on creation
* fix auth-jwt-test and toolbar-link-test
* update ember composable helpers
* remove Ember.copy from test file
* no more deprecations in the workflow
* fix more secret tests
* fix remaining failed tests
* move select component to core because it's used by ttl-picker
* generate new model class for each test instead of reusing an existing one
* fix selectors on kmip tests
* refactor how control groups construct urls from the new transition objects
* add router service override back in, and have it be evented so that we can trigger router events on it
* move stories and markdown files to core if the component lives in core
* update ember-cli, ember-cli-babel, ember-auto-import
* update base64js, date-fns, deepmerge, codemirror, broccoli-asset-rev
* update linting rules
* fix test selectors
* update ember-api-actions, ember-concurrency, ember-load-initializers, escape-string-regexp, normalize.css, prettier-eslint-cli, jsdoc-to-markdown
* remove test-results dir
* update base64js, ember-cli-clipboard, ember-cli-sass, ember-cli-string-helpers, ember-cli-template-lint, ember-cli-uglify, ember-link-action
* fix linting
* run yarn install without restoring from cache
* refactor how tests are run and handle the vault server subprocess
* update makefile for new test task names
* update circle config to use the new yarn task
* fix writing the seal keys when starting the dev server
* remove optional deps from the lockfile
* don't ignore-optional on yarn install
* remove errant console.log
* update ember-basic-dropdown-hover, jsonlint, yargs-parser
* update ember-cli-flash
* add back optionalDeps
* update @babel/core@7.5.5, ember-basic-dropdown@1.1.3, eslint-plugin-ember@6.8.2
* update storybook to the latest release
* add a babel config with targets so that the ember babel plugin works properly
* update ember-resolver, move ember-cli-storybook to devDependencies
* revert normalize.css upgrade
* silence fetchadapter warning for now
* exclude 3rd party array helper now that ember includes one
* fix switch and entity lookup styling
* only add -root suffix if it's not in versions mode
* make sure drop always has an array on the aws role form
* fix labels like we did with the backport
* update eslintignore
* update the yarn version in the docker build file
* update eslint ignore
2019-08-19 20:45:39 +00:00
|
|
|
# yarn test:oss
|
2019-06-11 14:55:53 +00:00
|
|
|
# name: Test UI
|
|
|
|
# - store_artifacts:
|
|
|
|
# path: ui/test-results
|
|
|
|
# - store_test_results:
|
|
|
|
# path: ui/test-results
|
2019-07-24 13:13:41 +00:00
|
|
|
# test-ui-browserstack:
|
|
|
|
# executor: node
|
2019-07-26 16:02:44 +00:00
|
|
|
# resource_class: medium+
|
2019-07-24 13:13:41 +00:00
|
|
|
# steps:
|
|
|
|
# - checkout
|
|
|
|
# - restore_yarn_cache
|
|
|
|
# - 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
|
2020-01-18 00:18:09 +00:00
|
|
|
# website-docker-image:
|
|
|
|
# docker:
|
|
|
|
# - image: circleci/buildpack-deps
|
|
|
|
# shell: /usr/bin/env bash -euo pipefail -c
|
|
|
|
# steps:
|
|
|
|
# - checkout
|
|
|
|
# - setup_remote_docker
|
|
|
|
# - run:
|
|
|
|
# command: |
|
2020-02-11 17:03:54 +00:00
|
|
|
# # BUILD_FROM_REPO should ALWAYS be the main OSS Vault repo URL.
|
|
|
|
# BUILD_FROM_REPO=git@github.com:hashicorp/vault.git
|
|
|
|
# [ \"$CIRCLE_REPOSITORY_URL\" = \"$BUILD_FROM_REPO\" ] || {
|
|
|
|
# echo \"Not building website docker image for repo '$CIRCLE_REPOSITORY_URL' - we only build it for $BUILD_FROM_REPO.\"
|
|
|
|
# exit 0
|
|
|
|
# }
|
|
|
|
# [ \"$CIRCLE_BRANCH\" = \"master\" ] || {
|
|
|
|
# echo \"Not building website docker image for branch '$CIRCLE_BRANCH' - we only build it for master.\"
|
|
|
|
# exit 0
|
|
|
|
# }
|
2020-02-19 07:45:54 +00:00
|
|
|
# PACKAGE_LOCK_CHANGED=\"$( \\
|
|
|
|
# git diff --name-only $(git log --pretty=format:'%h' -n1 HEAD~1)...HEAD | \\
|
|
|
|
# grep -c website/package-lock.json; \\
|
|
|
|
# )\" || true
|
2020-02-11 17:03:54 +00:00
|
|
|
# [ $PACKAGE_LOCK_CHANGED -gt 0 ] || {
|
|
|
|
# echo \"Not building a new website docker image - dependencies have not changed.\"
|
|
|
|
# exit 0
|
|
|
|
# }
|
|
|
|
# cd website/
|
|
|
|
# docker build -t hashicorp/vault-website:$CIRCLE_SHA1 .
|
|
|
|
# docker tag hashicorp/vault-website:$CIRCLE_SHA1 hashicorp/vault-website:latest
|
|
|
|
# docker login -u $DOCKER_USER -p $DOCKER_PASS
|
|
|
|
# docker push hashicorp/vault-website
|
2020-01-18 00:18:09 +00:00
|
|
|
# name: Build Docker Image if Necessary
|
2019-06-11 14:55:53 +00:00
|
|
|
# references:
|
|
|
|
# cache:
|
|
|
|
# go-sum: go-sum-v1-{{ checksum \"go.sum\" }}
|
2019-11-06 13:15:06 +00:00
|
|
|
# yarn-lock: yarn-lock-v6-{{ checksum \"ui/yarn.lock\" }}
|
2019-06-11 14:55:53 +00:00
|
|
|
# images:
|
2019-10-17 19:48:45 +00:00
|
|
|
# node: node:10-buster
|
2019-06-11 14:55:53 +00:00
|
|
|
# version: 2.1
|
|
|
|
# workflows:
|
|
|
|
# ci:
|
|
|
|
# jobs:
|
2019-06-26 14:14:23 +00:00
|
|
|
# - pre-flight-checks
|
|
|
|
# - install-ui-dependencies:
|
|
|
|
# requires:
|
|
|
|
# - pre-flight-checks
|
2019-06-11 14:55:53 +00:00
|
|
|
# - build-go-dev:
|
|
|
|
# requires:
|
2019-11-06 13:15:06 +00:00
|
|
|
# - pre-flight-checks
|
2019-06-11 14:55:53 +00:00
|
|
|
# - test-ui:
|
|
|
|
# requires:
|
|
|
|
# - install-ui-dependencies
|
|
|
|
# - build-go-dev
|
2019-07-24 13:13:41 +00:00
|
|
|
# - test-ui-browserstack:
|
2019-07-25 10:35:12 +00:00
|
|
|
# filters:
|
|
|
|
# branches:
|
|
|
|
# ignore: /pull\\/[0-9]+/
|
2019-07-24 13:13:41 +00:00
|
|
|
# requires:
|
|
|
|
# - install-ui-dependencies
|
|
|
|
# - build-go-dev
|
2019-06-11 14:55:53 +00:00
|
|
|
# - test-go:
|
|
|
|
# requires:
|
|
|
|
# - build-go-dev
|
|
|
|
# - test-go-race:
|
|
|
|
# requires:
|
2020-01-18 00:18:09 +00:00
|
|
|
# - build-go-dev
|
2020-02-03 17:04:33 +00:00
|
|
|
# - website-docker-image:
|
|
|
|
# context: vault-docs
|