open-nomad/.circleci/config.yml
2020-02-06 18:58:07 -05:00

912 lines
29 KiB
YAML
Generated

### ***
### 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'.
### ***
version: 2
jobs:
test-nomad:
machine:
image: ubuntu-1604:201903-01
working_directory: ~/go/src/github.com/hashicorp/nomad
environment:
- GIT_PAGER: cat
- GOLANG_VERSION: 1.12.16
- GOMAXPROCS: 1
- GOPATH: /home/circleci/go
- GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml
- NOMAD_SLOW_TEST: 1
- PAGER: cat
- GOTEST_PKGS: ./nomad/...
- GOTEST_PKGS_EXCLUDE: ''
- GOTESTARCH: amd64
steps:
- checkout
- run:
command: |
set -x
echo installing golang ${GOLANG_VERSION}
sudo rm -rf /usr/local/go
wget -O /tmp/golang.tar.gz https://dl.google.com/go/go${GOLANG_VERSION}.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf /tmp/golang.tar.gz
rm -rf /tmp/golang.tar.gz
name: install golang
- run:
command: |
sudo rm -rf /usr/bin/protoc
sudo ./scripts/vagrant-linux-priv-protoc.sh
name: install protoc
- run:
command: |
wget -q -O /tmp/consul.zip https://releases.hashicorp.com/consul/1.6.1/consul_1.6.1_linux_amd64.zip
sudo unzip -d /usr/local/bin /tmp/consul.zip
rm -rf /tmp/consul*
name: Install Consul 1.6.1
- run:
command: |
wget -q -O /tmp/vault.zip https://releases.hashicorp.com/vault/1.2.3/vault_1.2.3_linux_amd64.zip
sudo unzip -d /usr/local/bin /tmp/vault.zip
rm -rf /tmp/vault*
name: Install Vault 1.2.3
- run:
command: |
if [ ! -z $GOTESTARCH ] && [ $GOTESTARCH == "386" ]; then
sudo apt-get update
sudo apt-get install -y gcc-multilib
else
echo "Skipping 32bit lib installation while building for not 386"
fi
name: Install 32bit gcc libs
- run:
command: PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make bootstrap
- run:
command: |
if [ -z $GOTEST_PKGS_EXCLUDE ];
then
unset GOTEST_PKGS_EXCLUDE
else
unset GOTEST_PKGS
fi
if [ ! -z $GOTESTARCH ]; then
export GOARCH="$GOTESTARCH";
fi
mkdir -p /tmp/test-reports
sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make generate-structs
sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make test-nomad
name: Running Nomad Tests
no_output_timeout: 20m
- store_test_results:
path: /tmp/test-reports
- store_artifacts:
path: /tmp/test-reports
test-api:
machine:
image: ubuntu-1604:201903-01
working_directory: ~/go/src/github.com/hashicorp/nomad
environment:
- GIT_PAGER: cat
- GOLANG_VERSION: 1.12.16
- GOMAXPROCS: 1
- GOPATH: /home/circleci/go
- GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml
- NOMAD_SLOW_TEST: 1
- PAGER: cat
- GOTEST_PKGS: ./api/...
- GOTEST_PKGS_EXCLUDE: ''
- GOTESTARCH: amd64
steps:
- checkout
- run:
command: |
set -x
echo installing golang ${GOLANG_VERSION}
sudo rm -rf /usr/local/go
wget -O /tmp/golang.tar.gz https://dl.google.com/go/go${GOLANG_VERSION}.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf /tmp/golang.tar.gz
rm -rf /tmp/golang.tar.gz
name: install golang
- run:
command: |
sudo rm -rf /usr/bin/protoc
sudo ./scripts/vagrant-linux-priv-protoc.sh
name: install protoc
- run:
command: |
wget -q -O /tmp/consul.zip https://releases.hashicorp.com/consul/1.6.1/consul_1.6.1_linux_amd64.zip
sudo unzip -d /usr/local/bin /tmp/consul.zip
rm -rf /tmp/consul*
name: Install Consul 1.6.1
- run:
command: |
wget -q -O /tmp/vault.zip https://releases.hashicorp.com/vault/1.2.3/vault_1.2.3_linux_amd64.zip
sudo unzip -d /usr/local/bin /tmp/vault.zip
rm -rf /tmp/vault*
name: Install Vault 1.2.3
- run:
command: |
if [ ! -z $GOTESTARCH ] && [ $GOTESTARCH == "386" ]; then
sudo apt-get update
sudo apt-get install -y gcc-multilib
else
echo "Skipping 32bit lib installation while building for not 386"
fi
name: Install 32bit gcc libs
- run:
command: PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make bootstrap
- run:
command: |
if [ -z $GOTEST_PKGS_EXCLUDE ];
then
unset GOTEST_PKGS_EXCLUDE
else
unset GOTEST_PKGS
fi
if [ ! -z $GOTESTARCH ]; then
export GOARCH="$GOTESTARCH";
fi
mkdir -p /tmp/test-reports
sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make generate-structs
sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make test-nomad
name: Running Nomad Tests
no_output_timeout: 20m
- store_test_results:
path: /tmp/test-reports
- store_artifacts:
path: /tmp/test-reports
test-exec:
machine:
image: ubuntu-1604:201903-01
working_directory: ~/go/src/github.com/hashicorp/nomad
environment:
- GIT_PAGER: cat
- GOLANG_VERSION: 1.12.16
- GOMAXPROCS: 1
- GOPATH: /home/circleci/go
- GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml
- NOMAD_SLOW_TEST: 1
- PAGER: cat
- GOTEST_PKGS: ./drivers/exec
- GOTEST_PKGS_EXCLUDE: ''
- GOTESTARCH: amd64
steps:
- checkout
- run:
command: |
set -x
echo installing golang ${GOLANG_VERSION}
sudo rm -rf /usr/local/go
wget -O /tmp/golang.tar.gz https://dl.google.com/go/go${GOLANG_VERSION}.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf /tmp/golang.tar.gz
rm -rf /tmp/golang.tar.gz
name: install golang
- run:
command: |
sudo rm -rf /usr/bin/protoc
sudo ./scripts/vagrant-linux-priv-protoc.sh
name: install protoc
- run:
command: |
wget -q -O /tmp/consul.zip https://releases.hashicorp.com/consul/1.6.1/consul_1.6.1_linux_amd64.zip
sudo unzip -d /usr/local/bin /tmp/consul.zip
rm -rf /tmp/consul*
name: Install Consul 1.6.1
- run:
command: |
wget -q -O /tmp/vault.zip https://releases.hashicorp.com/vault/1.2.3/vault_1.2.3_linux_amd64.zip
sudo unzip -d /usr/local/bin /tmp/vault.zip
rm -rf /tmp/vault*
name: Install Vault 1.2.3
- run:
command: |
if [ ! -z $GOTESTARCH ] && [ $GOTESTARCH == "386" ]; then
sudo apt-get update
sudo apt-get install -y gcc-multilib
else
echo "Skipping 32bit lib installation while building for not 386"
fi
name: Install 32bit gcc libs
- run:
command: PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make bootstrap
- run:
command: |
if [ -z $GOTEST_PKGS_EXCLUDE ];
then
unset GOTEST_PKGS_EXCLUDE
else
unset GOTEST_PKGS
fi
if [ ! -z $GOTESTARCH ]; then
export GOARCH="$GOTESTARCH";
fi
mkdir -p /tmp/test-reports
sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make generate-structs
sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make test-nomad
name: Running Nomad Tests
no_output_timeout: 20m
- store_test_results:
path: /tmp/test-reports
- store_artifacts:
path: /tmp/test-reports
test-client:
machine:
image: ubuntu-1604:201903-01
working_directory: ~/go/src/github.com/hashicorp/nomad
environment:
- GIT_PAGER: cat
- GOLANG_VERSION: 1.12.16
- GOMAXPROCS: 1
- GOPATH: /home/circleci/go
- GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml
- NOMAD_SLOW_TEST: 1
- PAGER: cat
- GOTEST_PKGS: ./client/...
- GOTEST_PKGS_EXCLUDE: ''
- GOTESTARCH: amd64
steps:
- checkout
- run:
command: |
set -x
echo installing golang ${GOLANG_VERSION}
sudo rm -rf /usr/local/go
wget -O /tmp/golang.tar.gz https://dl.google.com/go/go${GOLANG_VERSION}.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf /tmp/golang.tar.gz
rm -rf /tmp/golang.tar.gz
name: install golang
- run:
command: |
sudo rm -rf /usr/bin/protoc
sudo ./scripts/vagrant-linux-priv-protoc.sh
name: install protoc
- run:
command: |
wget -q -O /tmp/consul.zip https://releases.hashicorp.com/consul/1.6.1/consul_1.6.1_linux_amd64.zip
sudo unzip -d /usr/local/bin /tmp/consul.zip
rm -rf /tmp/consul*
name: Install Consul 1.6.1
- run:
command: |
wget -q -O /tmp/vault.zip https://releases.hashicorp.com/vault/1.2.3/vault_1.2.3_linux_amd64.zip
sudo unzip -d /usr/local/bin /tmp/vault.zip
rm -rf /tmp/vault*
name: Install Vault 1.2.3
- run:
command: |
if [ ! -z $GOTESTARCH ] && [ $GOTESTARCH == "386" ]; then
sudo apt-get update
sudo apt-get install -y gcc-multilib
else
echo "Skipping 32bit lib installation while building for not 386"
fi
name: Install 32bit gcc libs
- run:
command: PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make bootstrap
- run:
command: |
if [ -z $GOTEST_PKGS_EXCLUDE ];
then
unset GOTEST_PKGS_EXCLUDE
else
unset GOTEST_PKGS
fi
if [ ! -z $GOTESTARCH ]; then
export GOARCH="$GOTESTARCH";
fi
mkdir -p /tmp/test-reports
sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make generate-structs
sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make test-nomad
name: Running Nomad Tests
no_output_timeout: 20m
- store_test_results:
path: /tmp/test-reports
- store_artifacts:
path: /tmp/test-reports
test-shared-exec:
machine:
image: ubuntu-1604:201903-01
working_directory: ~/go/src/github.com/hashicorp/nomad
environment:
- GIT_PAGER: cat
- GOLANG_VERSION: 1.12.16
- GOMAXPROCS: 1
- GOPATH: /home/circleci/go
- GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml
- NOMAD_SLOW_TEST: 1
- PAGER: cat
- GOTEST_PKGS: ./drivers/shared/executor
- GOTEST_PKGS_EXCLUDE: ''
- GOTESTARCH: amd64
steps:
- checkout
- run:
command: |
set -x
echo installing golang ${GOLANG_VERSION}
sudo rm -rf /usr/local/go
wget -O /tmp/golang.tar.gz https://dl.google.com/go/go${GOLANG_VERSION}.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf /tmp/golang.tar.gz
rm -rf /tmp/golang.tar.gz
name: install golang
- run:
command: |
sudo rm -rf /usr/bin/protoc
sudo ./scripts/vagrant-linux-priv-protoc.sh
name: install protoc
- run:
command: |
wget -q -O /tmp/consul.zip https://releases.hashicorp.com/consul/1.6.1/consul_1.6.1_linux_amd64.zip
sudo unzip -d /usr/local/bin /tmp/consul.zip
rm -rf /tmp/consul*
name: Install Consul 1.6.1
- run:
command: |
wget -q -O /tmp/vault.zip https://releases.hashicorp.com/vault/1.2.3/vault_1.2.3_linux_amd64.zip
sudo unzip -d /usr/local/bin /tmp/vault.zip
rm -rf /tmp/vault*
name: Install Vault 1.2.3
- run:
command: |
if [ ! -z $GOTESTARCH ] && [ $GOTESTARCH == "386" ]; then
sudo apt-get update
sudo apt-get install -y gcc-multilib
else
echo "Skipping 32bit lib installation while building for not 386"
fi
name: Install 32bit gcc libs
- run:
command: PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make bootstrap
- run:
command: |
if [ -z $GOTEST_PKGS_EXCLUDE ];
then
unset GOTEST_PKGS_EXCLUDE
else
unset GOTEST_PKGS
fi
if [ ! -z $GOTESTARCH ]; then
export GOARCH="$GOTESTARCH";
fi
mkdir -p /tmp/test-reports
sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make generate-structs
sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make test-nomad
name: Running Nomad Tests
no_output_timeout: 20m
- store_test_results:
path: /tmp/test-reports
- store_artifacts:
path: /tmp/test-reports
test-ui:
docker:
- environment:
JOBS: 2
image: circleci/node:10-browsers
steps:
- checkout
- restore_cache:
keys:
- v1-deps-{{ checksum "ui/yarn.lock" }}
- v1-deps-
- run:
command: cd ui && yarn install
name: yarn install
- save_cache:
key: v1-deps-{{ checksum "ui/yarn.lock" }}
paths:
- ./ui/node_modules
- run:
command: cd ui && yarn run lint:js
name: lint:js
- run:
command: cd ui && yarn run lint:hbs
name: lint:hbs
- run:
command: cd ui && yarn test
name: Ember tests
lint-go:
docker:
- image: golang:1.12.16
working_directory: /go/src/github.com/hashicorp/nomad
steps:
- checkout
- run:
command: apt-get update; apt-get install -y shellcheck sudo unzip
- run:
command: |
sudo rm -rf /usr/bin/protoc
sudo ./scripts/vagrant-linux-priv-protoc.sh
name: install protoc
- run:
command: "CCI_VERSION=\"0.1.5879\"\nCCI_SHA256=\"f178ea62c781aec06267017404f87983c87f171fd0e66ef3737916246ae66dd6\"\n\nURL=\"https://github.com/CircleCI-Public/circleci-cli/releases/download/v${CCI_VERSION}/circleci-cli_${CCI_VERSION}_linux_amd64.tar.gz\"\n\nmkdir -p /tmp/circleci-cli/\ncurl --fail --show-error --location \\\n -o /tmp/circleci-cli/cli.tar.gz \"${URL}\"\n\necho \"$CCI_SHA256 /tmp/circleci-cli/cli.tar.gz\" | sha256sum -c\n\ntar -xz --strip-components=1 \\\n -C /tmp/circleci-cli \\\n -f /tmp/circleci-cli/cli.tar.gz \\\n \"circleci-cli_${CCI_VERSION}_linux_amd64/circleci\" \n\nsudo cp /tmp/circleci-cli/circleci /usr/bin/circleci-local-cli\n\ncircleci-local-cli version\n"
name: Install CircleCI CLI 0.1.5879
- run:
command: make deps lint-deps
- run:
command: make check
- run:
command: make checkscripts
- run:
command: make -C .circleci CIRCLECI="circleci-local-cli --skip-update-check" ci-verify
name: check .circleci/config.yml is up-to-date
environment:
- GIT_PAGER: cat
- GOMAXPROCS: 1
- GOPATH: /go
- GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml
- NOMAD_SLOW_TEST: 1
- PAGER: cat
website-docker-image:
docker:
- image: circleci/buildpack-deps
shell: /usr/bin/env bash -euo pipefail -c
steps:
- checkout
- setup_remote_docker
- run:
command: |
echo 'export PACKAGE_LOCK_CHANGED=$(git diff --name-only $(git log --pretty=format:'%h' -n1 HEAD~1)...HEAD | grep -c website/package-lock.json)' >> $BASH_ENV
name: Diff package-lock.json
- run:
command: |
if [ "$CIRCLE_BRANCH" = "master" ] && [ $PACKAGE_LOCK_CHANGED -gt 0 ]; then
cd website/
docker build -t hashicorp/nomad-website:$CIRCLE_SHA1 .
docker tag hashicorp/nomad-website:$CIRCLE_SHA1 hashicorp/nomad-website:latest
docker login -u $DOCKER_USER -p $DOCKER_PASS
docker push hashicorp/nomad-website
else
echo "Not building a new website docker image - branch is not master and/or dependencies have not changed."
fi
name: Build Docker Image if Necessary
test-other:
machine:
image: ubuntu-1604:201903-01
working_directory: ~/go/src/github.com/hashicorp/nomad
environment:
- GIT_PAGER: cat
- GOLANG_VERSION: 1.12.16
- GOMAXPROCS: 1
- GOPATH: /home/circleci/go
- GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml
- NOMAD_SLOW_TEST: 1
- PAGER: cat
- GOTEST_PKGS: ''
- GOTEST_PKGS_EXCLUDE: ./api|./client|./drivers/docker|./drivers/exec|./drivers/rkt|./drivers/shared/executor|./nomad|./devices
- GOTESTARCH: amd64
steps:
- checkout
- run:
command: |
set -x
echo installing golang ${GOLANG_VERSION}
sudo rm -rf /usr/local/go
wget -O /tmp/golang.tar.gz https://dl.google.com/go/go${GOLANG_VERSION}.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf /tmp/golang.tar.gz
rm -rf /tmp/golang.tar.gz
name: install golang
- run:
command: |
sudo rm -rf /usr/bin/protoc
sudo ./scripts/vagrant-linux-priv-protoc.sh
name: install protoc
- run:
command: |
wget -q -O /tmp/consul.zip https://releases.hashicorp.com/consul/1.6.1/consul_1.6.1_linux_amd64.zip
sudo unzip -d /usr/local/bin /tmp/consul.zip
rm -rf /tmp/consul*
name: Install Consul 1.6.1
- run:
command: |
wget -q -O /tmp/vault.zip https://releases.hashicorp.com/vault/1.2.3/vault_1.2.3_linux_amd64.zip
sudo unzip -d /usr/local/bin /tmp/vault.zip
rm -rf /tmp/vault*
name: Install Vault 1.2.3
- run:
command: |
if [ ! -z $GOTESTARCH ] && [ $GOTESTARCH == "386" ]; then
sudo apt-get update
sudo apt-get install -y gcc-multilib
else
echo "Skipping 32bit lib installation while building for not 386"
fi
name: Install 32bit gcc libs
- run:
command: PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make bootstrap
- run:
command: |
if [ -z $GOTEST_PKGS_EXCLUDE ];
then
unset GOTEST_PKGS_EXCLUDE
else
unset GOTEST_PKGS
fi
if [ ! -z $GOTESTARCH ]; then
export GOARCH="$GOTESTARCH";
fi
mkdir -p /tmp/test-reports
sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make generate-structs
sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make test-nomad
name: Running Nomad Tests
no_output_timeout: 20m
- store_test_results:
path: /tmp/test-reports
- store_artifacts:
path: /tmp/test-reports
test-devices:
docker:
- image: golang:1.12.16
working_directory: /go/src/github.com/hashicorp/nomad
environment:
- GIT_PAGER: cat
- GOMAXPROCS: 1
- GOPATH: /go
- GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml
- NOMAD_SLOW_TEST: 1
- PAGER: cat
- GOTEST_PKGS: ./devices/...
- GOTEST_PKGS_EXCLUDE: ''
- GOTESTARCH: amd64
steps:
- checkout
- run:
command: apt-get update; apt-get install -y shellcheck sudo unzip
- run:
command: make deps
- run:
command: |
sudo rm -rf /usr/bin/protoc
sudo ./scripts/vagrant-linux-priv-protoc.sh
name: install protoc
- run:
command: |
wget -q -O /tmp/consul.zip https://releases.hashicorp.com/consul/1.6.1/consul_1.6.1_linux_amd64.zip
sudo unzip -d /usr/local/bin /tmp/consul.zip
rm -rf /tmp/consul*
name: Install Consul 1.6.1
- run:
command: |
wget -q -O /tmp/vault.zip https://releases.hashicorp.com/vault/1.2.3/vault_1.2.3_linux_amd64.zip
sudo unzip -d /usr/local/bin /tmp/vault.zip
rm -rf /tmp/vault*
name: Install Vault 1.2.3
- run:
command: |
if [ -z $GOTEST_PKGS_EXCLUDE ];
then
unset GOTEST_PKGS_EXCLUDE
else
unset GOTEST_PKGS
fi
if [ ! -z $GOTESTARCH ]; then
export GOARCH="$GOTESTARCH";
fi
mkdir -p /tmp/test-reports
sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make generate-structs
sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make test-nomad
name: Running Nomad Tests
no_output_timeout: 20m
- store_test_results:
path: /tmp/test-reports
- store_artifacts:
path: /tmp/test-reports
test-docker:
machine:
image: circleci/classic:201808-01
working_directory: ~/go/src/github.com/hashicorp/nomad
environment:
- GIT_PAGER: cat
- GOLANG_VERSION: 1.12.16
- GOMAXPROCS: 1
- GOPATH: /home/circleci/go
- GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml
- NOMAD_SLOW_TEST: 1
- PAGER: cat
- GOTEST_PKGS: ./drivers/docker
- GOTEST_PKGS_EXCLUDE: ''
- GOTESTARCH: amd64
steps:
- checkout
- run:
command: |
set -x
echo installing golang ${GOLANG_VERSION}
sudo rm -rf /usr/local/go
wget -O /tmp/golang.tar.gz https://dl.google.com/go/go${GOLANG_VERSION}.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf /tmp/golang.tar.gz
rm -rf /tmp/golang.tar.gz
name: install golang
- run:
command: |
sudo rm -rf /usr/bin/protoc
sudo ./scripts/vagrant-linux-priv-protoc.sh
name: install protoc
- run:
command: |
wget -q -O /tmp/consul.zip https://releases.hashicorp.com/consul/1.6.1/consul_1.6.1_linux_amd64.zip
sudo unzip -d /usr/local/bin /tmp/consul.zip
rm -rf /tmp/consul*
name: Install Consul 1.6.1
- run:
command: |
wget -q -O /tmp/vault.zip https://releases.hashicorp.com/vault/1.2.3/vault_1.2.3_linux_amd64.zip
sudo unzip -d /usr/local/bin /tmp/vault.zip
rm -rf /tmp/vault*
name: Install Vault 1.2.3
- run:
command: |
if [ ! -z $GOTESTARCH ] && [ $GOTESTARCH == "386" ]; then
sudo apt-get update
sudo apt-get install -y gcc-multilib
else
echo "Skipping 32bit lib installation while building for not 386"
fi
name: Install 32bit gcc libs
- run:
command: PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make bootstrap
- run:
command: |
if [ -z $GOTEST_PKGS_EXCLUDE ];
then
unset GOTEST_PKGS_EXCLUDE
else
unset GOTEST_PKGS
fi
if [ ! -z $GOTESTARCH ]; then
export GOARCH="$GOTESTARCH";
fi
mkdir -p /tmp/test-reports
sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make generate-structs
sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make test-nomad
name: Running Nomad Tests
no_output_timeout: 20m
- store_test_results:
path: /tmp/test-reports
- store_artifacts:
path: /tmp/test-reports
build-binaries:
docker:
- image: golang:1.12.16
working_directory: /go/src/github.com/hashicorp/nomad
environment:
- GIT_PAGER: cat
- GOMAXPROCS: 1
- GOPATH: /go
- GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml
- NOMAD_SLOW_TEST: 1
- PAGER: cat
- GO_TAGS: codegen_generated
steps:
- checkout
- run:
command: apt-get update; apt-get install -y sudo unzip zip
- run:
command: make deps
- run:
command: |
sudo rm -rf /usr/bin/protoc
sudo ./scripts/vagrant-linux-priv-protoc.sh
name: install protoc
- run:
command: sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make generate-structs
- run:
command: make pkg/windows_amd64.zip pkg/linux_amd64.zip
- store_artifacts:
destination: /builds/nomad_windows_amd64.zip
path: pkg/windows_amd64.zip
- store_artifacts:
destination: /builds/nomad_linux_amd64.zip
path: pkg/linux_amd64.zip
test-e2e:
docker:
- image: golang:1.12.16
working_directory: /go/src/github.com/hashicorp/nomad
steps:
- checkout
- run:
command: apt-get update; apt-get install -y sudo unzip
- run:
command: |
groupadd --gid 3434 circleci
useradd --uid 3434 --gid circleci --shell /bin/bash --create-home circleci
echo 'circleci ALL=NOPASSWD: ALL' >> /etc/sudoers.d/50-circleci
echo 'Defaults env_keep += "DEBIAN_FRONTEND"' >> /etc/sudoers.d/env_keep
chown -R circleci:circleci /go
name: prepare non-root user
- run:
command: sudo -E -H -u circleci PATH=${PATH} make deps
- run:
command: sudo -E -H -u circleci PATH=${PATH} make e2e-test
environment:
- GIT_PAGER: cat
- GOMAXPROCS: 1
- GOPATH: /go
- GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml
- NOMAD_SLOW_TEST: 1
- PAGER: cat
test-32bit:
machine:
image: ubuntu-1604:201903-01
working_directory: ~/go/src/github.com/hashicorp/nomad
environment:
- GIT_PAGER: cat
- GOLANG_VERSION: 1.12.16
- GOMAXPROCS: 1
- GOPATH: /home/circleci/go
- GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml
- NOMAD_SLOW_TEST: 1
- PAGER: cat
- GOTEST_PKGS: ./client/fingerprint
- GOTEST_PKGS_EXCLUDE: ''
- GOTESTARCH: '386'
steps:
- checkout
- run:
command: |
set -x
echo installing golang ${GOLANG_VERSION}
sudo rm -rf /usr/local/go
wget -O /tmp/golang.tar.gz https://dl.google.com/go/go${GOLANG_VERSION}.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf /tmp/golang.tar.gz
rm -rf /tmp/golang.tar.gz
name: install golang
- run:
command: |
sudo rm -rf /usr/bin/protoc
sudo ./scripts/vagrant-linux-priv-protoc.sh
name: install protoc
- run:
command: |
wget -q -O /tmp/consul.zip https://releases.hashicorp.com/consul/1.6.1/consul_1.6.1_linux_amd64.zip
sudo unzip -d /usr/local/bin /tmp/consul.zip
rm -rf /tmp/consul*
name: Install Consul 1.6.1
- run:
command: |
wget -q -O /tmp/vault.zip https://releases.hashicorp.com/vault/1.2.3/vault_1.2.3_linux_amd64.zip
sudo unzip -d /usr/local/bin /tmp/vault.zip
rm -rf /tmp/vault*
name: Install Vault 1.2.3
- run:
command: |
if [ ! -z $GOTESTARCH ] && [ $GOTESTARCH == "386" ]; then
sudo apt-get update
sudo apt-get install -y gcc-multilib
else
echo "Skipping 32bit lib installation while building for not 386"
fi
name: Install 32bit gcc libs
- run:
command: PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make bootstrap
- run:
command: |
if [ -z $GOTEST_PKGS_EXCLUDE ];
then
unset GOTEST_PKGS_EXCLUDE
else
unset GOTEST_PKGS
fi
if [ ! -z $GOTESTARCH ]; then
export GOARCH="$GOTESTARCH";
fi
mkdir -p /tmp/test-reports
sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make generate-structs
sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make test-nomad
name: Running Nomad Tests
no_output_timeout: 20m
- store_test_results:
path: /tmp/test-reports
- store_artifacts:
path: /tmp/test-reports
workflows:
build-test:
jobs:
- build-binaries:
filters:
branches:
ignore:
- stable-website
- lint-go:
filters:
branches:
ignore:
- /^.-ui\b.*/
- /^docs-.*/
- stable-website
- test-client:
filters:
branches:
ignore:
- /^.-ui\b.*/
- /^docs-.*/
- stable-website
- test-nomad:
filters:
branches:
ignore:
- /^.-ui\b.*/
- /^docs-.*/
- stable-website
- test-api:
filters:
branches:
ignore:
- /^.-ui\b.*/
- /^docs-.*/
- stable-website
- test-devices:
filters:
branches:
ignore:
- /^.-ui\b.*/
- /^docs-.*/
- stable-website
- test-other:
filters:
branches:
ignore:
- /^.-ui\b.*/
- /^docs-.*/
- stable-website
- test-docker:
filters:
branches:
ignore:
- /^.-ui\b.*/
- /^docs-.*/
- stable-website
- test-exec:
filters:
branches:
ignore:
- /^.-ui\b.*/
- /^docs-.*/
- stable-website
- test-shared-exec:
filters:
branches:
ignore:
- /^.-ui\b.*/
- /^docs-.*/
- stable-website
- test-32bit:
filters:
branches:
ignore:
- /^.-ui\b.*/
- /^docs-.*/
- stable-website
- test-e2e:
filters:
branches:
ignore:
- /^.-ui\b.*/
- /^docs-.*/
- stable-website
- test-ui:
filters:
branches:
ignore:
- stable-website
- /^docs-.*/
website:
jobs:
- website-docker-image:
context: static-sites
version: 2