2019-03-08 20:33:03 +00:00
|
|
|
---
|
|
|
|
version: 2
|
2019-01-28 16:18:30 +00:00
|
|
|
|
2019-03-08 20:33:03 +00:00
|
|
|
references:
|
|
|
|
images:
|
2020-08-12 14:43:19 +00:00
|
|
|
go: &GOLANG_IMAGE circleci/golang:1.14.7
|
2019-10-23 17:54:19 +00:00
|
|
|
middleman: &MIDDLEMAN_IMAGE hashicorp/middleman-hashicorp:0.3.40
|
2020-02-18 13:42:08 +00:00
|
|
|
ember: &EMBER_IMAGE circleci/node:12-browsers
|
2019-03-08 20:33:03 +00:00
|
|
|
|
|
|
|
paths:
|
|
|
|
test-results: &TEST_RESULTS_DIR /tmp/test-results
|
2019-01-28 16:18:30 +00:00
|
|
|
|
2019-03-08 20:33:03 +00:00
|
|
|
cache:
|
2020-02-19 19:10:02 +00:00
|
|
|
yarn: &YARN_CACHE_KEY consul-ui-v2-{{ checksum "ui-v2/yarn.lock" }}
|
2019-03-08 20:33:03 +00:00
|
|
|
rubygem: &RUBYGEM_CACHE_KEY static-site-gems-v1-{{ checksum "Gemfile.lock" }}
|
|
|
|
|
|
|
|
environment: &ENVIRONMENT
|
|
|
|
TEST_RESULTS_DIR: *TEST_RESULTS_DIR
|
|
|
|
EMAIL: noreply@hashicorp.com
|
|
|
|
GIT_AUTHOR_NAME: circleci-consul
|
|
|
|
GIT_COMMITTER_NAME: circleci-consul
|
2020-09-04 03:40:23 +00:00
|
|
|
S3_ARTIFACT_BUCKET: consul-dev-artifacts-v2
|
2019-08-02 19:15:59 +00:00
|
|
|
BASH_ENV: .circleci/bash_env.sh
|
2019-09-23 17:04:40 +00:00
|
|
|
VAULT_BINARY_VERSION: 1.2.2
|
2019-01-28 16:18:30 +00:00
|
|
|
|
2020-07-17 17:00:31 +00:00
|
|
|
steps:
|
|
|
|
install-gotestsum: &install-gotestsum
|
|
|
|
name: install gotestsum
|
|
|
|
environment:
|
|
|
|
GOTESTSUM_RELEASE: 0.5.1
|
|
|
|
command: |
|
|
|
|
url=https://github.com/gotestyourself/gotestsum/releases/download
|
|
|
|
curl -sSL "${url}/v${GOTESTSUM_RELEASE}/gotestsum_${GOTESTSUM_RELEASE}_linux_amd64.tar.gz" | \
|
|
|
|
sudo tar -xz --overwrite -C /usr/local/bin gotestsum
|
|
|
|
|
2020-09-04 03:40:23 +00:00
|
|
|
get-aws-cli: &get-aws-cli
|
|
|
|
run:
|
|
|
|
name: download and install AWS CLI
|
|
|
|
command: |
|
|
|
|
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
|
|
|
|
echo -e "${AWS_CLI_GPG_KEY}" | gpg --import
|
|
|
|
curl -o awscliv2.sig https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip.sig
|
|
|
|
gpg --verify awscliv2.sig awscliv2.zip
|
|
|
|
unzip awscliv2.zip
|
|
|
|
sudo ./aws/install
|
|
|
|
|
|
|
|
aws-assume-role: &aws-assume-role
|
|
|
|
run:
|
|
|
|
name: assume-role aws creds
|
|
|
|
command: |
|
|
|
|
# assume role has duration of 15 min (the minimum allowed)
|
|
|
|
CREDENTIALS="$(aws sts assume-role --duration-seconds 900 --role-arn ${ROLE_ARN} --role-session-name build-${CIRCLE_SHA1} | jq '.Credentials')"
|
|
|
|
echo "export AWS_ACCESS_KEY_ID=$(echo $CREDENTIALS | jq -r '.AccessKeyId')" >> $BASH_ENV
|
|
|
|
echo "export AWS_SECRET_ACCESS_KEY=$(echo $CREDENTIALS | jq -r '.SecretAccessKey')" >> $BASH_ENV
|
|
|
|
echo "export AWS_SESSION_TOKEN=$(echo $CREDENTIALS | jq -r '.SessionToken')" >> $BASH_ENV
|
|
|
|
|
2020-07-28 18:54:48 +00:00
|
|
|
# This step MUST be at the end of any set of steps due to the 'when' condition
|
|
|
|
notify-slack-failure: ¬ify-slack-failure
|
|
|
|
name: notify-slack-failure
|
|
|
|
when: on_fail
|
|
|
|
command: |
|
|
|
|
if [[ $CIRCLE_BRANCH == "master" ]]; then
|
|
|
|
CIRCLE_ENDPOINT="https://app.circleci.com/pipelines/github/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}?branch=${CIRCLE_BRANCH}"
|
|
|
|
GITHUB_ENDPOINT="https://github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/commit/${CIRCLE_SHA1}"
|
|
|
|
COMMIT_MESSAGE=$(git log -1 --pretty=%B | head -n1)
|
|
|
|
SHORT_REF=$(git rev-parse --short "${CIRCLE_SHA1}")
|
|
|
|
curl -X POST -H 'Content-type: application/json' \
|
|
|
|
--data \
|
|
|
|
"{ \
|
|
|
|
\"attachments\": [ \
|
|
|
|
{ \
|
|
|
|
\"fallback\": \"CircleCI job failed!\", \
|
|
|
|
\"text\": \"❌ Failed: \`${CIRCLE_USERNAME}\`'s <${CIRCLE_BUILD_URL}|${CIRCLE_STAGE}> job failed for commit <${GITHUB_ENDPOINT}|${SHORT_REF}> on \`${CIRCLE_BRANCH}\`!\n\n- <${COMMIT_MESSAGE}\", \
|
|
|
|
\"footer\": \"${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}\", \
|
|
|
|
\"ts\": \"$(date +%s)\", \
|
|
|
|
\"color\": \"danger\" \
|
|
|
|
} \
|
|
|
|
] \
|
|
|
|
}" "${FEED_CONSUL_GH_URL}"
|
|
|
|
else
|
|
|
|
echo "Not posting slack failure notifications for non-master branch"
|
|
|
|
fi
|
|
|
|
|
2018-11-16 19:01:02 +00:00
|
|
|
jobs:
|
2019-07-16 22:52:24 +00:00
|
|
|
# lint consul tests
|
|
|
|
lint-consul-retry:
|
|
|
|
docker:
|
|
|
|
- image: *GOLANG_IMAGE
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run: go get -u github.com/hashicorp/lint-consul-retry && lint-consul-retry
|
2020-07-28 18:54:48 +00:00
|
|
|
- run: *notify-slack-failure
|
2019-07-16 22:52:24 +00:00
|
|
|
|
2020-03-12 01:18:03 +00:00
|
|
|
# Runs Go linters
|
|
|
|
lint:
|
2019-04-25 16:26:33 +00:00
|
|
|
docker:
|
2019-05-17 15:42:56 +00:00
|
|
|
- image: *GOLANG_IMAGE
|
2020-03-24 20:14:12 +00:00
|
|
|
environment:
|
|
|
|
GOTAGS: "" # No tags for OSS but there are for enterprise
|
2019-04-25 16:26:33 +00:00
|
|
|
steps:
|
2019-05-17 15:42:56 +00:00
|
|
|
- checkout
|
|
|
|
- run:
|
2020-03-12 01:18:03 +00:00
|
|
|
name: Install golangci-lint
|
2019-05-17 15:42:56 +00:00
|
|
|
command: |
|
2020-03-12 01:18:03 +00:00
|
|
|
download=https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh
|
2020-05-11 23:54:18 +00:00
|
|
|
wget -O- -q $download | sh -x -s -- -d -b /go/bin/ v1.23.6
|
2020-03-12 01:18:03 +00:00
|
|
|
- run: go mod download
|
2019-05-17 15:42:56 +00:00
|
|
|
- run:
|
2020-03-12 01:18:03 +00:00
|
|
|
name: lint
|
|
|
|
command: &lintcmd |
|
2020-03-24 20:14:12 +00:00
|
|
|
golangci-lint run --build-tags="$GOTAGS" -v --concurrency 2
|
2020-03-12 01:18:03 +00:00
|
|
|
- run:
|
|
|
|
name: lint api
|
|
|
|
working_directory: api
|
|
|
|
command: *lintcmd
|
|
|
|
- run:
|
|
|
|
name: lint sdk
|
|
|
|
working_directory: sdk
|
|
|
|
command: *lintcmd
|
2020-07-28 18:54:48 +00:00
|
|
|
- run: *notify-slack-failure
|
2019-05-17 15:42:56 +00:00
|
|
|
|
2019-07-25 15:17:07 +00:00
|
|
|
# checks vendor directory is correct
|
|
|
|
check-vendor:
|
|
|
|
docker:
|
|
|
|
- image: *GOLANG_IMAGE
|
|
|
|
environment:
|
|
|
|
<<: *ENVIRONMENT
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
command: make update-vendor
|
|
|
|
- run: |
|
|
|
|
if ! git diff --exit-code; then
|
|
|
|
echo "Git directory has vendor changes"
|
|
|
|
exit 1
|
|
|
|
fi
|
2020-07-28 18:54:48 +00:00
|
|
|
- run: *notify-slack-failure
|
2019-07-25 15:17:07 +00:00
|
|
|
|
2020-07-27 18:18:09 +00:00
|
|
|
check-generated-protobuf:
|
|
|
|
docker:
|
|
|
|
- image: *GOLANG_IMAGE
|
|
|
|
environment:
|
|
|
|
<<: *ENVIRONMENT
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
name: Install protobuf
|
|
|
|
command: |
|
|
|
|
wget https://github.com/protocolbuffers/protobuf/releases/download/v3.12.3/protoc-3.12.3-linux-x86_64.zip
|
|
|
|
sudo unzip -d /usr/local protoc-*.zip
|
|
|
|
sudo chmod +x /usr/local/bin/protoc
|
|
|
|
rm protoc-*.zip
|
|
|
|
- run:
|
|
|
|
name: Install gogo/protobuf
|
|
|
|
command: |
|
|
|
|
gogo_version=$(go list -m github.com/gogo/protobuf | awk '{print $2}')
|
|
|
|
mkdir -p .gotools; cd .gotools; go mod init consul-tools
|
|
|
|
go get -v github.com/hashicorp/protoc-gen-go-binary
|
|
|
|
go get -v github.com/gogo/protobuf/protoc-gen-gofast@${gogo_version}
|
|
|
|
|
|
|
|
- run:
|
|
|
|
command: make --always-make proto
|
|
|
|
- run: |
|
|
|
|
if ! git diff --exit-code; then
|
|
|
|
echo "Generated code was not updated correctly"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2019-05-17 15:42:56 +00:00
|
|
|
go-test:
|
|
|
|
docker:
|
|
|
|
- image: *GOLANG_IMAGE
|
2020-01-28 17:21:55 +00:00
|
|
|
parallelism: 4
|
2019-05-17 15:42:56 +00:00
|
|
|
environment:
|
|
|
|
<<: *ENVIRONMENT
|
2019-08-21 19:56:27 +00:00
|
|
|
GOTAGS: "" # No tags for OSS but there are for enterprise
|
2020-03-31 16:32:23 +00:00
|
|
|
# GOMAXPROCS defaults to number of cores on underlying hardware, set
|
|
|
|
# explicitly to avoid OOM issues https://support.circleci.com/hc/en-us/articles/360034684273-common-GoLang-memory-issues
|
|
|
|
GOMAXPROCS: 4
|
|
|
|
# The medium resource class (default) boxes are 2 vCPUs, 4GB RAM
|
|
|
|
# https://circleci.com/docs/2.0/configuration-reference/#docker-executor
|
|
|
|
# but we can run a little over that limit.
|
2019-05-17 15:42:56 +00:00
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- attach_workspace:
|
|
|
|
at: /go/bin
|
|
|
|
- run: sudo apt-get update && sudo apt-get install -y rsyslog
|
|
|
|
- run: sudo service rsyslog start
|
2020-07-17 17:00:31 +00:00
|
|
|
- run: *install-gotestsum
|
2020-03-31 15:32:48 +00:00
|
|
|
- run: go mod download
|
|
|
|
- run:
|
|
|
|
name: go test
|
|
|
|
command: |
|
|
|
|
mkdir -p $TEST_RESULTS_DIR
|
2020-05-02 20:42:39 +00:00
|
|
|
mkdir -p $TEST_RESULTS_DIR /tmp/jsonfile
|
|
|
|
PACKAGE_NAMES=$(go list -tags "$GOTAGS" ./... | circleci tests split --split-by=timings --timings-type=classname)
|
2020-03-31 15:32:48 +00:00
|
|
|
echo "Running $(echo $PACKAGE_NAMES | wc -w) packages"
|
|
|
|
echo $PACKAGE_NAMES
|
2020-07-08 22:41:15 +00:00
|
|
|
gotestsum \
|
|
|
|
--format=short-verbose \
|
2020-05-02 20:42:39 +00:00
|
|
|
--jsonfile /tmp/jsonfile/go-test-${CIRCLE_NODE_INDEX}.log \
|
2020-03-31 15:32:48 +00:00
|
|
|
--junitfile $TEST_RESULTS_DIR/gotestsum-report.xml -- \
|
|
|
|
-tags="$GOTAGS" -p 2 \
|
2020-03-31 17:09:17 +00:00
|
|
|
-cover -coverprofile=coverage.txt \
|
2020-03-31 15:32:48 +00:00
|
|
|
$PACKAGE_NAMES
|
2019-11-22 16:49:02 +00:00
|
|
|
|
2019-05-17 15:42:56 +00:00
|
|
|
- store_test_results:
|
2019-12-17 23:18:10 +00:00
|
|
|
path: *TEST_RESULTS_DIR
|
2019-05-17 15:42:56 +00:00
|
|
|
- store_artifacts:
|
2019-12-17 23:18:10 +00:00
|
|
|
path: *TEST_RESULTS_DIR
|
2020-05-02 20:42:39 +00:00
|
|
|
- store_artifacts:
|
|
|
|
path: /tmp/jsonfile
|
2020-03-31 17:09:17 +00:00
|
|
|
- run: &codecov_upload
|
|
|
|
name: codecov upload
|
|
|
|
when: always
|
|
|
|
# The -C flag shouldn't be necessary, but it fails to find the commit
|
|
|
|
# without it.
|
|
|
|
command: bash <(curl -s https://codecov.io/bash) -C "$CIRCLE_SHA1"
|
2020-07-28 18:54:48 +00:00
|
|
|
- run: *notify-slack-failure
|
2019-05-17 15:42:56 +00:00
|
|
|
|
2020-07-08 22:41:15 +00:00
|
|
|
go-test-race:
|
|
|
|
docker:
|
|
|
|
- image: *GOLANG_IMAGE
|
|
|
|
environment:
|
|
|
|
<<: *ENVIRONMENT
|
|
|
|
GOTAGS: "" # No tags for OSS but there are for enterprise
|
|
|
|
# GOMAXPROCS defaults to number of cores on underlying hardware, set
|
|
|
|
# explicitly to avoid OOM issues https://support.circleci.com/hc/en-us/articles/360034684273-common-GoLang-memory-issues
|
|
|
|
GOMAXPROCS: 4
|
|
|
|
# The medium resource class (default) boxes are 2 vCPUs, 4GB RAM
|
|
|
|
# https://circleci.com/docs/2.0/configuration-reference/#docker-executor
|
|
|
|
# but we can run a little over that limit.
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run: *install-gotestsum
|
|
|
|
- run: go mod download
|
|
|
|
- run:
|
|
|
|
name: go test -race
|
|
|
|
command: |
|
2020-07-20 22:34:45 +00:00
|
|
|
mkdir -p $TEST_RESULTS_DIR /tmp/jsonfile
|
2020-07-08 22:41:15 +00:00
|
|
|
gotestsum \
|
|
|
|
--format=short-verbose \
|
2020-07-20 22:34:45 +00:00
|
|
|
--jsonfile /tmp/jsonfile/go-test-race.log \
|
2020-07-08 22:41:15 +00:00
|
|
|
--junitfile $TEST_RESULTS_DIR/gotestsum-report.xml -- \
|
|
|
|
-tags="$GOTAGS" -p 2 \
|
|
|
|
-race -gcflags=all=-d=checkptr=0 \
|
|
|
|
./agent/{ae,cache,checks,config,pool,proxycfg,router} \
|
|
|
|
./agent/consul/{authmethod/...,autopilot,fsm,state,stream} \
|
|
|
|
./snapshot
|
|
|
|
|
|
|
|
- store_test_results:
|
|
|
|
path: *TEST_RESULTS_DIR
|
|
|
|
- store_artifacts:
|
|
|
|
path: *TEST_RESULTS_DIR
|
2020-07-20 22:34:45 +00:00
|
|
|
- store_artifacts:
|
|
|
|
path: /tmp/jsonfile
|
2020-07-28 18:54:48 +00:00
|
|
|
- run: *notify-slack-failure
|
2020-07-08 22:41:15 +00:00
|
|
|
|
2019-05-17 15:42:56 +00:00
|
|
|
# split off a job for the API package since it is separate
|
|
|
|
go-test-api:
|
|
|
|
docker:
|
|
|
|
- image: *GOLANG_IMAGE
|
2019-04-25 16:26:33 +00:00
|
|
|
environment:
|
|
|
|
<<: *ENVIRONMENT
|
2019-08-21 19:56:27 +00:00
|
|
|
GOTAGS: "" # No tags for OSS but there are for enterprise
|
2019-05-17 15:42:56 +00:00
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- attach_workspace:
|
|
|
|
at: /go/bin
|
2020-07-17 17:00:31 +00:00
|
|
|
- run: *install-gotestsum
|
2020-04-01 21:02:15 +00:00
|
|
|
- run:
|
|
|
|
working_directory: api
|
|
|
|
command: go mod download
|
2019-05-17 15:42:56 +00:00
|
|
|
- run:
|
|
|
|
working_directory: api
|
2020-03-31 15:32:48 +00:00
|
|
|
name: go test
|
2019-05-17 15:42:56 +00:00
|
|
|
command: |
|
2020-05-02 20:42:39 +00:00
|
|
|
mkdir -p $TEST_RESULTS_DIR /tmp/jsonfile
|
2020-03-31 15:32:48 +00:00
|
|
|
gotestsum \
|
|
|
|
--format=short-verbose \
|
2020-05-02 20:42:39 +00:00
|
|
|
--jsonfile /tmp/jsonfile/go-test-api.log \
|
2020-03-31 15:32:48 +00:00
|
|
|
--junitfile $TEST_RESULTS_DIR/gotestsum-report.xml -- \
|
2020-03-31 17:09:17 +00:00
|
|
|
-tags="$GOTAGS" -cover -coverprofile=coverage.txt \
|
2020-03-31 15:32:48 +00:00
|
|
|
./...
|
2019-11-22 16:49:02 +00:00
|
|
|
|
2019-05-17 15:42:56 +00:00
|
|
|
- store_test_results:
|
2019-12-17 23:18:10 +00:00
|
|
|
path: *TEST_RESULTS_DIR
|
2019-05-17 15:42:56 +00:00
|
|
|
- store_artifacts:
|
2019-12-17 23:18:10 +00:00
|
|
|
path: *TEST_RESULTS_DIR
|
2020-05-02 20:42:39 +00:00
|
|
|
- store_artifacts:
|
|
|
|
path: /tmp/jsonfile
|
2020-03-31 17:09:17 +00:00
|
|
|
- run: *codecov_upload
|
2020-07-28 18:54:48 +00:00
|
|
|
- run: *notify-slack-failure
|
2019-04-25 16:26:33 +00:00
|
|
|
|
2020-02-12 16:15:24 +00:00
|
|
|
# split off a job for the SDK package since it is separate
|
|
|
|
go-test-sdk:
|
|
|
|
docker:
|
|
|
|
- image: *GOLANG_IMAGE
|
|
|
|
environment:
|
|
|
|
<<: *ENVIRONMENT
|
|
|
|
GOTAGS: "" # No tags for OSS but there are for enterprise
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- attach_workspace:
|
|
|
|
at: /go/bin
|
2020-07-17 17:00:31 +00:00
|
|
|
- run: *install-gotestsum
|
2020-04-01 21:02:15 +00:00
|
|
|
- run:
|
|
|
|
working_directory: sdk
|
|
|
|
command: go mod download
|
2020-02-12 16:15:24 +00:00
|
|
|
- run:
|
|
|
|
working_directory: sdk
|
2020-03-31 15:32:48 +00:00
|
|
|
name: go test
|
2020-02-12 16:15:24 +00:00
|
|
|
command: |
|
2020-03-31 15:32:48 +00:00
|
|
|
mkdir -p $TEST_RESULTS_DIR
|
|
|
|
gotestsum \
|
|
|
|
--format=short-verbose \
|
|
|
|
--junitfile $TEST_RESULTS_DIR/gotestsum-report.xml -- \
|
2020-03-31 17:09:17 +00:00
|
|
|
-tags=$GOTAGS -cover -coverprofile=coverage.txt \
|
2020-03-31 15:32:48 +00:00
|
|
|
./...
|
2020-02-12 16:15:24 +00:00
|
|
|
|
|
|
|
- store_test_results:
|
|
|
|
path: *TEST_RESULTS_DIR
|
|
|
|
- store_artifacts:
|
|
|
|
path: *TEST_RESULTS_DIR
|
2020-03-31 17:09:17 +00:00
|
|
|
- run: *codecov_upload
|
2020-07-28 18:54:48 +00:00
|
|
|
- run: *notify-slack-failure
|
2019-11-22 16:49:02 +00:00
|
|
|
|
2019-03-20 19:24:17 +00:00
|
|
|
# build all distros
|
|
|
|
build-distros: &build-distros
|
2019-03-08 20:33:03 +00:00
|
|
|
docker:
|
|
|
|
- image: *GOLANG_IMAGE
|
2019-03-20 19:24:17 +00:00
|
|
|
environment: &build-env
|
2019-08-02 19:15:59 +00:00
|
|
|
<<: *ENVIRONMENT
|
2019-01-28 16:18:30 +00:00
|
|
|
steps:
|
|
|
|
- checkout
|
2019-03-20 19:24:17 +00:00
|
|
|
- run: ./build-support/scripts/build-local.sh
|
2019-01-28 16:18:30 +00:00
|
|
|
|
|
|
|
# save dev build to CircleCI
|
|
|
|
- store_artifacts:
|
2019-03-20 19:24:17 +00:00
|
|
|
path: ./pkg/bin
|
2020-07-28 18:54:48 +00:00
|
|
|
- run: *notify-slack-failure
|
2019-03-20 19:24:17 +00:00
|
|
|
|
2019-04-02 16:24:48 +00:00
|
|
|
# build all 386 architecture supported OS binaries
|
2019-03-20 19:24:17 +00:00
|
|
|
build-386:
|
|
|
|
<<: *build-distros
|
|
|
|
environment:
|
|
|
|
<<: *build-env
|
|
|
|
XC_OS: "darwin freebsd linux windows"
|
|
|
|
XC_ARCH: "386"
|
|
|
|
|
2019-04-02 16:24:48 +00:00
|
|
|
# build all amd64 architecture supported OS binaries
|
2019-03-20 19:24:17 +00:00
|
|
|
build-amd64:
|
|
|
|
<<: *build-distros
|
|
|
|
environment:
|
|
|
|
<<: *build-env
|
|
|
|
XC_OS: "darwin freebsd linux solaris windows"
|
|
|
|
XC_ARCH: "amd64"
|
|
|
|
|
2019-04-02 16:24:48 +00:00
|
|
|
# build all arm/arm64 architecture supported OS binaries
|
2019-08-02 19:15:59 +00:00
|
|
|
build-arm:
|
|
|
|
docker:
|
|
|
|
- image: *GOLANG_IMAGE
|
2019-03-20 19:24:17 +00:00
|
|
|
environment:
|
2019-08-02 19:15:59 +00:00
|
|
|
<<: *ENVIRONMENT
|
|
|
|
CGO_ENABLED: 1
|
|
|
|
GOOS: linux
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run: sudo apt-get update && sudo apt-get install -y gcc-arm-linux-gnueabi gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu
|
|
|
|
- run:
|
|
|
|
environment:
|
|
|
|
GOARM: 5
|
|
|
|
CC: arm-linux-gnueabi-gcc
|
|
|
|
GOARCH: arm
|
2020-06-05 18:21:57 +00:00
|
|
|
command: go build -o ./pkg/bin/linux_armel/consul -ldflags="-linkmode=external ${GOLDFLAGS}"
|
2019-08-02 19:15:59 +00:00
|
|
|
- run:
|
|
|
|
environment:
|
|
|
|
GOARM: 6
|
|
|
|
CC: arm-linux-gnueabihf-gcc
|
|
|
|
GOARCH: arm
|
2020-06-05 18:21:57 +00:00
|
|
|
command: go build -o ./pkg/bin/linux_armhf/consul -ldflags="-linkmode=external ${GOLDFLAGS}"
|
2019-08-02 19:15:59 +00:00
|
|
|
- run:
|
|
|
|
environment:
|
|
|
|
CC: aarch64-linux-gnu-gcc
|
|
|
|
GOARCH: arm64
|
2020-06-05 18:21:57 +00:00
|
|
|
command: go build -o ./pkg/bin/linux_aarch64/consul -ldflags="-linkmode=external ${GOLDFLAGS}"
|
2019-08-02 19:15:59 +00:00
|
|
|
- store_artifacts:
|
|
|
|
path: ./pkg/bin
|
2020-07-28 18:54:48 +00:00
|
|
|
- run: *notify-slack-failure
|
2019-03-20 19:24:17 +00:00
|
|
|
|
2019-04-02 16:24:48 +00:00
|
|
|
# create a development build
|
2019-03-20 19:24:17 +00:00
|
|
|
dev-build:
|
|
|
|
docker:
|
|
|
|
- image: *GOLANG_IMAGE
|
2019-08-02 19:15:59 +00:00
|
|
|
environment:
|
|
|
|
<<: *ENVIRONMENT
|
2019-03-20 19:24:17 +00:00
|
|
|
steps:
|
|
|
|
- checkout
|
2020-03-27 19:33:49 +00:00
|
|
|
- attach_workspace: # this normally runs as the first job and has nothing to attach; only used in master branch after rebuilding UI
|
|
|
|
at: .
|
2019-05-17 15:42:56 +00:00
|
|
|
- run:
|
|
|
|
command: make dev
|
2019-01-28 16:18:30 +00:00
|
|
|
|
|
|
|
# save dev build to pass to downstream jobs
|
|
|
|
- persist_to_workspace:
|
|
|
|
root: /go/bin
|
|
|
|
paths:
|
|
|
|
- consul
|
2020-07-28 18:54:48 +00:00
|
|
|
- run: *notify-slack-failure
|
2019-01-28 16:18:30 +00:00
|
|
|
|
2019-04-02 16:24:48 +00:00
|
|
|
# upload development build to s3
|
|
|
|
dev-upload-s3:
|
|
|
|
docker:
|
2020-09-04 03:40:23 +00:00
|
|
|
- image: *GOLANG_IMAGE
|
2019-04-02 16:24:48 +00:00
|
|
|
environment:
|
|
|
|
<<: *ENVIRONMENT
|
|
|
|
steps:
|
2020-09-04 14:42:18 +00:00
|
|
|
- checkout
|
2020-09-04 03:40:23 +00:00
|
|
|
- *get-aws-cli
|
|
|
|
- *aws-assume-role
|
2019-04-02 16:24:48 +00:00
|
|
|
# get consul binary
|
|
|
|
- attach_workspace:
|
|
|
|
at: bin/
|
|
|
|
- run:
|
|
|
|
name: package binary
|
2020-09-30 20:49:50 +00:00
|
|
|
command: tar -czf consul.tar.gz -C bin/ consul
|
2019-04-02 16:24:48 +00:00
|
|
|
- run:
|
|
|
|
name: Upload to s3
|
|
|
|
command: |
|
2019-04-04 20:03:07 +00:00
|
|
|
if [ -n "${S3_ARTIFACT_PATH}" ]; then
|
|
|
|
aws s3 cp \
|
|
|
|
--metadata "CIRCLECI=${CIRCLECI},CIRCLE_BUILD_URL=${CIRCLE_BUILD_URL},CIRCLE_BRANCH=${CIRCLE_BRANCH}" \
|
|
|
|
"consul.tar.gz" "s3://${S3_ARTIFACT_BUCKET}/${S3_ARTIFACT_PATH}/${CIRCLE_SHA1}.tar.gz"
|
|
|
|
else
|
|
|
|
echo "CircleCI - S3_ARTIFACT_PATH was not set"
|
|
|
|
exit 1
|
|
|
|
fi
|
2020-07-28 18:54:48 +00:00
|
|
|
- run: *notify-slack-failure
|
2019-04-02 16:24:48 +00:00
|
|
|
|
2019-07-25 13:19:09 +00:00
|
|
|
# upload dev docker image
|
|
|
|
dev-upload-docker:
|
|
|
|
docker:
|
|
|
|
- image: circleci/golang:latest # use a circleci image so the attach_workspace step works (has ca-certs installed)
|
|
|
|
environment:
|
|
|
|
<<: *ENVIRONMENT
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
# get consul binary
|
|
|
|
- attach_workspace:
|
|
|
|
at: bin/
|
2020-02-12 18:56:16 +00:00
|
|
|
- setup_remote_docker
|
2019-07-25 13:19:09 +00:00
|
|
|
- run: make ci.dev-docker
|
2020-07-28 18:54:48 +00:00
|
|
|
- run: *notify-slack-failure
|
2019-07-25 13:19:09 +00:00
|
|
|
|
2019-01-28 16:18:30 +00:00
|
|
|
# Nomad 0.8 builds on go0.10
|
|
|
|
# Run integration tests on nomad/v0.8.7
|
|
|
|
nomad-integration-0_8:
|
2019-03-08 20:33:03 +00:00
|
|
|
docker:
|
|
|
|
- image: circleci/golang:1.10
|
|
|
|
environment:
|
|
|
|
<<: *ENVIRONMENT
|
|
|
|
NOMAD_WORKING_DIR: &NOMAD_WORKING_DIR /go/src/github.com/hashicorp/nomad
|
|
|
|
NOMAD_VERSION: v0.8.7
|
|
|
|
steps: &NOMAD_INTEGRATION_TEST_STEPS
|
|
|
|
- run: git clone https://github.com/hashicorp/nomad.git --branch ${NOMAD_VERSION} ${NOMAD_WORKING_DIR}
|
|
|
|
|
|
|
|
# get consul binary
|
|
|
|
- attach_workspace:
|
|
|
|
at: /go/bin
|
|
|
|
|
|
|
|
# make dev build of nomad
|
|
|
|
- run:
|
2019-10-15 20:58:50 +00:00
|
|
|
command: make pkg/linux_amd64/nomad
|
2019-03-08 20:33:03 +00:00
|
|
|
working_directory: *NOMAD_WORKING_DIR
|
|
|
|
|
2020-07-17 17:00:31 +00:00
|
|
|
- run: *install-gotestsum
|
2019-03-08 20:33:03 +00:00
|
|
|
|
|
|
|
# run integration tests
|
|
|
|
- run:
|
2020-03-31 15:32:48 +00:00
|
|
|
name: go test
|
|
|
|
command: |
|
|
|
|
mkdir -p $TEST_RESULTS_DIR
|
|
|
|
gotestsum \
|
|
|
|
--format=short-verbose \
|
|
|
|
--junitfile $TEST_RESULTS_DIR/results.xml -- \
|
|
|
|
./command/agent/consul -run TestConsul
|
2019-03-08 20:33:03 +00:00
|
|
|
working_directory: *NOMAD_WORKING_DIR
|
|
|
|
|
|
|
|
# store test results for CircleCI
|
|
|
|
- store_test_results:
|
|
|
|
path: *TEST_RESULTS_DIR
|
|
|
|
- store_artifacts:
|
|
|
|
path: *TEST_RESULTS_DIR
|
2020-07-28 18:54:48 +00:00
|
|
|
- run: *notify-slack-failure
|
2019-01-28 16:18:30 +00:00
|
|
|
|
|
|
|
# run integration tests on nomad/master
|
|
|
|
nomad-integration-master:
|
2019-03-08 20:33:03 +00:00
|
|
|
docker:
|
|
|
|
- image: *GOLANG_IMAGE
|
|
|
|
environment:
|
|
|
|
<<: *ENVIRONMENT
|
|
|
|
NOMAD_WORKING_DIR: /go/src/github.com/hashicorp/nomad
|
|
|
|
NOMAD_VERSION: master
|
|
|
|
steps: *NOMAD_INTEGRATION_TEST_STEPS
|
2019-01-28 16:18:30 +00:00
|
|
|
|
2020-04-13 23:41:41 +00:00
|
|
|
build-website-docker-image:
|
2018-11-16 19:01:02 +00:00
|
|
|
docker:
|
2020-04-13 23:41:41 +00:00
|
|
|
- image: circleci/buildpack-deps
|
|
|
|
shell: /usr/bin/env bash -euo pipefail -c
|
2019-04-04 22:54:47 +00:00
|
|
|
steps:
|
|
|
|
- checkout
|
2020-04-13 23:41:41 +00:00
|
|
|
- setup_remote_docker
|
|
|
|
- run:
|
|
|
|
name: Build Docker Image if Necessary
|
|
|
|
command: |
|
|
|
|
# Ignore job if running an enterprise build
|
|
|
|
IMAGE_TAG=$(cat website/Dockerfile website/package-lock.json | sha256sum | awk '{print $1;}')
|
|
|
|
echo "Using $IMAGE_TAG"
|
|
|
|
if [ "$CIRCLE_REPOSITORY_URL" != "git@github.com:hashicorp/consul.git" ]; then
|
|
|
|
echo "Not Consul OSS Repo, not building website docker image"
|
|
|
|
elif curl https://hub.docker.com/v2/repositories/hashicorp/consul-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/consul-website:$IMAGE_TAG .
|
|
|
|
docker tag hashicorp/consul-website:$IMAGE_TAG hashicorp/consul-website:latest
|
|
|
|
docker login -u $WEBSITE_DOCKER_USER -p $WEBSITE_DOCKER_PASS
|
|
|
|
docker push hashicorp/consul-website
|
|
|
|
fi
|
2020-07-28 18:54:48 +00:00
|
|
|
- run: *notify-slack-failure
|
2019-04-04 22:54:47 +00:00
|
|
|
|
2020-06-29 16:14:43 +00:00
|
|
|
algolia-index:
|
|
|
|
docker:
|
|
|
|
- image: node:12
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
name: Push content to Algolia Index
|
|
|
|
command: |
|
|
|
|
if [ "$CIRCLE_REPOSITORY_URL" != "git@github.com:hashicorp/consul.git" ]; then
|
|
|
|
echo "Not Consul OSS Repo, not indexing Algolia"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
cd website/
|
|
|
|
npm install
|
|
|
|
node scripts/index_search_content.js
|
2020-07-28 18:54:48 +00:00
|
|
|
- run: *notify-slack-failure
|
2020-06-29 16:14:43 +00:00
|
|
|
|
2019-01-04 03:57:40 +00:00
|
|
|
# build frontend yarn cache
|
2018-12-20 18:51:48 +00:00
|
|
|
frontend-cache:
|
|
|
|
docker:
|
2019-03-08 20:33:03 +00:00
|
|
|
- image: *EMBER_IMAGE
|
2018-12-20 18:51:48 +00:00
|
|
|
steps:
|
|
|
|
- checkout
|
2019-03-08 20:33:03 +00:00
|
|
|
|
2018-12-20 18:51:48 +00:00
|
|
|
# cache yarn deps
|
|
|
|
- restore_cache:
|
2019-03-08 20:33:03 +00:00
|
|
|
key: *YARN_CACHE_KEY
|
|
|
|
|
2018-12-20 18:51:48 +00:00
|
|
|
- run:
|
|
|
|
name: install yarn packages
|
|
|
|
command: cd ui-v2 && yarn install
|
2019-03-08 20:33:03 +00:00
|
|
|
|
2018-12-20 18:51:48 +00:00
|
|
|
- save_cache:
|
2019-03-08 20:33:03 +00:00
|
|
|
key: *YARN_CACHE_KEY
|
2018-12-20 18:51:48 +00:00
|
|
|
paths:
|
|
|
|
- ui-v2/node_modules
|
2020-07-28 18:54:48 +00:00
|
|
|
- run: *notify-slack-failure
|
2019-03-08 20:33:03 +00:00
|
|
|
|
2018-12-20 18:51:48 +00:00
|
|
|
# build ember so frontend tests run faster
|
2020-06-16 18:19:43 +00:00
|
|
|
ember-build-oss: &ember-build-oss
|
2018-12-20 18:51:48 +00:00
|
|
|
docker:
|
2019-03-08 20:33:03 +00:00
|
|
|
- image: *EMBER_IMAGE
|
2020-05-19 17:00:35 +00:00
|
|
|
environment:
|
|
|
|
JOBS: 2 # limit parallelism for broccoli-babel-transpiler
|
2020-06-16 18:19:43 +00:00
|
|
|
CONSUL_NSPACES_ENABLED: 0
|
2018-12-20 18:51:48 +00:00
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_cache:
|
2019-03-08 20:33:03 +00:00
|
|
|
key: *YARN_CACHE_KEY
|
ui: UI Release Merge (ui-staging merge) (#6527)
## HTTPAdapter (#5637)
## Ember upgrade 2.18 > 3.12 (#6448)
### Proxies can no longer get away with not calling _super
This means that we can't use create anymore to define dynamic methods.
Therefore we dynamically make 2 extended Proxies on demand, and then
create from those. Therefore we can call _super in the init method of
the extended Proxies.
### We aren't allowed to reset a service anymore
We never actually need to now anyway, this is a remnant of the refactor
from browser based confirmations. We fix it as simply as possible here
but will revisit and remove the old browser confirm functionality at a
later date
### Revert classes to use ES5 style to workaround babel transp. probs
Using a mixture of ES6 classes (and hence super) and arrow functions
means that when babel transpiles the arrow functions down to ES5, a
reference to this is moved before the call to super, hence causing a js
error.
Furthermore, we the testing environment no longer lets use use
apply/call on the constructor.
These errors only manifests during testing (only in the testing
environment), the application itself runs fine with no problems without
this change.
Using ES5 style class definitions give us freedom to do all of the above
without causing any errors, so we reverted these classes back to ES5
class definitions
### Skip test that seems to have changed due to a change in RSVP timing
This test tests a usecase/area of the API that will probably never ever
be used, it was more testing out the API. We've skipped the test for now
as this doesn't affect the application itself, but left a note to come
back here later to investigate further
### Remove enumerableContentDidChange
Initial testing looks like we don't need to call this function anymore,
the function no longer exists
### Rework Changeset.isSaving to take into account new ember APIs
Setting/hanging a computedProperty of an instantiated object no longer
works. Move to setting it on the prototype/class definition instead
### Change how we detect whether something requires listening
New ember API's have changed how you can detect whether something is a
computedProperty or not. It's not immediately clear if its even possible
now. Therefore we change how we detect whether something should be
listened to or not by just looking for presence of `addEventListener`
### Potentially temporary change of ci test scripts to ensure deps exist
All our tooling scripts run through a Makefile (for people familiar with
only using those), which then call yarn scripts which can be called
independently (for people familar with only using yarn).
The Makefile targets always check to make sure all the dependencies are
installed before running anything that requires them (building, testing
etc).
The CI scripts/targets didn't follow this same route and called the yarn
scripts directly (usually CI builds a cache of the dependencies first).
For some reason this cache isn't doing what it usually does, and it
looks as though, in CI, ember isn't installed.
This commit makes the CI scripts consistently use the same method as all
of the other tooling scripts (Makefile target > Install Deps if
required > call yarn script). This should install the dependencies if
for some reason the CI cache building doesn't complete/isn't successful.
Potentially this commit may be reverted if, the root of the problem is
elsewhere, although consistency is always good, so it might be a good
idea to leave this commit as is even if we need to debug and fix things
elsewhere.
### Make test-parallel consistent with the rest of the tooling scripts
As we are here making changes for CI purposes (making test-ci
consistent), we spotted that test-parallel is also inconsistent and also
the README manual instructions won't work without `ember` installed
globally.
This commit makes everything consistent and changes the manual
instructions to use the local ember instance that gets installed via
yarn
### Re-wrangle catchable to fit with new ember 3.12 APIs
In the upgrade from ember 3.8 > 3.12 the public interfaces for
ComputedProperties have changed slightly. `meta` is no longer a public
property of ComputedProperty but of a ComputedDecoratorImpl mixin
instead.
https://github.com/emberjs/ember.js/blob/7e4ba1096e3c2e3e0dde186d5ca52ff19cb8720a/packages/%40ember/-internals/metal/lib/computed.ts#L725
There seems to be no way, by just using publically available
methods, to replicate this behaviour so that we can create our own
'ComputedProperty` factory via injecting the ComputedProperty class as
we did previously.
https://github.com/hashicorp/consul/blob/3f333bada181aaf6340523ca2268a28d1a7db214/ui-v2/app/utils/computed/factory.js#L1-L18
Instead we dynamically hang our `Catchable` `catch` method off the
instantiated ComputedProperty. In doing it like this `ComputedProperty`
has already has its `meta` method mixed in so we don't have to manually
mix it in ourselves (which doesn't seem possible)
This functionality is only used during our work in trying to ensure
our EventSource/BlockingQuery work was as 'ember-like' as possible (i.e.
using the traditional Route.model hooks and ember-like Controller
properties). Our ongoing/upcoming work on a componentized approach to
data a.k.a `<DataSource />` means we will be able to remove the majority
of the code involved here now that it seems to be under an amount of
flux in ember.
### Build bindata_assetfs.go with new UI changes
2019-09-30 13:47:49 +00:00
|
|
|
- run: cd ui-v2 && make build-ci
|
2018-12-20 18:51:48 +00:00
|
|
|
|
|
|
|
# saves the build to a workspace to be passed to a downstream job
|
|
|
|
- persist_to_workspace:
|
|
|
|
root: ui-v2
|
|
|
|
paths:
|
|
|
|
- dist
|
2020-07-28 18:54:48 +00:00
|
|
|
- run: *notify-slack-failure
|
2019-01-04 03:57:40 +00:00
|
|
|
|
2020-06-16 18:19:43 +00:00
|
|
|
# build ember so frontend tests run faster
|
|
|
|
ember-build-ent:
|
|
|
|
<<: *ember-build-oss
|
|
|
|
environment:
|
|
|
|
JOBS: 2 # limit parallelism for broccoli-babel-transpiler
|
|
|
|
CONSUL_NSPACES_ENABLED: 1
|
|
|
|
|
2020-03-27 19:33:49 +00:00
|
|
|
# rebuild UI for packaging
|
|
|
|
ember-build-prod:
|
|
|
|
docker:
|
|
|
|
- image: *EMBER_IMAGE
|
2020-05-19 17:00:35 +00:00
|
|
|
environment:
|
|
|
|
JOBS: 2 # limit parallelism for broccoli-babel-transpiler
|
2020-03-27 19:33:49 +00:00
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_cache:
|
|
|
|
key: *YARN_CACHE_KEY
|
|
|
|
- run: cd ui-v2 && make
|
|
|
|
|
|
|
|
# saves the build to a workspace to be passed to a downstream job
|
|
|
|
- persist_to_workspace:
|
|
|
|
root: ui-v2
|
|
|
|
paths:
|
|
|
|
- dist
|
2020-07-28 18:54:48 +00:00
|
|
|
- run: *notify-slack-failure
|
2020-03-27 19:33:49 +00:00
|
|
|
|
|
|
|
# build static-assets file
|
|
|
|
build-static-assets:
|
|
|
|
docker:
|
|
|
|
- image: *GOLANG_IMAGE
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- attach_workspace:
|
|
|
|
at: ./pkg
|
|
|
|
- run: mv pkg/dist pkg/web_ui # 'make static-assets' looks for the 'pkg/web_ui' path
|
|
|
|
- run: make tools
|
|
|
|
- run: make static-assets
|
|
|
|
- persist_to_workspace:
|
|
|
|
root: .
|
|
|
|
paths:
|
2020-10-01 15:19:10 +00:00
|
|
|
- ./agent/uiserver/bindata_assetfs.go
|
2020-07-28 18:54:48 +00:00
|
|
|
- run: *notify-slack-failure
|
2020-03-27 19:33:49 +00:00
|
|
|
|
2020-09-29 21:03:45 +00:00
|
|
|
# commits static assets to git
|
|
|
|
publish-static-assets:
|
|
|
|
docker:
|
|
|
|
- image: *GOLANG_IMAGE
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- add_ssh_keys: # needs a key to push updated static asset commit back to github
|
|
|
|
fingerprints:
|
|
|
|
- "c9:04:b7:85:bf:0e:ce:93:5f:b8:0e:68:8e:16:f3:71"
|
|
|
|
- attach_workspace:
|
|
|
|
at: .
|
|
|
|
- run:
|
2020-10-02 19:23:38 +00:00
|
|
|
name: commit agent/uiserver/bindata_assetfs.go if there are UI changes
|
2020-09-29 21:03:45 +00:00
|
|
|
command: |
|
2020-10-02 19:23:38 +00:00
|
|
|
# check if there are any changes in ui-v2/
|
|
|
|
# if there are, we commit the ui static asset file
|
|
|
|
# HEAD^! is shorthand for HEAD^..HEAD (parent of HEAD and HEAD)
|
|
|
|
if ! git diff --quiet --exit-code HEAD^! ui-v2/; then
|
2020-09-30 15:12:36 +00:00
|
|
|
git config --local user.email "hashicorp-ci@users.noreply.github.com"
|
|
|
|
git config --local user.name "hashicorp-ci"
|
|
|
|
|
|
|
|
short_sha=$(git rev-parse --short HEAD)
|
2020-10-01 15:19:10 +00:00
|
|
|
git add agent/uiserver/bindata_assetfs.go
|
|
|
|
git commit -m "auto-updated agent/uiserver/bindata_assetfs.go from commit ${short_sha}"
|
2020-09-29 21:03:45 +00:00
|
|
|
git push origin master
|
|
|
|
else
|
2020-10-02 19:23:38 +00:00
|
|
|
echo "no UI changes so no static assets to publish"
|
2020-09-29 21:03:45 +00:00
|
|
|
fi
|
|
|
|
- run: *notify-slack-failure
|
|
|
|
|
2020-10-06 19:58:12 +00:00
|
|
|
# run node tests
|
|
|
|
node-tests:
|
|
|
|
docker:
|
|
|
|
- image: *EMBER_IMAGE
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_cache:
|
|
|
|
key: *YARN_CACHE_KEY
|
|
|
|
- attach_workspace:
|
|
|
|
at: ui-v2
|
|
|
|
- run:
|
|
|
|
working_directory: ui-v2
|
|
|
|
command: make test-node
|
|
|
|
- run: *notify-slack-failure
|
|
|
|
|
2019-01-04 03:57:40 +00:00
|
|
|
# run ember frontend tests
|
2020-02-07 11:02:53 +00:00
|
|
|
ember-test-oss:
|
2018-12-20 18:51:48 +00:00
|
|
|
docker:
|
2019-03-08 20:33:03 +00:00
|
|
|
- image: *EMBER_IMAGE
|
2018-12-20 18:51:48 +00:00
|
|
|
environment:
|
2020-02-07 11:02:53 +00:00
|
|
|
EMBER_TEST_REPORT: test-results/report-oss.xml #outputs test report for CircleCI test summary
|
2020-02-10 13:41:02 +00:00
|
|
|
EMBER_TEST_PARALLEL: true #enables test parallelization with ember-exam
|
|
|
|
CONSUL_NSPACES_ENABLED: 0
|
2020-06-16 18:19:43 +00:00
|
|
|
parallelism: 4
|
2020-02-07 11:02:53 +00:00
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_cache:
|
|
|
|
key: *YARN_CACHE_KEY
|
|
|
|
- attach_workspace:
|
|
|
|
at: ui-v2
|
|
|
|
- run:
|
|
|
|
working_directory: ui-v2
|
2020-02-19 19:10:02 +00:00
|
|
|
command: node_modules/.bin/ember exam --split=$CIRCLE_NODE_TOTAL --partition=`expr $CIRCLE_NODE_INDEX + 1` --path dist --silent -r xunit
|
2020-02-07 11:02:53 +00:00
|
|
|
- store_test_results:
|
|
|
|
path: ui-v2/test-results
|
2020-07-28 18:54:48 +00:00
|
|
|
- run: *notify-slack-failure
|
|
|
|
|
2020-02-07 11:02:53 +00:00
|
|
|
# run ember frontend tests
|
|
|
|
ember-test-ent:
|
|
|
|
docker:
|
|
|
|
- image: *EMBER_IMAGE
|
|
|
|
environment:
|
|
|
|
EMBER_TEST_REPORT: test-results/report-ent.xml #outputs test report for CircleCI test summary
|
2020-02-10 13:41:02 +00:00
|
|
|
EMBER_TEST_PARALLEL: true #enables test parallelization with ember-exam
|
2020-06-16 18:19:43 +00:00
|
|
|
parallelism: 4
|
2018-12-20 18:51:48 +00:00
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_cache:
|
2019-03-08 20:33:03 +00:00
|
|
|
key: *YARN_CACHE_KEY
|
2018-12-20 18:51:48 +00:00
|
|
|
- attach_workspace:
|
|
|
|
at: ui-v2
|
|
|
|
- run:
|
|
|
|
working_directory: ui-v2
|
2020-02-19 19:10:02 +00:00
|
|
|
command: node_modules/.bin/ember exam --split=$CIRCLE_NODE_TOTAL --partition=`expr $CIRCLE_NODE_INDEX + 1` --path dist --silent -r xunit
|
2018-12-20 18:51:48 +00:00
|
|
|
- store_test_results:
|
|
|
|
path: ui-v2/test-results
|
2020-07-28 18:54:48 +00:00
|
|
|
- run: *notify-slack-failure
|
|
|
|
|
2020-02-10 10:04:55 +00:00
|
|
|
# run ember frontend unit tests to produce coverage report
|
|
|
|
ember-coverage:
|
|
|
|
docker:
|
|
|
|
- image: *EMBER_IMAGE
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_cache:
|
|
|
|
key: *YARN_CACHE_KEY
|
|
|
|
- attach_workspace:
|
|
|
|
at: ui-v2
|
|
|
|
- run:
|
|
|
|
working_directory: ui-v2
|
2020-02-21 13:44:25 +00:00
|
|
|
command: make test-coverage-ci
|
2020-02-10 10:04:55 +00:00
|
|
|
- run:
|
|
|
|
name: codecov ui upload
|
|
|
|
working_directory: ui-v2
|
|
|
|
command: bash <(curl -s https://codecov.io/bash) -v -c -C $CIRCLE_SHA1 -F ui
|
2020-07-28 18:54:48 +00:00
|
|
|
- run: *notify-slack-failure
|
2018-12-20 18:51:48 +00:00
|
|
|
|
2020-07-31 20:52:49 +00:00
|
|
|
envoy-integration-test-1.12.6:
|
2019-04-29 16:27:57 +00:00
|
|
|
docker:
|
|
|
|
# We only really need bash and docker-compose which is installed on all
|
|
|
|
# Circle images but pick Go since we have to pick one of them.
|
|
|
|
- image: *GOLANG_IMAGE
|
|
|
|
environment:
|
2020-07-31 20:52:49 +00:00
|
|
|
ENVOY_VERSION: "1.12.6"
|
2019-08-21 19:56:27 +00:00
|
|
|
steps: &ENVOY_INTEGRATION_TEST_STEPS
|
2019-04-29 16:27:57 +00:00
|
|
|
- checkout
|
|
|
|
# Get go binary from workspace
|
|
|
|
- attach_workspace:
|
|
|
|
at: .
|
2020-02-12 18:56:16 +00:00
|
|
|
- setup_remote_docker
|
2019-04-29 16:27:57 +00:00
|
|
|
# Build the consul-dev image from the already built binary
|
|
|
|
- run: docker build -t consul-dev -f ./build-support/docker/Consul-Dev.dockerfile .
|
|
|
|
- run:
|
|
|
|
name: Envoy Integration Tests
|
2020-05-19 18:00:00 +00:00
|
|
|
command: |
|
|
|
|
mkdir -p /tmp/test-results/
|
|
|
|
gotestsum -- -timeout=30m -tags integration ./test/integration/connect/envoy
|
2019-04-29 16:27:57 +00:00
|
|
|
environment:
|
2020-05-19 18:00:00 +00:00
|
|
|
GOTESTSUM_JUNITFILE: /tmp/test-results/results.xml
|
|
|
|
GOTESTSUM_FORMAT: standard-verbose
|
|
|
|
COMPOSE_INTERACTIVE_NO_CLI: 1
|
2019-04-29 16:27:57 +00:00
|
|
|
# tput complains if this isn't set to something.
|
|
|
|
TERM: ansi
|
|
|
|
- store_artifacts:
|
|
|
|
path: ./test/integration/connect/envoy/workdir/logs
|
|
|
|
destination: container-logs
|
2020-05-19 18:00:00 +00:00
|
|
|
- store_test_results:
|
|
|
|
path: *TEST_RESULTS_DIR
|
|
|
|
- store_artifacts:
|
|
|
|
path: *TEST_RESULTS_DIR
|
2020-07-28 18:54:48 +00:00
|
|
|
- run: *notify-slack-failure
|
2019-04-29 16:27:57 +00:00
|
|
|
|
2020-07-31 20:52:49 +00:00
|
|
|
envoy-integration-test-1.13.4:
|
2019-04-29 16:27:57 +00:00
|
|
|
docker:
|
|
|
|
- image: *GOLANG_IMAGE
|
|
|
|
environment:
|
2020-07-31 20:52:49 +00:00
|
|
|
ENVOY_VERSION: "1.13.4"
|
2019-04-29 16:27:57 +00:00
|
|
|
steps: *ENVOY_INTEGRATION_TEST_STEPS
|
|
|
|
|
2020-07-31 20:52:49 +00:00
|
|
|
envoy-integration-test-1.14.4:
|
2019-06-07 12:10:43 +00:00
|
|
|
docker:
|
|
|
|
- image: *GOLANG_IMAGE
|
|
|
|
environment:
|
2020-07-31 20:52:49 +00:00
|
|
|
ENVOY_VERSION: "1.14.4"
|
2019-06-07 12:10:43 +00:00
|
|
|
steps: *ENVOY_INTEGRATION_TEST_STEPS
|
|
|
|
|
2020-07-31 20:52:49 +00:00
|
|
|
envoy-integration-test-1.15.0:
|
2019-08-20 14:20:13 +00:00
|
|
|
docker:
|
|
|
|
- image: *GOLANG_IMAGE
|
|
|
|
environment:
|
2020-07-31 20:52:49 +00:00
|
|
|
ENVOY_VERSION: "1.15.0"
|
2019-08-20 14:20:13 +00:00
|
|
|
steps: *ENVOY_INTEGRATION_TEST_STEPS
|
|
|
|
|
2020-03-24 19:16:13 +00:00
|
|
|
# run integration tests for the connect ca providers
|
|
|
|
test-connect-ca-providers:
|
2019-12-17 21:22:32 +00:00
|
|
|
docker:
|
|
|
|
- image: *GOLANG_IMAGE
|
|
|
|
environment:
|
|
|
|
<<: *ENVIRONMENT
|
|
|
|
steps:
|
2020-03-31 15:32:48 +00:00
|
|
|
- run:
|
|
|
|
name: Install vault
|
|
|
|
command: |
|
|
|
|
wget -q -O /tmp/vault.zip https://releases.hashicorp.com/vault/${VAULT_BINARY_VERSION}/vault_${VAULT_BINARY_VERSION}_linux_amd64.zip
|
|
|
|
sudo unzip -d /usr/local/bin /tmp/vault.zip
|
|
|
|
rm -rf /tmp/vault*
|
2019-12-17 21:22:32 +00:00
|
|
|
- checkout
|
2020-03-31 15:32:48 +00:00
|
|
|
- run: go mod download
|
|
|
|
- run:
|
|
|
|
name: go test
|
|
|
|
command: |
|
|
|
|
mkdir -p $TEST_RESULTS_DIR
|
|
|
|
make test-connect-ca-providers
|
2019-12-17 21:22:32 +00:00
|
|
|
- store_test_results:
|
2019-12-17 23:18:10 +00:00
|
|
|
path: *TEST_RESULTS_DIR
|
2020-10-07 20:32:25 +00:00
|
|
|
- run: *codecov_upload
|
2020-07-28 18:54:48 +00:00
|
|
|
- run: *notify-slack-failure
|
2019-12-17 21:22:32 +00:00
|
|
|
|
2020-03-06 22:59:14 +00:00
|
|
|
# only runs on master: checks latest commit to see if the PR associated has a backport/* or docs* label to cherry-pick
|
|
|
|
cherry-picker:
|
|
|
|
docker:
|
2020-03-23 18:18:45 +00:00
|
|
|
- image: alpine:3.11
|
2020-03-06 22:59:14 +00:00
|
|
|
steps:
|
2020-03-26 19:23:31 +00:00
|
|
|
- run: apk add --no-cache --no-progress git bash curl ncurses jq openssh-client
|
2020-03-06 22:59:14 +00:00
|
|
|
- checkout
|
|
|
|
- add_ssh_keys: # needs a key to push cherry-picked commits back to github
|
|
|
|
fingerprints:
|
|
|
|
- "c9:04:b7:85:bf:0e:ce:93:5f:b8:0e:68:8e:16:f3:71"
|
|
|
|
- run: .circleci/scripts/cherry-picker.sh
|
2020-07-28 18:54:48 +00:00
|
|
|
- run: *notify-slack-failure
|
2020-03-06 22:59:14 +00:00
|
|
|
|
2018-11-16 19:01:02 +00:00
|
|
|
workflows:
|
|
|
|
version: 2
|
2019-07-22 22:08:54 +00:00
|
|
|
go-tests:
|
2019-03-20 19:24:17 +00:00
|
|
|
jobs:
|
2020-04-07 19:39:23 +00:00
|
|
|
- check-vendor: &filter-ignore-non-go-branches
|
2019-11-08 17:55:56 +00:00
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
ignore:
|
|
|
|
- stable-website
|
2020-02-14 02:41:37 +00:00
|
|
|
- /^docs\/.*/
|
2020-02-14 14:40:02 +00:00
|
|
|
- /^ui\/.*/
|
2020-07-27 18:18:09 +00:00
|
|
|
- check-generated-protobuf: *filter-ignore-non-go-branches
|
2020-04-07 19:39:23 +00:00
|
|
|
- lint-consul-retry: *filter-ignore-non-go-branches
|
|
|
|
- lint: *filter-ignore-non-go-branches
|
|
|
|
- test-connect-ca-providers: *filter-ignore-non-go-branches
|
|
|
|
- dev-build: *filter-ignore-non-go-branches
|
2020-03-31 15:32:48 +00:00
|
|
|
- go-test:
|
|
|
|
requires: [dev-build]
|
|
|
|
- go-test-api:
|
|
|
|
requires: [dev-build]
|
2020-07-08 22:41:15 +00:00
|
|
|
- go-test-race: *filter-ignore-non-go-branches
|
2020-04-07 19:39:23 +00:00
|
|
|
- go-test-sdk: *filter-ignore-non-go-branches
|
2019-07-22 22:08:54 +00:00
|
|
|
build-distros:
|
|
|
|
jobs:
|
2020-04-07 19:39:23 +00:00
|
|
|
- check-vendor: *filter-ignore-non-go-branches
|
2019-10-08 19:55:36 +00:00
|
|
|
- build-386: &require-check-vendor
|
|
|
|
requires:
|
|
|
|
- check-vendor
|
|
|
|
- build-amd64: *require-check-vendor
|
|
|
|
- build-arm: *require-check-vendor
|
2020-03-27 19:33:49 +00:00
|
|
|
# every commit on ui-staging and master will have a rebuilt UI
|
|
|
|
- frontend-cache:
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
- ui-staging
|
|
|
|
- ember-build-prod:
|
|
|
|
requires:
|
|
|
|
- frontend-cache
|
|
|
|
- build-static-assets:
|
|
|
|
requires:
|
|
|
|
- ember-build-prod
|
2020-09-29 21:03:45 +00:00
|
|
|
- publish-static-assets:
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
requires:
|
|
|
|
- build-static-assets
|
2020-03-27 19:33:49 +00:00
|
|
|
- dev-build:
|
|
|
|
requires:
|
|
|
|
- build-static-assets
|
|
|
|
- dev-upload-s3:
|
|
|
|
requires:
|
|
|
|
- dev-build
|
|
|
|
- dev-upload-docker:
|
|
|
|
requires:
|
|
|
|
- dev-build
|
|
|
|
context: consul-ci
|
2019-07-22 22:08:54 +00:00
|
|
|
test-integrations:
|
|
|
|
jobs:
|
2020-04-07 19:39:23 +00:00
|
|
|
- dev-build: *filter-ignore-non-go-branches
|
2019-07-25 13:19:09 +00:00
|
|
|
- dev-upload-s3: &dev-upload
|
2019-04-02 16:24:48 +00:00
|
|
|
requires:
|
|
|
|
- dev-build
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
ignore:
|
|
|
|
- /^pull\/.*$/ # only push dev builds from non forks
|
2020-03-27 19:33:49 +00:00
|
|
|
- master # all master dev uploads will include a UI rebuild in build-distros
|
|
|
|
- ui-staging # all ui-staging dev uploads will include a UI rebuild in build-distros
|
2019-07-25 13:19:09 +00:00
|
|
|
- dev-upload-docker:
|
|
|
|
<<: *dev-upload
|
|
|
|
context: consul-ci
|
2019-01-28 16:18:30 +00:00
|
|
|
- nomad-integration-master:
|
|
|
|
requires:
|
2019-03-08 20:33:03 +00:00
|
|
|
- dev-build
|
2019-01-28 16:18:30 +00:00
|
|
|
- nomad-integration-0_8:
|
|
|
|
requires:
|
|
|
|
- dev-build
|
2020-07-13 20:44:44 +00:00
|
|
|
- envoy-integration-test-1.12.6:
|
2019-06-07 12:10:43 +00:00
|
|
|
requires:
|
|
|
|
- dev-build
|
2020-07-13 20:44:44 +00:00
|
|
|
- envoy-integration-test-1.13.4:
|
2020-04-09 18:58:22 +00:00
|
|
|
requires:
|
|
|
|
- dev-build
|
2020-07-13 20:44:44 +00:00
|
|
|
- envoy-integration-test-1.14.4:
|
2019-08-26 21:30:17 +00:00
|
|
|
requires:
|
|
|
|
- dev-build
|
2020-07-31 20:52:49 +00:00
|
|
|
- envoy-integration-test-1.15.0:
|
|
|
|
requires:
|
|
|
|
- dev-build
|
2018-11-16 19:01:02 +00:00
|
|
|
website:
|
|
|
|
jobs:
|
2020-04-13 23:41:41 +00:00
|
|
|
- build-website-docker-image:
|
2020-04-28 16:57:18 +00:00
|
|
|
context: website-docker-image
|
2019-04-05 14:38:27 +00:00
|
|
|
filters:
|
|
|
|
branches:
|
2020-04-13 23:41:41 +00:00
|
|
|
only:
|
|
|
|
- master
|
2020-06-29 16:14:43 +00:00
|
|
|
- algolia-index:
|
|
|
|
context: consul-docs
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- stable-website
|
2018-12-20 18:51:48 +00:00
|
|
|
frontend:
|
|
|
|
jobs:
|
2019-11-08 17:55:56 +00:00
|
|
|
- frontend-cache:
|
|
|
|
filters:
|
|
|
|
branches:
|
2020-05-13 19:40:30 +00:00
|
|
|
only:
|
|
|
|
- master
|
|
|
|
- ui-staging
|
|
|
|
- /^ui\/.*/
|
2020-10-06 19:58:12 +00:00
|
|
|
- node-tests:
|
|
|
|
requires:
|
|
|
|
- frontend-cache
|
2020-06-16 18:19:43 +00:00
|
|
|
- ember-build-oss:
|
|
|
|
requires:
|
|
|
|
- frontend-cache
|
|
|
|
- ember-build-ent:
|
2018-12-20 18:51:48 +00:00
|
|
|
requires:
|
|
|
|
- frontend-cache
|
2020-02-07 11:02:53 +00:00
|
|
|
- ember-test-oss:
|
|
|
|
requires:
|
2020-06-16 18:19:43 +00:00
|
|
|
- ember-build-oss
|
2020-02-07 11:02:53 +00:00
|
|
|
- ember-test-ent:
|
2018-12-20 18:51:48 +00:00
|
|
|
requires:
|
2020-06-16 18:19:43 +00:00
|
|
|
- ember-build-ent
|
2020-02-10 10:04:55 +00:00
|
|
|
- ember-coverage:
|
|
|
|
requires:
|
2020-06-16 18:19:43 +00:00
|
|
|
- ember-build-ent
|
2020-03-06 22:59:14 +00:00
|
|
|
cherry-pick:
|
|
|
|
jobs:
|
|
|
|
- cherry-picker:
|
|
|
|
context: team-consul
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- master
|