2019-11-20 16:11:28 +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'.
|
|
|
|
### ***
|
|
|
|
version: 2
|
|
|
|
jobs:
|
|
|
|
test-nomad:
|
2019-08-22 14:10:20 +00:00
|
|
|
machine:
|
|
|
|
image: ubuntu-1604:201903-01
|
2019-11-20 16:11:28 +00:00
|
|
|
working_directory: ~/go/src/github.com/hashicorp/nomad
|
2019-01-31 13:31:10 +00:00
|
|
|
environment:
|
2019-11-22 16:51:10 +00:00
|
|
|
- GIT_PAGER: cat
|
2020-05-14 21:30:45 +00:00
|
|
|
- GOLANG_VERSION: 1.14.3
|
2019-11-20 16:11:28 +00:00
|
|
|
- GOMAXPROCS: 1
|
|
|
|
- GOPATH: /home/circleci/go
|
2020-05-06 00:02:15 +00:00
|
|
|
- GOTESTSUM_JSONFILE: /tmp/test-reports/testjsonfile.json
|
|
|
|
- GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml
|
2019-11-20 16:11:28 +00:00
|
|
|
- NOMAD_SLOW_TEST: 1
|
2019-11-22 16:51:10 +00:00
|
|
|
- PAGER: cat
|
2019-11-20 16:11:28 +00:00
|
|
|
- GOTEST_PKGS: ./nomad/...
|
|
|
|
- GOTEST_PKGS_EXCLUDE: ''
|
|
|
|
- GOTESTARCH: amd64
|
2019-01-31 13:31:10 +00:00
|
|
|
steps:
|
2019-11-20 16:11:28 +00:00
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
command: |
|
|
|
|
set -x
|
2020-03-23 15:28:54 +00:00
|
|
|
|
2020-05-04 23:02:15 +00:00
|
|
|
echo installing golang ${GOLANG_VERSION}
|
|
|
|
|
2020-05-15 16:22:15 +00:00
|
|
|
case "${OSTYPE}" in
|
|
|
|
linux*) os="linux" ;;
|
|
|
|
darwin*) os="darwin" ;;
|
|
|
|
msys*) os="windows" ;;
|
|
|
|
*) echo "unknown os: ${OSTYPE}"; exit 1 ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if [[ "${os}" != "windows" ]]
|
2020-03-23 15:28:54 +00:00
|
|
|
then
|
2020-05-04 23:02:15 +00:00
|
|
|
sudo rm -rf /usr/local/go
|
|
|
|
sudo mkdir -p /usr/local
|
2020-05-15 16:22:15 +00:00
|
|
|
curl -SL --fail -o /tmp/golang.tar.gz https://dl.google.com/go/go${GOLANG_VERSION}.${os}-amd64.tar.gz
|
2020-05-04 23:02:15 +00:00
|
|
|
sudo tar -C /usr/local -xzf /tmp/golang.tar.gz
|
|
|
|
rm -rf /tmp/golang.tar.gz
|
|
|
|
else
|
2020-05-15 16:22:15 +00:00
|
|
|
rm -rf /usr/local/go
|
|
|
|
mkdir -p /usr/local
|
|
|
|
curl -SL --fail -o /tmp/go.zip https://dl.google.com/go/go${GOLANG_VERSION}.windows-amd64.zip
|
2020-05-15 17:19:21 +00:00
|
|
|
unzip -q -o /tmp/go.zip -d /usr/local
|
2020-05-15 16:22:15 +00:00
|
|
|
rm -rf /tmp/go.zip
|
2020-03-23 15:28:54 +00:00
|
|
|
fi
|
2020-05-06 00:02:15 +00:00
|
|
|
name: Install golang
|
2019-11-20 16:11:28 +00:00
|
|
|
- run:
|
|
|
|
command: |
|
|
|
|
sudo rm -rf /usr/bin/protoc
|
|
|
|
sudo ./scripts/vagrant-linux-priv-protoc.sh
|
|
|
|
name: install protoc
|
|
|
|
- run:
|
|
|
|
command: |
|
2020-03-23 15:47:26 +00:00
|
|
|
curl -SL --fail -o /tmp/consul.zip https://releases.hashicorp.com/consul/1.6.4/consul_1.6.4_linux_amd64.zip
|
2019-11-20 16:11:28 +00:00
|
|
|
sudo unzip -d /usr/local/bin /tmp/consul.zip
|
|
|
|
rm -rf /tmp/consul*
|
2020-03-15 10:01:55 +00:00
|
|
|
name: Install Consul 1.6.4
|
2019-11-20 16:11:28 +00:00
|
|
|
- run:
|
|
|
|
command: |
|
2020-05-04 23:02:15 +00:00
|
|
|
set -x
|
|
|
|
|
2020-05-15 16:22:15 +00:00
|
|
|
case "${OSTYPE}" in
|
|
|
|
linux*) os="linux" ;;
|
|
|
|
darwin*) os="darwin" ;;
|
|
|
|
msys*) os="windows" ;;
|
|
|
|
*) echo "unknown os: ${OSTYPE}"; exit 1 ;;
|
|
|
|
esac
|
2020-05-04 23:02:15 +00:00
|
|
|
|
2020-05-15 16:22:15 +00:00
|
|
|
curl -SL --fail -o /tmp/vault.zip https://releases.hashicorp.com/vault/"1.2.4"/vault_"1.2.4"_"${os}"_amd64.zip
|
|
|
|
|
|
|
|
if [[ "${os}" != "windows" ]]; then
|
2020-05-04 23:02:15 +00:00
|
|
|
sudo unzip -d /usr/local/bin /tmp/vault.zip
|
|
|
|
rm -rf /tmp/vault*
|
2020-05-15 16:22:15 +00:00
|
|
|
else
|
|
|
|
rm -rf c:\Windows\vault.exe
|
|
|
|
unzip /tmp/vault.zip -d "/c/Windows"
|
|
|
|
rm -rf /tmp/vault*
|
2020-05-04 23:02:15 +00:00
|
|
|
fi
|
|
|
|
name: Install Vault
|
2019-11-20 16:11:28 +00:00
|
|
|
- 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
|
2019-01-31 13:31:10 +00:00
|
|
|
|
2019-11-20 16:11:28 +00:00
|
|
|
if [ ! -z $GOTESTARCH ]; then
|
|
|
|
export GOARCH="$GOTESTARCH";
|
|
|
|
fi
|
2019-11-20 19:45:20 +00:00
|
|
|
|
2019-11-20 16:11:28 +00:00
|
|
|
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
|
2019-11-21 01:39:23 +00:00
|
|
|
no_output_timeout: 20m
|
2019-11-20 16:11:28 +00:00
|
|
|
- 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
|
2019-01-31 13:31:10 +00:00
|
|
|
environment:
|
2019-11-22 16:51:10 +00:00
|
|
|
- GIT_PAGER: cat
|
2020-05-14 21:30:45 +00:00
|
|
|
- GOLANG_VERSION: 1.14.3
|
2019-11-20 16:11:28 +00:00
|
|
|
- GOMAXPROCS: 1
|
|
|
|
- GOPATH: /home/circleci/go
|
2020-05-06 00:02:15 +00:00
|
|
|
- GOTESTSUM_JSONFILE: /tmp/test-reports/testjsonfile.json
|
|
|
|
- GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml
|
2019-11-20 16:11:28 +00:00
|
|
|
- NOMAD_SLOW_TEST: 1
|
2019-11-22 16:51:10 +00:00
|
|
|
- PAGER: cat
|
2019-11-20 16:11:28 +00:00
|
|
|
- GOTEST_PKGS: ./api/...
|
|
|
|
- GOTEST_PKGS_EXCLUDE: ''
|
|
|
|
- GOTESTARCH: amd64
|
2019-01-31 13:31:10 +00:00
|
|
|
steps:
|
2019-11-20 16:11:28 +00:00
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
command: |
|
|
|
|
set -x
|
2020-03-23 15:28:54 +00:00
|
|
|
|
2020-05-04 23:02:15 +00:00
|
|
|
echo installing golang ${GOLANG_VERSION}
|
|
|
|
|
2020-05-15 16:22:15 +00:00
|
|
|
case "${OSTYPE}" in
|
|
|
|
linux*) os="linux" ;;
|
|
|
|
darwin*) os="darwin" ;;
|
|
|
|
msys*) os="windows" ;;
|
|
|
|
*) echo "unknown os: ${OSTYPE}"; exit 1 ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if [[ "${os}" != "windows" ]]
|
2020-03-23 15:28:54 +00:00
|
|
|
then
|
2020-05-04 23:02:15 +00:00
|
|
|
sudo rm -rf /usr/local/go
|
|
|
|
sudo mkdir -p /usr/local
|
2020-05-15 16:22:15 +00:00
|
|
|
curl -SL --fail -o /tmp/golang.tar.gz https://dl.google.com/go/go${GOLANG_VERSION}.${os}-amd64.tar.gz
|
2020-05-04 23:02:15 +00:00
|
|
|
sudo tar -C /usr/local -xzf /tmp/golang.tar.gz
|
|
|
|
rm -rf /tmp/golang.tar.gz
|
|
|
|
else
|
2020-05-15 16:22:15 +00:00
|
|
|
rm -rf /usr/local/go
|
|
|
|
mkdir -p /usr/local
|
|
|
|
curl -SL --fail -o /tmp/go.zip https://dl.google.com/go/go${GOLANG_VERSION}.windows-amd64.zip
|
2020-05-15 17:19:21 +00:00
|
|
|
unzip -q -o /tmp/go.zip -d /usr/local
|
2020-05-15 16:22:15 +00:00
|
|
|
rm -rf /tmp/go.zip
|
2020-03-23 15:28:54 +00:00
|
|
|
fi
|
2020-05-06 00:02:15 +00:00
|
|
|
name: Install golang
|
2019-11-20 16:11:28 +00:00
|
|
|
- run:
|
|
|
|
command: |
|
|
|
|
sudo rm -rf /usr/bin/protoc
|
|
|
|
sudo ./scripts/vagrant-linux-priv-protoc.sh
|
|
|
|
name: install protoc
|
|
|
|
- run:
|
|
|
|
command: |
|
2020-03-23 15:47:26 +00:00
|
|
|
curl -SL --fail -o /tmp/consul.zip https://releases.hashicorp.com/consul/1.6.4/consul_1.6.4_linux_amd64.zip
|
2019-11-20 16:11:28 +00:00
|
|
|
sudo unzip -d /usr/local/bin /tmp/consul.zip
|
|
|
|
rm -rf /tmp/consul*
|
2020-03-15 10:01:55 +00:00
|
|
|
name: Install Consul 1.6.4
|
2019-11-20 16:11:28 +00:00
|
|
|
- run:
|
|
|
|
command: |
|
2020-05-04 23:02:15 +00:00
|
|
|
set -x
|
|
|
|
|
2020-05-15 16:22:15 +00:00
|
|
|
case "${OSTYPE}" in
|
|
|
|
linux*) os="linux" ;;
|
|
|
|
darwin*) os="darwin" ;;
|
|
|
|
msys*) os="windows" ;;
|
|
|
|
*) echo "unknown os: ${OSTYPE}"; exit 1 ;;
|
|
|
|
esac
|
2020-05-04 23:02:15 +00:00
|
|
|
|
2020-05-15 16:22:15 +00:00
|
|
|
curl -SL --fail -o /tmp/vault.zip https://releases.hashicorp.com/vault/"1.2.4"/vault_"1.2.4"_"${os}"_amd64.zip
|
|
|
|
|
|
|
|
if [[ "${os}" != "windows" ]]; then
|
2020-05-04 23:02:15 +00:00
|
|
|
sudo unzip -d /usr/local/bin /tmp/vault.zip
|
|
|
|
rm -rf /tmp/vault*
|
2020-05-15 16:22:15 +00:00
|
|
|
else
|
|
|
|
rm -rf c:\Windows\vault.exe
|
|
|
|
unzip /tmp/vault.zip -d "/c/Windows"
|
|
|
|
rm -rf /tmp/vault*
|
2020-05-04 23:02:15 +00:00
|
|
|
fi
|
|
|
|
name: Install Vault
|
2019-11-20 16:11:28 +00:00
|
|
|
- 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
|
2019-01-31 13:31:10 +00:00
|
|
|
|
2019-11-20 16:11:28 +00:00
|
|
|
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
|
2019-11-21 01:39:23 +00:00
|
|
|
no_output_timeout: 20m
|
2019-11-20 16:11:28 +00:00
|
|
|
- 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
|
2019-08-30 11:44:23 +00:00
|
|
|
environment:
|
2019-11-22 16:51:10 +00:00
|
|
|
- GIT_PAGER: cat
|
2020-05-14 21:30:45 +00:00
|
|
|
- GOLANG_VERSION: 1.14.3
|
2019-11-20 16:11:28 +00:00
|
|
|
- GOMAXPROCS: 1
|
|
|
|
- GOPATH: /home/circleci/go
|
2020-05-06 00:02:15 +00:00
|
|
|
- GOTESTSUM_JSONFILE: /tmp/test-reports/testjsonfile.json
|
|
|
|
- GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml
|
2019-11-20 16:11:28 +00:00
|
|
|
- NOMAD_SLOW_TEST: 1
|
2019-11-22 16:51:10 +00:00
|
|
|
- PAGER: cat
|
2019-11-20 16:11:28 +00:00
|
|
|
- GOTEST_PKGS: ./drivers/exec
|
|
|
|
- GOTEST_PKGS_EXCLUDE: ''
|
|
|
|
- GOTESTARCH: amd64
|
2019-08-30 11:44:23 +00:00
|
|
|
steps:
|
2019-11-20 16:11:28 +00:00
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
command: |
|
|
|
|
set -x
|
2020-03-23 15:28:54 +00:00
|
|
|
|
2020-05-04 23:02:15 +00:00
|
|
|
echo installing golang ${GOLANG_VERSION}
|
|
|
|
|
2020-05-15 16:22:15 +00:00
|
|
|
case "${OSTYPE}" in
|
|
|
|
linux*) os="linux" ;;
|
|
|
|
darwin*) os="darwin" ;;
|
|
|
|
msys*) os="windows" ;;
|
|
|
|
*) echo "unknown os: ${OSTYPE}"; exit 1 ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if [[ "${os}" != "windows" ]]
|
2020-03-23 15:28:54 +00:00
|
|
|
then
|
2020-05-04 23:02:15 +00:00
|
|
|
sudo rm -rf /usr/local/go
|
|
|
|
sudo mkdir -p /usr/local
|
2020-05-15 16:22:15 +00:00
|
|
|
curl -SL --fail -o /tmp/golang.tar.gz https://dl.google.com/go/go${GOLANG_VERSION}.${os}-amd64.tar.gz
|
2020-05-04 23:02:15 +00:00
|
|
|
sudo tar -C /usr/local -xzf /tmp/golang.tar.gz
|
|
|
|
rm -rf /tmp/golang.tar.gz
|
|
|
|
else
|
2020-05-15 16:22:15 +00:00
|
|
|
rm -rf /usr/local/go
|
|
|
|
mkdir -p /usr/local
|
|
|
|
curl -SL --fail -o /tmp/go.zip https://dl.google.com/go/go${GOLANG_VERSION}.windows-amd64.zip
|
2020-05-15 17:19:21 +00:00
|
|
|
unzip -q -o /tmp/go.zip -d /usr/local
|
2020-05-15 16:22:15 +00:00
|
|
|
rm -rf /tmp/go.zip
|
2020-03-23 15:28:54 +00:00
|
|
|
fi
|
2020-05-06 00:02:15 +00:00
|
|
|
name: Install golang
|
2019-11-20 16:11:28 +00:00
|
|
|
- run:
|
|
|
|
command: |
|
|
|
|
sudo rm -rf /usr/bin/protoc
|
|
|
|
sudo ./scripts/vagrant-linux-priv-protoc.sh
|
|
|
|
name: install protoc
|
|
|
|
- run:
|
|
|
|
command: |
|
2020-03-23 15:47:26 +00:00
|
|
|
curl -SL --fail -o /tmp/consul.zip https://releases.hashicorp.com/consul/1.6.4/consul_1.6.4_linux_amd64.zip
|
2019-11-20 16:11:28 +00:00
|
|
|
sudo unzip -d /usr/local/bin /tmp/consul.zip
|
|
|
|
rm -rf /tmp/consul*
|
2020-03-15 10:01:55 +00:00
|
|
|
name: Install Consul 1.6.4
|
2019-11-20 16:11:28 +00:00
|
|
|
- run:
|
|
|
|
command: |
|
2020-05-04 23:02:15 +00:00
|
|
|
set -x
|
|
|
|
|
2020-05-15 16:22:15 +00:00
|
|
|
case "${OSTYPE}" in
|
|
|
|
linux*) os="linux" ;;
|
|
|
|
darwin*) os="darwin" ;;
|
|
|
|
msys*) os="windows" ;;
|
|
|
|
*) echo "unknown os: ${OSTYPE}"; exit 1 ;;
|
|
|
|
esac
|
2020-05-04 23:02:15 +00:00
|
|
|
|
2020-05-15 16:22:15 +00:00
|
|
|
curl -SL --fail -o /tmp/vault.zip https://releases.hashicorp.com/vault/"1.2.4"/vault_"1.2.4"_"${os}"_amd64.zip
|
|
|
|
|
|
|
|
if [[ "${os}" != "windows" ]]; then
|
2020-05-04 23:02:15 +00:00
|
|
|
sudo unzip -d /usr/local/bin /tmp/vault.zip
|
|
|
|
rm -rf /tmp/vault*
|
2020-05-15 16:22:15 +00:00
|
|
|
else
|
|
|
|
rm -rf c:\Windows\vault.exe
|
|
|
|
unzip /tmp/vault.zip -d "/c/Windows"
|
|
|
|
rm -rf /tmp/vault*
|
2020-05-04 23:02:15 +00:00
|
|
|
fi
|
|
|
|
name: Install Vault
|
2019-11-20 16:11:28 +00:00
|
|
|
- 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
|
2019-10-18 13:21:13 +00:00
|
|
|
|
2019-11-20 16:11:28 +00:00
|
|
|
if [ ! -z $GOTESTARCH ]; then
|
|
|
|
export GOARCH="$GOTESTARCH";
|
|
|
|
fi
|
2019-08-30 11:44:23 +00:00
|
|
|
|
2019-11-20 16:11:28 +00:00
|
|
|
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
|
2019-11-21 01:39:23 +00:00
|
|
|
no_output_timeout: 20m
|
2019-11-20 16:11:28 +00:00
|
|
|
- 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
|
2019-08-30 11:44:23 +00:00
|
|
|
environment:
|
2019-11-22 16:51:10 +00:00
|
|
|
- GIT_PAGER: cat
|
2020-05-14 21:30:45 +00:00
|
|
|
- GOLANG_VERSION: 1.14.3
|
2019-11-20 16:11:28 +00:00
|
|
|
- GOMAXPROCS: 1
|
|
|
|
- GOPATH: /home/circleci/go
|
2020-05-06 00:02:15 +00:00
|
|
|
- GOTESTSUM_JSONFILE: /tmp/test-reports/testjsonfile.json
|
|
|
|
- GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml
|
2019-11-20 16:11:28 +00:00
|
|
|
- NOMAD_SLOW_TEST: 1
|
2019-11-22 16:51:10 +00:00
|
|
|
- PAGER: cat
|
2019-11-20 16:11:28 +00:00
|
|
|
- GOTEST_PKGS: ./client/...
|
|
|
|
- GOTEST_PKGS_EXCLUDE: ''
|
|
|
|
- GOTESTARCH: amd64
|
2019-08-30 11:44:23 +00:00
|
|
|
steps:
|
2019-11-20 16:11:28 +00:00
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
command: |
|
|
|
|
set -x
|
2020-03-23 15:28:54 +00:00
|
|
|
|
2020-05-04 23:02:15 +00:00
|
|
|
echo installing golang ${GOLANG_VERSION}
|
|
|
|
|
2020-05-15 16:22:15 +00:00
|
|
|
case "${OSTYPE}" in
|
|
|
|
linux*) os="linux" ;;
|
|
|
|
darwin*) os="darwin" ;;
|
|
|
|
msys*) os="windows" ;;
|
|
|
|
*) echo "unknown os: ${OSTYPE}"; exit 1 ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if [[ "${os}" != "windows" ]]
|
2020-03-23 15:28:54 +00:00
|
|
|
then
|
2020-05-04 23:02:15 +00:00
|
|
|
sudo rm -rf /usr/local/go
|
|
|
|
sudo mkdir -p /usr/local
|
2020-05-15 16:22:15 +00:00
|
|
|
curl -SL --fail -o /tmp/golang.tar.gz https://dl.google.com/go/go${GOLANG_VERSION}.${os}-amd64.tar.gz
|
2020-05-04 23:02:15 +00:00
|
|
|
sudo tar -C /usr/local -xzf /tmp/golang.tar.gz
|
|
|
|
rm -rf /tmp/golang.tar.gz
|
|
|
|
else
|
2020-05-15 16:22:15 +00:00
|
|
|
rm -rf /usr/local/go
|
|
|
|
mkdir -p /usr/local
|
|
|
|
curl -SL --fail -o /tmp/go.zip https://dl.google.com/go/go${GOLANG_VERSION}.windows-amd64.zip
|
2020-05-15 17:19:21 +00:00
|
|
|
unzip -q -o /tmp/go.zip -d /usr/local
|
2020-05-15 16:22:15 +00:00
|
|
|
rm -rf /tmp/go.zip
|
2020-03-23 15:28:54 +00:00
|
|
|
fi
|
2020-05-06 00:02:15 +00:00
|
|
|
name: Install golang
|
2019-11-20 16:11:28 +00:00
|
|
|
- run:
|
|
|
|
command: |
|
|
|
|
sudo rm -rf /usr/bin/protoc
|
|
|
|
sudo ./scripts/vagrant-linux-priv-protoc.sh
|
|
|
|
name: install protoc
|
|
|
|
- run:
|
|
|
|
command: |
|
2020-03-23 15:47:26 +00:00
|
|
|
curl -SL --fail -o /tmp/consul.zip https://releases.hashicorp.com/consul/1.6.4/consul_1.6.4_linux_amd64.zip
|
2019-11-20 16:11:28 +00:00
|
|
|
sudo unzip -d /usr/local/bin /tmp/consul.zip
|
|
|
|
rm -rf /tmp/consul*
|
2020-03-15 10:01:55 +00:00
|
|
|
name: Install Consul 1.6.4
|
2019-11-20 16:11:28 +00:00
|
|
|
- run:
|
|
|
|
command: |
|
2020-05-04 23:02:15 +00:00
|
|
|
set -x
|
|
|
|
|
2020-05-15 16:22:15 +00:00
|
|
|
case "${OSTYPE}" in
|
|
|
|
linux*) os="linux" ;;
|
|
|
|
darwin*) os="darwin" ;;
|
|
|
|
msys*) os="windows" ;;
|
|
|
|
*) echo "unknown os: ${OSTYPE}"; exit 1 ;;
|
|
|
|
esac
|
2020-05-04 23:02:15 +00:00
|
|
|
|
2020-05-15 16:22:15 +00:00
|
|
|
curl -SL --fail -o /tmp/vault.zip https://releases.hashicorp.com/vault/"1.2.4"/vault_"1.2.4"_"${os}"_amd64.zip
|
|
|
|
|
|
|
|
if [[ "${os}" != "windows" ]]; then
|
2020-05-04 23:02:15 +00:00
|
|
|
sudo unzip -d /usr/local/bin /tmp/vault.zip
|
|
|
|
rm -rf /tmp/vault*
|
2020-05-15 16:22:15 +00:00
|
|
|
else
|
|
|
|
rm -rf c:\Windows\vault.exe
|
|
|
|
unzip /tmp/vault.zip -d "/c/Windows"
|
|
|
|
rm -rf /tmp/vault*
|
2020-05-04 23:02:15 +00:00
|
|
|
fi
|
|
|
|
name: Install Vault
|
2019-11-20 16:11:28 +00:00
|
|
|
- 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
|
2019-08-30 11:44:23 +00:00
|
|
|
|
2019-11-20 16:11:28 +00:00
|
|
|
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
|
2019-11-21 01:39:23 +00:00
|
|
|
no_output_timeout: 20m
|
2019-11-20 16:11:28 +00:00
|
|
|
- store_test_results:
|
|
|
|
path: /tmp/test-reports
|
|
|
|
- store_artifacts:
|
|
|
|
path: /tmp/test-reports
|
2020-05-04 23:02:15 +00:00
|
|
|
test-windows:
|
|
|
|
machine:
|
|
|
|
image: windows-server-2019-vs2019:stable
|
|
|
|
working_directory: c:\gopath\src\github.com\hashicorp\nomad
|
|
|
|
steps:
|
|
|
|
- run:
|
|
|
|
command: git config --global core.autocrlf false
|
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
command: |
|
|
|
|
mkdir -p $GOBIN
|
|
|
|
mkdir -p $GOTESTSUM_PATH
|
|
|
|
name: Setup
|
|
|
|
- run:
|
|
|
|
command: |
|
|
|
|
set -x
|
|
|
|
|
|
|
|
echo installing golang ${GOLANG_VERSION}
|
|
|
|
|
2020-05-15 16:22:15 +00:00
|
|
|
case "${OSTYPE}" in
|
|
|
|
linux*) os="linux" ;;
|
|
|
|
darwin*) os="darwin" ;;
|
|
|
|
msys*) os="windows" ;;
|
|
|
|
*) echo "unknown os: ${OSTYPE}"; exit 1 ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if [[ "${os}" != "windows" ]]
|
2020-05-04 23:02:15 +00:00
|
|
|
then
|
|
|
|
sudo rm -rf c:/go
|
|
|
|
sudo mkdir -p c:
|
2020-05-15 16:22:15 +00:00
|
|
|
curl -SL --fail -o /tmp/golang.tar.gz https://dl.google.com/go/go${GOLANG_VERSION}.${os}-amd64.tar.gz
|
2020-05-04 23:02:15 +00:00
|
|
|
sudo tar -C c: -xzf /tmp/golang.tar.gz
|
|
|
|
rm -rf /tmp/golang.tar.gz
|
|
|
|
else
|
2020-05-15 16:22:15 +00:00
|
|
|
rm -rf c:/go
|
|
|
|
mkdir -p c:
|
|
|
|
curl -SL --fail -o /tmp/go.zip https://dl.google.com/go/go${GOLANG_VERSION}.windows-amd64.zip
|
2020-05-15 17:19:21 +00:00
|
|
|
unzip -q -o /tmp/go.zip -d c:
|
2020-05-15 16:22:15 +00:00
|
|
|
rm -rf /tmp/go.zip
|
2020-05-04 23:02:15 +00:00
|
|
|
fi
|
2020-05-06 00:02:15 +00:00
|
|
|
name: Install golang
|
2020-05-04 23:02:15 +00:00
|
|
|
- run:
|
|
|
|
command: go version
|
|
|
|
- run:
|
|
|
|
command: |
|
|
|
|
set -x
|
|
|
|
|
2020-05-15 16:22:15 +00:00
|
|
|
case "${OSTYPE}" in
|
|
|
|
linux*) os="linux" ;;
|
|
|
|
darwin*) os="darwin" ;;
|
|
|
|
msys*) os="windows" ;;
|
|
|
|
*) echo "unknown os: ${OSTYPE}"; exit 1 ;;
|
|
|
|
esac
|
2020-05-04 23:02:15 +00:00
|
|
|
|
2020-05-15 16:22:15 +00:00
|
|
|
curl -SL --fail -o /tmp/vault.zip https://releases.hashicorp.com/vault/"$VAULT_VERSION"/vault_"$VAULT_VERSION"_"${os}"_amd64.zip
|
|
|
|
|
|
|
|
if [[ "${os}" != "windows" ]]; then
|
2020-05-04 23:02:15 +00:00
|
|
|
sudo unzip -d /usr/local/bin /tmp/vault.zip
|
|
|
|
rm -rf /tmp/vault*
|
2020-05-15 16:22:15 +00:00
|
|
|
else
|
|
|
|
rm -rf c:\Windows\vault.exe
|
|
|
|
unzip /tmp/vault.zip -d "/c/Windows"
|
|
|
|
rm -rf /tmp/vault*
|
2020-05-04 23:02:15 +00:00
|
|
|
fi
|
|
|
|
name: Install Vault
|
|
|
|
- run:
|
|
|
|
command: vault version
|
|
|
|
- run:
|
|
|
|
command: choco install make
|
|
|
|
- run:
|
|
|
|
command: |
|
2020-05-15 16:22:15 +00:00
|
|
|
export PATH=$PATH:/c/go/bin:/c/gopath/bin
|
|
|
|
make deps
|
2020-05-04 23:02:15 +00:00
|
|
|
name: Install golang dependencies
|
2020-05-15 16:55:53 +00:00
|
|
|
- run:
|
|
|
|
command: docker pull hashicorpnomad/busybox-windows:server2016-0.1
|
|
|
|
name: Pre-download docker test image
|
2020-05-04 23:02:15 +00:00
|
|
|
- run:
|
|
|
|
command: |
|
2020-05-15 16:22:15 +00:00
|
|
|
export PATH=$PATH:/c/go/bin:/c/gopath/bin
|
2020-05-04 23:02:15 +00:00
|
|
|
go build -o $GOBIN\nomad.exe
|
|
|
|
name: Build nomad
|
|
|
|
- run:
|
|
|
|
command: |
|
|
|
|
# Only test docker driver tests for now
|
2020-05-15 16:22:15 +00:00
|
|
|
export PATH=$PATH:/c/go/bin:/c/gopath/bin
|
|
|
|
gotestsum --format=short-verbose \
|
|
|
|
--junitfile $GOTESTSUM_PATH/results.xml \
|
|
|
|
github.com/hashicorp/nomad/drivers/docker \
|
|
|
|
github.com/hashicorp/nomad/client/lib/fifo \
|
|
|
|
github.com/hashicorp/nomad/client/logmon
|
2020-05-04 23:02:15 +00:00
|
|
|
name: Run tests with gotestsum
|
|
|
|
- store_test_results:
|
|
|
|
path: c:\tmp\test-reports
|
|
|
|
- store_artifacts:
|
|
|
|
path: c:\tmp\test-reports
|
|
|
|
environment:
|
|
|
|
- GOBIN: c:\gopath\bin
|
2020-05-14 21:30:45 +00:00
|
|
|
- GOLANG_VERSION: 1.14.3
|
2020-05-04 23:02:15 +00:00
|
|
|
- GOPATH: c:\gopath
|
|
|
|
- GOTESTSUM_PATH: c:\tmp\test-reports
|
|
|
|
- GOTESTSUM_VERSION: 0.4.2
|
|
|
|
- VAULT_VERSION: 1.4.1
|
|
|
|
resource_class: windows.medium
|
|
|
|
shell: bash --login -eo pipefail
|
2019-11-20 16:11:28 +00:00
|
|
|
test-shared-exec:
|
|
|
|
machine:
|
|
|
|
image: ubuntu-1604:201903-01
|
|
|
|
working_directory: ~/go/src/github.com/hashicorp/nomad
|
2019-01-31 13:31:10 +00:00
|
|
|
environment:
|
2019-11-22 16:51:10 +00:00
|
|
|
- GIT_PAGER: cat
|
2020-05-14 21:30:45 +00:00
|
|
|
- GOLANG_VERSION: 1.14.3
|
2019-11-20 16:11:28 +00:00
|
|
|
- GOMAXPROCS: 1
|
|
|
|
- GOPATH: /home/circleci/go
|
2020-05-06 00:02:15 +00:00
|
|
|
- GOTESTSUM_JSONFILE: /tmp/test-reports/testjsonfile.json
|
|
|
|
- GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml
|
2019-11-20 16:11:28 +00:00
|
|
|
- NOMAD_SLOW_TEST: 1
|
2019-11-22 16:51:10 +00:00
|
|
|
- PAGER: cat
|
2019-11-20 16:11:28 +00:00
|
|
|
- GOTEST_PKGS: ./drivers/shared/executor
|
|
|
|
- GOTEST_PKGS_EXCLUDE: ''
|
|
|
|
- GOTESTARCH: amd64
|
2019-01-31 13:31:10 +00:00
|
|
|
steps:
|
2019-11-20 16:11:28 +00:00
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
command: |
|
|
|
|
set -x
|
2020-03-23 15:28:54 +00:00
|
|
|
|
2020-05-04 23:02:15 +00:00
|
|
|
echo installing golang ${GOLANG_VERSION}
|
|
|
|
|
2020-05-15 16:22:15 +00:00
|
|
|
case "${OSTYPE}" in
|
|
|
|
linux*) os="linux" ;;
|
|
|
|
darwin*) os="darwin" ;;
|
|
|
|
msys*) os="windows" ;;
|
|
|
|
*) echo "unknown os: ${OSTYPE}"; exit 1 ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if [[ "${os}" != "windows" ]]
|
2020-03-23 15:28:54 +00:00
|
|
|
then
|
2020-05-04 23:02:15 +00:00
|
|
|
sudo rm -rf /usr/local/go
|
|
|
|
sudo mkdir -p /usr/local
|
2020-05-15 16:22:15 +00:00
|
|
|
curl -SL --fail -o /tmp/golang.tar.gz https://dl.google.com/go/go${GOLANG_VERSION}.${os}-amd64.tar.gz
|
2020-05-04 23:02:15 +00:00
|
|
|
sudo tar -C /usr/local -xzf /tmp/golang.tar.gz
|
|
|
|
rm -rf /tmp/golang.tar.gz
|
|
|
|
else
|
2020-05-15 16:22:15 +00:00
|
|
|
rm -rf /usr/local/go
|
|
|
|
mkdir -p /usr/local
|
|
|
|
curl -SL --fail -o /tmp/go.zip https://dl.google.com/go/go${GOLANG_VERSION}.windows-amd64.zip
|
2020-05-15 17:19:21 +00:00
|
|
|
unzip -q -o /tmp/go.zip -d /usr/local
|
2020-05-15 16:22:15 +00:00
|
|
|
rm -rf /tmp/go.zip
|
2020-03-23 15:28:54 +00:00
|
|
|
fi
|
2020-05-06 00:02:15 +00:00
|
|
|
name: Install golang
|
2019-11-20 16:11:28 +00:00
|
|
|
- run:
|
|
|
|
command: |
|
|
|
|
sudo rm -rf /usr/bin/protoc
|
|
|
|
sudo ./scripts/vagrant-linux-priv-protoc.sh
|
|
|
|
name: install protoc
|
|
|
|
- run:
|
|
|
|
command: |
|
2020-03-23 15:47:26 +00:00
|
|
|
curl -SL --fail -o /tmp/consul.zip https://releases.hashicorp.com/consul/1.6.4/consul_1.6.4_linux_amd64.zip
|
2019-11-20 16:11:28 +00:00
|
|
|
sudo unzip -d /usr/local/bin /tmp/consul.zip
|
|
|
|
rm -rf /tmp/consul*
|
2020-03-15 10:01:55 +00:00
|
|
|
name: Install Consul 1.6.4
|
2019-11-20 16:11:28 +00:00
|
|
|
- run:
|
|
|
|
command: |
|
2020-05-04 23:02:15 +00:00
|
|
|
set -x
|
|
|
|
|
2020-05-15 16:22:15 +00:00
|
|
|
case "${OSTYPE}" in
|
|
|
|
linux*) os="linux" ;;
|
|
|
|
darwin*) os="darwin" ;;
|
|
|
|
msys*) os="windows" ;;
|
|
|
|
*) echo "unknown os: ${OSTYPE}"; exit 1 ;;
|
|
|
|
esac
|
2020-05-04 23:02:15 +00:00
|
|
|
|
2020-05-15 16:22:15 +00:00
|
|
|
curl -SL --fail -o /tmp/vault.zip https://releases.hashicorp.com/vault/"1.2.4"/vault_"1.2.4"_"${os}"_amd64.zip
|
|
|
|
|
|
|
|
if [[ "${os}" != "windows" ]]; then
|
2020-05-04 23:02:15 +00:00
|
|
|
sudo unzip -d /usr/local/bin /tmp/vault.zip
|
|
|
|
rm -rf /tmp/vault*
|
2020-05-15 16:22:15 +00:00
|
|
|
else
|
|
|
|
rm -rf c:\Windows\vault.exe
|
|
|
|
unzip /tmp/vault.zip -d "/c/Windows"
|
|
|
|
rm -rf /tmp/vault*
|
2020-05-04 23:02:15 +00:00
|
|
|
fi
|
|
|
|
name: Install Vault
|
2019-11-20 16:11:28 +00:00
|
|
|
- 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
|
2019-11-21 01:39:23 +00:00
|
|
|
no_output_timeout: 20m
|
2019-11-20 16:11:28 +00:00
|
|
|
- store_test_results:
|
|
|
|
path: /tmp/test-reports
|
|
|
|
- store_artifacts:
|
|
|
|
path: /tmp/test-reports
|
2019-08-21 13:56:37 +00:00
|
|
|
test-ui:
|
|
|
|
docker:
|
2019-11-20 16:11:28 +00:00
|
|
|
- environment:
|
|
|
|
JOBS: 2
|
|
|
|
image: circleci/node:10-browsers
|
2019-08-21 13:56:37 +00:00
|
|
|
steps:
|
2019-11-20 16:11:28 +00:00
|
|
|
- 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:
|
2020-04-01 16:19:44 +00:00
|
|
|
command: mkdir -p /tmp/test-reports && cd ui && yarn test
|
2019-11-20 16:11:28 +00:00
|
|
|
name: Ember tests
|
2020-04-01 16:19:44 +00:00
|
|
|
- store_test_results:
|
|
|
|
path: /tmp/test-reports
|
|
|
|
- store_artifacts:
|
|
|
|
path: /tmp/test-reports
|
2019-11-20 16:11:28 +00:00
|
|
|
lint-go:
|
|
|
|
docker:
|
2020-05-14 21:30:45 +00:00
|
|
|
- image: golang:1.14.3
|
2019-11-20 16:11:28 +00:00
|
|
|
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
|
2019-11-22 19:50:49 +00:00
|
|
|
- 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
|
2019-11-20 16:11:28 +00:00
|
|
|
- run:
|
|
|
|
command: make deps lint-deps
|
|
|
|
- run:
|
|
|
|
command: make check
|
|
|
|
- run:
|
|
|
|
command: make checkscripts
|
2019-11-22 19:50:49 +00:00
|
|
|
- run:
|
|
|
|
command: make -C .circleci CIRCLECI="circleci-local-cli --skip-update-check" ci-verify
|
|
|
|
name: check .circleci/config.yml is up-to-date
|
2019-11-20 16:11:28 +00:00
|
|
|
environment:
|
2019-11-22 16:51:10 +00:00
|
|
|
- GIT_PAGER: cat
|
2019-11-20 16:11:28 +00:00
|
|
|
- GOMAXPROCS: 1
|
|
|
|
- GOPATH: /go
|
2020-05-06 00:02:15 +00:00
|
|
|
- GOTESTSUM_JSONFILE: /tmp/test-reports/testjsonfile.json
|
|
|
|
- GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml
|
2019-11-20 16:11:28 +00:00
|
|
|
- NOMAD_SLOW_TEST: 1
|
2019-11-22 16:51:10 +00:00
|
|
|
- PAGER: cat
|
2020-02-06 23:58:07 +00:00
|
|
|
website-docker-image:
|
2018-11-20 21:49:40 +00:00
|
|
|
docker:
|
2020-02-06 23:58:07 +00:00
|
|
|
- image: circleci/buildpack-deps
|
|
|
|
shell: /usr/bin/env bash -euo pipefail -c
|
2018-11-20 21:49:40 +00:00
|
|
|
steps:
|
2020-02-06 23:58:07 +00:00
|
|
|
- checkout
|
|
|
|
- setup_remote_docker
|
2019-11-20 16:11:28 +00:00
|
|
|
- run:
|
2020-02-06 23:58:07 +00:00
|
|
|
command: |
|
2020-02-18 18:42:50 +00:00
|
|
|
# There is an edge case that would cause an issue here - if dependencies are updated to an exact copy
|
|
|
|
# of a previous version, for example if packge-lock.json is reverted, we need to manually push the new
|
|
|
|
# image to the "latest" tag
|
2020-02-19 14:18:43 +00:00
|
|
|
# Ignore job if running an enterprise build
|
2020-02-19 17:44:47 +00:00
|
|
|
IMAGE_TAG=$(cat website/Dockerfile website/package-lock.json | sha256sum | awk '{print $1;}')
|
|
|
|
echo "Using $IMAGE_TAG"
|
2020-03-20 19:43:36 +00:00
|
|
|
if [ "$CIRCLE_REPOSITORY_URL" != "git@github.com:hashicorp/nomad.git" ]; then
|
2020-02-19 17:44:47 +00:00
|
|
|
echo "Not Nomad OSS Repo, not building website docker image"
|
|
|
|
elif curl https://hub.docker.com/v2/repositories/hashicorp/nomad-website/tags/$IMAGE_TAG -fsL > /dev/null; then
|
|
|
|
echo "Dependencies have not changed, not building a new website docker image."
|
|
|
|
else
|
2020-02-19 14:18:43 +00:00
|
|
|
cd website/
|
|
|
|
docker build -t hashicorp/nomad-website:$IMAGE_TAG .
|
|
|
|
docker tag hashicorp/nomad-website:$IMAGE_TAG hashicorp/nomad-website:latest
|
|
|
|
docker login -u $WEBSITE_DOCKER_USER -p $WEBSITE_DOCKER_PASS
|
|
|
|
docker push hashicorp/nomad-website
|
2020-02-06 23:58:07 +00:00
|
|
|
fi
|
|
|
|
name: Build Docker Image if Necessary
|
2019-11-20 16:11:28 +00:00
|
|
|
test-other:
|
|
|
|
machine:
|
|
|
|
image: ubuntu-1604:201903-01
|
|
|
|
working_directory: ~/go/src/github.com/hashicorp/nomad
|
|
|
|
environment:
|
2019-11-22 16:51:10 +00:00
|
|
|
- GIT_PAGER: cat
|
2020-05-14 21:30:45 +00:00
|
|
|
- GOLANG_VERSION: 1.14.3
|
2019-11-20 16:11:28 +00:00
|
|
|
- GOMAXPROCS: 1
|
|
|
|
- GOPATH: /home/circleci/go
|
2020-05-06 00:02:15 +00:00
|
|
|
- GOTESTSUM_JSONFILE: /tmp/test-reports/testjsonfile.json
|
|
|
|
- GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml
|
2019-11-20 16:11:28 +00:00
|
|
|
- NOMAD_SLOW_TEST: 1
|
2019-11-22 16:51:10 +00:00
|
|
|
- PAGER: cat
|
2019-11-20 16:11:28 +00:00
|
|
|
- GOTEST_PKGS: ''
|
2020-02-27 03:16:41 +00:00
|
|
|
- GOTEST_PKGS_EXCLUDE: ./api|./client|./drivers/docker|./drivers/exec|./drivers/shared/executor|./nomad|./devices
|
2019-11-20 16:11:28 +00:00
|
|
|
- GOTESTARCH: amd64
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
command: |
|
|
|
|
set -x
|
2020-03-23 15:28:54 +00:00
|
|
|
|
2020-05-04 23:02:15 +00:00
|
|
|
echo installing golang ${GOLANG_VERSION}
|
|
|
|
|
2020-05-15 16:22:15 +00:00
|
|
|
case "${OSTYPE}" in
|
|
|
|
linux*) os="linux" ;;
|
|
|
|
darwin*) os="darwin" ;;
|
|
|
|
msys*) os="windows" ;;
|
|
|
|
*) echo "unknown os: ${OSTYPE}"; exit 1 ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if [[ "${os}" != "windows" ]]
|
2020-03-23 15:28:54 +00:00
|
|
|
then
|
2020-05-04 23:02:15 +00:00
|
|
|
sudo rm -rf /usr/local/go
|
|
|
|
sudo mkdir -p /usr/local
|
2020-05-15 16:22:15 +00:00
|
|
|
curl -SL --fail -o /tmp/golang.tar.gz https://dl.google.com/go/go${GOLANG_VERSION}.${os}-amd64.tar.gz
|
2020-05-04 23:02:15 +00:00
|
|
|
sudo tar -C /usr/local -xzf /tmp/golang.tar.gz
|
|
|
|
rm -rf /tmp/golang.tar.gz
|
|
|
|
else
|
2020-05-15 16:22:15 +00:00
|
|
|
rm -rf /usr/local/go
|
|
|
|
mkdir -p /usr/local
|
|
|
|
curl -SL --fail -o /tmp/go.zip https://dl.google.com/go/go${GOLANG_VERSION}.windows-amd64.zip
|
2020-05-15 17:19:21 +00:00
|
|
|
unzip -q -o /tmp/go.zip -d /usr/local
|
2020-05-15 16:22:15 +00:00
|
|
|
rm -rf /tmp/go.zip
|
2020-03-23 15:28:54 +00:00
|
|
|
fi
|
2020-05-06 00:02:15 +00:00
|
|
|
name: Install golang
|
2019-11-20 16:11:28 +00:00
|
|
|
- run:
|
|
|
|
command: |
|
|
|
|
sudo rm -rf /usr/bin/protoc
|
|
|
|
sudo ./scripts/vagrant-linux-priv-protoc.sh
|
|
|
|
name: install protoc
|
|
|
|
- run:
|
|
|
|
command: |
|
2020-03-23 15:47:26 +00:00
|
|
|
curl -SL --fail -o /tmp/consul.zip https://releases.hashicorp.com/consul/1.6.4/consul_1.6.4_linux_amd64.zip
|
2019-11-20 16:11:28 +00:00
|
|
|
sudo unzip -d /usr/local/bin /tmp/consul.zip
|
|
|
|
rm -rf /tmp/consul*
|
2020-03-15 10:01:55 +00:00
|
|
|
name: Install Consul 1.6.4
|
2019-11-20 16:11:28 +00:00
|
|
|
- run:
|
|
|
|
command: |
|
2020-05-04 23:02:15 +00:00
|
|
|
set -x
|
|
|
|
|
2020-05-15 16:22:15 +00:00
|
|
|
case "${OSTYPE}" in
|
|
|
|
linux*) os="linux" ;;
|
|
|
|
darwin*) os="darwin" ;;
|
|
|
|
msys*) os="windows" ;;
|
|
|
|
*) echo "unknown os: ${OSTYPE}"; exit 1 ;;
|
|
|
|
esac
|
2020-05-04 23:02:15 +00:00
|
|
|
|
2020-05-15 16:22:15 +00:00
|
|
|
curl -SL --fail -o /tmp/vault.zip https://releases.hashicorp.com/vault/"1.2.4"/vault_"1.2.4"_"${os}"_amd64.zip
|
|
|
|
|
|
|
|
if [[ "${os}" != "windows" ]]; then
|
2020-05-04 23:02:15 +00:00
|
|
|
sudo unzip -d /usr/local/bin /tmp/vault.zip
|
|
|
|
rm -rf /tmp/vault*
|
2020-05-15 16:22:15 +00:00
|
|
|
else
|
|
|
|
rm -rf c:\Windows\vault.exe
|
|
|
|
unzip /tmp/vault.zip -d "/c/Windows"
|
|
|
|
rm -rf /tmp/vault*
|
2020-05-04 23:02:15 +00:00
|
|
|
fi
|
|
|
|
name: Install Vault
|
2019-11-20 16:11:28 +00:00
|
|
|
- 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
|
2018-11-20 21:49:40 +00:00
|
|
|
|
2019-11-20 16:11:28 +00:00
|
|
|
if [ ! -z $GOTESTARCH ]; then
|
|
|
|
export GOARCH="$GOTESTARCH";
|
|
|
|
fi
|
2018-11-20 21:49:40 +00:00
|
|
|
|
2019-11-20 16:11:28 +00:00
|
|
|
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
|
2019-11-21 01:39:23 +00:00
|
|
|
no_output_timeout: 20m
|
2019-11-20 16:11:28 +00:00
|
|
|
- store_test_results:
|
|
|
|
path: /tmp/test-reports
|
|
|
|
- store_artifacts:
|
|
|
|
path: /tmp/test-reports
|
|
|
|
test-devices:
|
|
|
|
docker:
|
2020-05-14 21:30:45 +00:00
|
|
|
- image: golang:1.14.3
|
2019-11-20 16:11:28 +00:00
|
|
|
working_directory: /go/src/github.com/hashicorp/nomad
|
|
|
|
environment:
|
2019-11-22 16:51:10 +00:00
|
|
|
- GIT_PAGER: cat
|
2019-11-20 16:11:28 +00:00
|
|
|
- GOMAXPROCS: 1
|
|
|
|
- GOPATH: /go
|
2020-05-06 00:02:15 +00:00
|
|
|
- GOTESTSUM_JSONFILE: /tmp/test-reports/testjsonfile.json
|
|
|
|
- GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml
|
2019-11-20 16:11:28 +00:00
|
|
|
- NOMAD_SLOW_TEST: 1
|
2019-11-22 16:51:10 +00:00
|
|
|
- PAGER: cat
|
2019-11-20 16:11:28 +00:00
|
|
|
- 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: |
|
2020-03-23 15:47:26 +00:00
|
|
|
curl -SL --fail -o /tmp/consul.zip https://releases.hashicorp.com/consul/1.6.4/consul_1.6.4_linux_amd64.zip
|
2019-11-20 16:11:28 +00:00
|
|
|
sudo unzip -d /usr/local/bin /tmp/consul.zip
|
|
|
|
rm -rf /tmp/consul*
|
2020-03-15 10:01:55 +00:00
|
|
|
name: Install Consul 1.6.4
|
2019-11-20 16:11:28 +00:00
|
|
|
- run:
|
|
|
|
command: |
|
2020-05-04 23:02:15 +00:00
|
|
|
set -x
|
|
|
|
|
2020-05-15 16:22:15 +00:00
|
|
|
case "${OSTYPE}" in
|
|
|
|
linux*) os="linux" ;;
|
|
|
|
darwin*) os="darwin" ;;
|
|
|
|
msys*) os="windows" ;;
|
|
|
|
*) echo "unknown os: ${OSTYPE}"; exit 1 ;;
|
|
|
|
esac
|
2020-05-04 23:02:15 +00:00
|
|
|
|
2020-05-15 16:22:15 +00:00
|
|
|
curl -SL --fail -o /tmp/vault.zip https://releases.hashicorp.com/vault/"1.2.4"/vault_"1.2.4"_"${os}"_amd64.zip
|
|
|
|
|
|
|
|
if [[ "${os}" != "windows" ]]; then
|
2020-05-04 23:02:15 +00:00
|
|
|
sudo unzip -d /usr/local/bin /tmp/vault.zip
|
|
|
|
rm -rf /tmp/vault*
|
2020-05-15 16:22:15 +00:00
|
|
|
else
|
|
|
|
rm -rf c:\Windows\vault.exe
|
|
|
|
unzip /tmp/vault.zip -d "/c/Windows"
|
|
|
|
rm -rf /tmp/vault*
|
2020-05-04 23:02:15 +00:00
|
|
|
fi
|
|
|
|
name: Install Vault
|
2019-11-20 16:11:28 +00:00
|
|
|
- run:
|
|
|
|
command: |
|
|
|
|
if [ -z $GOTEST_PKGS_EXCLUDE ];
|
|
|
|
then
|
|
|
|
unset GOTEST_PKGS_EXCLUDE
|
|
|
|
else
|
|
|
|
unset GOTEST_PKGS
|
|
|
|
fi
|
2018-11-20 21:49:40 +00:00
|
|
|
|
2019-11-20 16:11:28 +00:00
|
|
|
if [ ! -z $GOTESTARCH ]; then
|
|
|
|
export GOARCH="$GOTESTARCH";
|
|
|
|
fi
|
2018-11-20 21:49:40 +00:00
|
|
|
|
2019-11-20 16:11:28 +00:00
|
|
|
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
|
2019-11-21 01:39:23 +00:00
|
|
|
no_output_timeout: 20m
|
2019-11-20 16:11:28 +00:00
|
|
|
- store_test_results:
|
|
|
|
path: /tmp/test-reports
|
|
|
|
- store_artifacts:
|
|
|
|
path: /tmp/test-reports
|
2020-03-23 15:28:54 +00:00
|
|
|
build-darwin-binaries:
|
|
|
|
macos:
|
|
|
|
xcode: 11.3.1
|
|
|
|
working_directory: ~/go/src/github.com/hashicorp/nomad
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
command: echo 'export PATH="${GOPATH}/bin:${HOME}/goinstall/go/bin:$PATH"' >> ${BASH_ENV}
|
|
|
|
name: configure PATH
|
|
|
|
- run:
|
|
|
|
command: |
|
|
|
|
set -x
|
|
|
|
|
2020-05-04 23:02:15 +00:00
|
|
|
echo installing golang ${GOLANG_VERSION}
|
|
|
|
|
2020-05-15 16:22:15 +00:00
|
|
|
case "${OSTYPE}" in
|
|
|
|
linux*) os="linux" ;;
|
|
|
|
darwin*) os="darwin" ;;
|
|
|
|
msys*) os="windows" ;;
|
|
|
|
*) echo "unknown os: ${OSTYPE}"; exit 1 ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if [[ "${os}" != "windows" ]]
|
2020-03-23 15:28:54 +00:00
|
|
|
then
|
2020-05-04 23:02:15 +00:00
|
|
|
sudo rm -rf ~/goinstall/go
|
|
|
|
sudo mkdir -p ~/goinstall
|
2020-05-15 16:22:15 +00:00
|
|
|
curl -SL --fail -o /tmp/golang.tar.gz https://dl.google.com/go/go${GOLANG_VERSION}.${os}-amd64.tar.gz
|
2020-05-04 23:02:15 +00:00
|
|
|
sudo tar -C ~/goinstall -xzf /tmp/golang.tar.gz
|
|
|
|
rm -rf /tmp/golang.tar.gz
|
|
|
|
else
|
2020-05-15 16:22:15 +00:00
|
|
|
rm -rf ~/goinstall/go
|
|
|
|
mkdir -p ~/goinstall
|
|
|
|
curl -SL --fail -o /tmp/go.zip https://dl.google.com/go/go${GOLANG_VERSION}.windows-amd64.zip
|
2020-05-15 17:19:21 +00:00
|
|
|
unzip -q -o /tmp/go.zip -d ~/goinstall
|
2020-05-15 16:22:15 +00:00
|
|
|
rm -rf /tmp/go.zip
|
2020-03-23 15:28:54 +00:00
|
|
|
fi
|
2020-05-06 00:02:15 +00:00
|
|
|
name: Install golang
|
2020-03-23 15:28:54 +00:00
|
|
|
- run:
|
|
|
|
command: source ${BASH_ENV} && make deps
|
|
|
|
- run:
|
|
|
|
command: brew install protobuf
|
|
|
|
- run:
|
|
|
|
command: sudo -E PATH="$GOPATH/bin:${HOME}/goinstall/go/bin:$PATH" make generate-structs
|
|
|
|
- run:
|
|
|
|
command: source ${BASH_ENV} && make pkg/darwin_amd64.zip
|
|
|
|
- store_artifacts:
|
|
|
|
destination: /builds/nomad_darwin_amd64.zip
|
2020-03-23 19:42:44 +00:00
|
|
|
path: pkg/darwin_amd64.zip
|
2020-03-23 15:28:54 +00:00
|
|
|
environment:
|
|
|
|
- GIT_PAGER: cat
|
2020-05-14 21:30:45 +00:00
|
|
|
- GOLANG_VERSION: 1.14.3
|
2020-03-23 15:28:54 +00:00
|
|
|
- GOMAXPROCS: 1
|
|
|
|
- GOPATH: /Users/distiller/go
|
2020-05-06 00:02:15 +00:00
|
|
|
- GOTESTSUM_JSONFILE: /tmp/test-reports/testjsonfile.json
|
|
|
|
- GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml
|
2020-03-23 15:28:54 +00:00
|
|
|
- NOMAD_SLOW_TEST: 1
|
|
|
|
- PAGER: cat
|
2019-11-20 16:11:28 +00:00
|
|
|
test-docker:
|
|
|
|
machine:
|
|
|
|
image: circleci/classic:201808-01
|
|
|
|
working_directory: ~/go/src/github.com/hashicorp/nomad
|
|
|
|
environment:
|
2019-11-22 16:51:10 +00:00
|
|
|
- GIT_PAGER: cat
|
2020-05-14 21:30:45 +00:00
|
|
|
- GOLANG_VERSION: 1.14.3
|
2019-11-20 16:11:28 +00:00
|
|
|
- GOMAXPROCS: 1
|
|
|
|
- GOPATH: /home/circleci/go
|
2020-05-06 00:02:15 +00:00
|
|
|
- GOTESTSUM_JSONFILE: /tmp/test-reports/testjsonfile.json
|
|
|
|
- GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml
|
2019-11-20 16:11:28 +00:00
|
|
|
- NOMAD_SLOW_TEST: 1
|
2019-11-22 16:51:10 +00:00
|
|
|
- PAGER: cat
|
2019-11-20 16:11:28 +00:00
|
|
|
- GOTEST_PKGS: ./drivers/docker
|
|
|
|
- GOTEST_PKGS_EXCLUDE: ''
|
|
|
|
- GOTESTARCH: amd64
|
2019-05-16 13:14:34 +00:00
|
|
|
steps:
|
2019-11-20 16:11:28 +00:00
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
command: |
|
|
|
|
set -x
|
2020-03-23 15:28:54 +00:00
|
|
|
|
2020-05-04 23:02:15 +00:00
|
|
|
echo installing golang ${GOLANG_VERSION}
|
|
|
|
|
2020-05-15 16:22:15 +00:00
|
|
|
case "${OSTYPE}" in
|
|
|
|
linux*) os="linux" ;;
|
|
|
|
darwin*) os="darwin" ;;
|
|
|
|
msys*) os="windows" ;;
|
|
|
|
*) echo "unknown os: ${OSTYPE}"; exit 1 ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if [[ "${os}" != "windows" ]]
|
2020-03-23 15:28:54 +00:00
|
|
|
then
|
2020-05-04 23:02:15 +00:00
|
|
|
sudo rm -rf /usr/local/go
|
|
|
|
sudo mkdir -p /usr/local
|
2020-05-15 16:22:15 +00:00
|
|
|
curl -SL --fail -o /tmp/golang.tar.gz https://dl.google.com/go/go${GOLANG_VERSION}.${os}-amd64.tar.gz
|
2020-05-04 23:02:15 +00:00
|
|
|
sudo tar -C /usr/local -xzf /tmp/golang.tar.gz
|
|
|
|
rm -rf /tmp/golang.tar.gz
|
|
|
|
else
|
2020-05-15 16:22:15 +00:00
|
|
|
rm -rf /usr/local/go
|
|
|
|
mkdir -p /usr/local
|
|
|
|
curl -SL --fail -o /tmp/go.zip https://dl.google.com/go/go${GOLANG_VERSION}.windows-amd64.zip
|
2020-05-15 17:19:21 +00:00
|
|
|
unzip -q -o /tmp/go.zip -d /usr/local
|
2020-05-15 16:22:15 +00:00
|
|
|
rm -rf /tmp/go.zip
|
2020-03-23 15:28:54 +00:00
|
|
|
fi
|
2020-05-06 00:02:15 +00:00
|
|
|
name: Install golang
|
2019-11-20 16:11:28 +00:00
|
|
|
- run:
|
|
|
|
command: |
|
|
|
|
sudo rm -rf /usr/bin/protoc
|
|
|
|
sudo ./scripts/vagrant-linux-priv-protoc.sh
|
|
|
|
name: install protoc
|
|
|
|
- run:
|
|
|
|
command: |
|
2020-03-23 15:47:26 +00:00
|
|
|
curl -SL --fail -o /tmp/consul.zip https://releases.hashicorp.com/consul/1.6.4/consul_1.6.4_linux_amd64.zip
|
2019-11-20 16:11:28 +00:00
|
|
|
sudo unzip -d /usr/local/bin /tmp/consul.zip
|
|
|
|
rm -rf /tmp/consul*
|
2020-03-15 10:01:55 +00:00
|
|
|
name: Install Consul 1.6.4
|
2019-11-20 16:11:28 +00:00
|
|
|
- run:
|
|
|
|
command: |
|
2020-05-04 23:02:15 +00:00
|
|
|
set -x
|
|
|
|
|
2020-05-15 16:22:15 +00:00
|
|
|
case "${OSTYPE}" in
|
|
|
|
linux*) os="linux" ;;
|
|
|
|
darwin*) os="darwin" ;;
|
|
|
|
msys*) os="windows" ;;
|
|
|
|
*) echo "unknown os: ${OSTYPE}"; exit 1 ;;
|
|
|
|
esac
|
2020-05-04 23:02:15 +00:00
|
|
|
|
2020-05-15 16:22:15 +00:00
|
|
|
curl -SL --fail -o /tmp/vault.zip https://releases.hashicorp.com/vault/"1.2.4"/vault_"1.2.4"_"${os}"_amd64.zip
|
|
|
|
|
|
|
|
if [[ "${os}" != "windows" ]]; then
|
2020-05-04 23:02:15 +00:00
|
|
|
sudo unzip -d /usr/local/bin /tmp/vault.zip
|
|
|
|
rm -rf /tmp/vault*
|
2020-05-15 16:22:15 +00:00
|
|
|
else
|
|
|
|
rm -rf c:\Windows\vault.exe
|
|
|
|
unzip /tmp/vault.zip -d "/c/Windows"
|
|
|
|
rm -rf /tmp/vault*
|
2020-05-04 23:02:15 +00:00
|
|
|
fi
|
|
|
|
name: Install Vault
|
2019-11-20 16:11:28 +00:00
|
|
|
- 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
|
2019-01-31 13:31:10 +00:00
|
|
|
|
2019-11-20 16:11:28 +00:00
|
|
|
if [ ! -z $GOTESTARCH ]; then
|
|
|
|
export GOARCH="$GOTESTARCH";
|
|
|
|
fi
|
2019-05-16 13:14:34 +00:00
|
|
|
|
2019-11-20 16:11:28 +00:00
|
|
|
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
|
2019-11-21 01:39:23 +00:00
|
|
|
no_output_timeout: 20m
|
2019-11-20 16:11:28 +00:00
|
|
|
- store_test_results:
|
|
|
|
path: /tmp/test-reports
|
|
|
|
- store_artifacts:
|
|
|
|
path: /tmp/test-reports
|
|
|
|
build-binaries:
|
|
|
|
docker:
|
2020-05-14 21:30:45 +00:00
|
|
|
- image: golang:1.14.3
|
2019-11-20 16:11:28 +00:00
|
|
|
working_directory: /go/src/github.com/hashicorp/nomad
|
|
|
|
environment:
|
2019-11-22 16:51:10 +00:00
|
|
|
- GIT_PAGER: cat
|
2019-11-20 16:11:28 +00:00
|
|
|
- GOMAXPROCS: 1
|
|
|
|
- GOPATH: /go
|
2020-05-06 00:02:15 +00:00
|
|
|
- GOTESTSUM_JSONFILE: /tmp/test-reports/testjsonfile.json
|
|
|
|
- GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml
|
2019-11-20 16:11:28 +00:00
|
|
|
- NOMAD_SLOW_TEST: 1
|
2019-11-22 16:51:10 +00:00
|
|
|
- PAGER: cat
|
2019-11-20 16:11:28 +00:00
|
|
|
- GO_TAGS: codegen_generated
|
2019-05-16 13:14:34 +00:00
|
|
|
steps:
|
2019-11-20 16:11:28 +00:00
|
|
|
- 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:
|
2020-05-14 21:30:45 +00:00
|
|
|
- image: golang:1.14.3
|
2019-11-20 16:11:28 +00:00
|
|
|
working_directory: /go/src/github.com/hashicorp/nomad
|
2019-05-16 13:14:34 +00:00
|
|
|
steps:
|
2019-11-20 16:11:28 +00:00
|
|
|
- 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:
|
2019-11-22 16:51:10 +00:00
|
|
|
- GIT_PAGER: cat
|
2019-11-20 16:11:28 +00:00
|
|
|
- GOMAXPROCS: 1
|
|
|
|
- GOPATH: /go
|
2020-05-06 00:02:15 +00:00
|
|
|
- GOTESTSUM_JSONFILE: /tmp/test-reports/testjsonfile.json
|
|
|
|
- GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml
|
2019-11-20 16:11:28 +00:00
|
|
|
- NOMAD_SLOW_TEST: 1
|
2019-11-22 16:51:10 +00:00
|
|
|
- PAGER: cat
|
2019-11-20 16:11:28 +00:00
|
|
|
test-32bit:
|
|
|
|
machine:
|
|
|
|
image: ubuntu-1604:201903-01
|
|
|
|
working_directory: ~/go/src/github.com/hashicorp/nomad
|
|
|
|
environment:
|
2019-11-22 16:51:10 +00:00
|
|
|
- GIT_PAGER: cat
|
2020-05-14 21:30:45 +00:00
|
|
|
- GOLANG_VERSION: 1.14.3
|
2019-11-20 16:11:28 +00:00
|
|
|
- GOMAXPROCS: 1
|
|
|
|
- GOPATH: /home/circleci/go
|
2020-05-06 00:02:15 +00:00
|
|
|
- GOTESTSUM_JSONFILE: /tmp/test-reports/testjsonfile.json
|
|
|
|
- GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml
|
2019-11-20 16:11:28 +00:00
|
|
|
- NOMAD_SLOW_TEST: 1
|
2019-11-22 16:51:10 +00:00
|
|
|
- PAGER: cat
|
2019-11-20 16:11:28 +00:00
|
|
|
- GOTEST_PKGS: ./client/fingerprint
|
|
|
|
- GOTEST_PKGS_EXCLUDE: ''
|
|
|
|
- GOTESTARCH: '386'
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
command: |
|
|
|
|
set -x
|
2020-03-23 15:28:54 +00:00
|
|
|
|
2020-05-04 23:02:15 +00:00
|
|
|
echo installing golang ${GOLANG_VERSION}
|
|
|
|
|
2020-05-15 16:22:15 +00:00
|
|
|
case "${OSTYPE}" in
|
|
|
|
linux*) os="linux" ;;
|
|
|
|
darwin*) os="darwin" ;;
|
|
|
|
msys*) os="windows" ;;
|
|
|
|
*) echo "unknown os: ${OSTYPE}"; exit 1 ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if [[ "${os}" != "windows" ]]
|
2020-03-23 15:28:54 +00:00
|
|
|
then
|
2020-05-04 23:02:15 +00:00
|
|
|
sudo rm -rf /usr/local/go
|
|
|
|
sudo mkdir -p /usr/local
|
2020-05-15 16:22:15 +00:00
|
|
|
curl -SL --fail -o /tmp/golang.tar.gz https://dl.google.com/go/go${GOLANG_VERSION}.${os}-amd64.tar.gz
|
2020-05-04 23:02:15 +00:00
|
|
|
sudo tar -C /usr/local -xzf /tmp/golang.tar.gz
|
|
|
|
rm -rf /tmp/golang.tar.gz
|
|
|
|
else
|
2020-05-15 16:22:15 +00:00
|
|
|
rm -rf /usr/local/go
|
|
|
|
mkdir -p /usr/local
|
|
|
|
curl -SL --fail -o /tmp/go.zip https://dl.google.com/go/go${GOLANG_VERSION}.windows-amd64.zip
|
2020-05-15 17:19:21 +00:00
|
|
|
unzip -q -o /tmp/go.zip -d /usr/local
|
2020-05-15 16:22:15 +00:00
|
|
|
rm -rf /tmp/go.zip
|
2020-03-23 15:28:54 +00:00
|
|
|
fi
|
2020-05-06 00:02:15 +00:00
|
|
|
name: Install golang
|
2019-11-20 16:11:28 +00:00
|
|
|
- run:
|
|
|
|
command: |
|
|
|
|
sudo rm -rf /usr/bin/protoc
|
|
|
|
sudo ./scripts/vagrant-linux-priv-protoc.sh
|
|
|
|
name: install protoc
|
|
|
|
- run:
|
|
|
|
command: |
|
2020-03-23 15:47:26 +00:00
|
|
|
curl -SL --fail -o /tmp/consul.zip https://releases.hashicorp.com/consul/1.6.4/consul_1.6.4_linux_amd64.zip
|
2019-11-20 16:11:28 +00:00
|
|
|
sudo unzip -d /usr/local/bin /tmp/consul.zip
|
|
|
|
rm -rf /tmp/consul*
|
2020-03-15 10:01:55 +00:00
|
|
|
name: Install Consul 1.6.4
|
2019-11-20 16:11:28 +00:00
|
|
|
- run:
|
|
|
|
command: |
|
2020-05-04 23:02:15 +00:00
|
|
|
set -x
|
|
|
|
|
2020-05-15 16:22:15 +00:00
|
|
|
case "${OSTYPE}" in
|
|
|
|
linux*) os="linux" ;;
|
|
|
|
darwin*) os="darwin" ;;
|
|
|
|
msys*) os="windows" ;;
|
|
|
|
*) echo "unknown os: ${OSTYPE}"; exit 1 ;;
|
|
|
|
esac
|
2020-05-04 23:02:15 +00:00
|
|
|
|
2020-05-15 16:22:15 +00:00
|
|
|
curl -SL --fail -o /tmp/vault.zip https://releases.hashicorp.com/vault/"1.2.4"/vault_"1.2.4"_"${os}"_amd64.zip
|
|
|
|
|
|
|
|
if [[ "${os}" != "windows" ]]; then
|
2020-05-04 23:02:15 +00:00
|
|
|
sudo unzip -d /usr/local/bin /tmp/vault.zip
|
|
|
|
rm -rf /tmp/vault*
|
2020-05-15 16:22:15 +00:00
|
|
|
else
|
|
|
|
rm -rf c:\Windows\vault.exe
|
|
|
|
unzip /tmp/vault.zip -d "/c/Windows"
|
|
|
|
rm -rf /tmp/vault*
|
2020-05-04 23:02:15 +00:00
|
|
|
fi
|
|
|
|
name: Install Vault
|
2019-11-20 16:11:28 +00:00
|
|
|
- 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
|
2019-05-16 13:14:34 +00:00
|
|
|
|
2019-11-20 16:11:28 +00:00
|
|
|
if [ ! -z $GOTESTARCH ]; then
|
|
|
|
export GOARCH="$GOTESTARCH";
|
|
|
|
fi
|
2019-08-31 16:34:22 +00:00
|
|
|
|
2019-11-20 16:11:28 +00:00
|
|
|
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
|
2019-11-21 01:39:23 +00:00
|
|
|
no_output_timeout: 20m
|
2019-11-20 16:11:28 +00:00
|
|
|
- store_test_results:
|
|
|
|
path: /tmp/test-reports
|
|
|
|
- store_artifacts:
|
|
|
|
path: /tmp/test-reports
|
|
|
|
workflows:
|
|
|
|
build-test:
|
|
|
|
jobs:
|
2019-11-22 20:32:48 +00:00
|
|
|
- build-binaries:
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
ignore:
|
|
|
|
- stable-website
|
2020-03-05 01:36:18 +00:00
|
|
|
- /^.-ui\b.*/
|
2019-11-20 16:11:28 +00:00
|
|
|
- lint-go:
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
ignore:
|
|
|
|
- /^.-ui\b.*/
|
2019-11-22 16:29:06 +00:00
|
|
|
- /^docs-.*/
|
2019-11-20 16:11:28 +00:00
|
|
|
- stable-website
|
2020-03-23 15:28:54 +00:00
|
|
|
- build-darwin-binaries:
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
ignore:
|
|
|
|
- /^.-ui\b.*/
|
|
|
|
- /^docs-.*/
|
|
|
|
- stable-website
|
2020-05-15 16:33:31 +00:00
|
|
|
- test-windows:
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
ignore:
|
|
|
|
- /^.-ui\b.*/
|
|
|
|
- /^docs-.*/
|
|
|
|
- stable-website
|
2019-11-20 16:11:28 +00:00
|
|
|
- test-client:
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
ignore:
|
|
|
|
- /^.-ui\b.*/
|
2019-11-22 16:29:06 +00:00
|
|
|
- /^docs-.*/
|
2019-11-20 16:11:28 +00:00
|
|
|
- stable-website
|
|
|
|
- test-nomad:
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
ignore:
|
|
|
|
- /^.-ui\b.*/
|
2019-11-22 16:29:06 +00:00
|
|
|
- /^docs-.*/
|
2019-11-20 16:11:28 +00:00
|
|
|
- stable-website
|
|
|
|
- test-api:
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
ignore:
|
|
|
|
- /^.-ui\b.*/
|
2019-11-22 16:29:06 +00:00
|
|
|
- /^docs-.*/
|
2019-11-20 16:11:28 +00:00
|
|
|
- stable-website
|
|
|
|
- test-devices:
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
ignore:
|
|
|
|
- /^.-ui\b.*/
|
2019-11-22 16:29:06 +00:00
|
|
|
- /^docs-.*/
|
2019-11-20 16:11:28 +00:00
|
|
|
- stable-website
|
|
|
|
- test-other:
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
ignore:
|
|
|
|
- /^.-ui\b.*/
|
2019-11-22 16:29:06 +00:00
|
|
|
- /^docs-.*/
|
2019-11-20 16:11:28 +00:00
|
|
|
- stable-website
|
|
|
|
- test-docker:
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
ignore:
|
|
|
|
- /^.-ui\b.*/
|
2019-11-22 16:29:06 +00:00
|
|
|
- /^docs-.*/
|
2019-11-20 16:11:28 +00:00
|
|
|
- stable-website
|
|
|
|
- test-exec:
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
ignore:
|
|
|
|
- /^.-ui\b.*/
|
2019-11-22 16:29:06 +00:00
|
|
|
- /^docs-.*/
|
2019-11-20 16:11:28 +00:00
|
|
|
- stable-website
|
|
|
|
- test-shared-exec:
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
ignore:
|
|
|
|
- /^.-ui\b.*/
|
2019-11-22 16:29:06 +00:00
|
|
|
- /^docs-.*/
|
2019-11-20 16:11:28 +00:00
|
|
|
- stable-website
|
|
|
|
- test-32bit:
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
ignore:
|
|
|
|
- /^.-ui\b.*/
|
2019-11-22 16:29:06 +00:00
|
|
|
- /^docs-.*/
|
2019-11-20 16:11:28 +00:00
|
|
|
- stable-website
|
|
|
|
- test-e2e:
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
ignore:
|
|
|
|
- /^.-ui\b.*/
|
2019-11-22 16:29:06 +00:00
|
|
|
- /^docs-.*/
|
2019-11-20 16:11:28 +00:00
|
|
|
- stable-website
|
|
|
|
- test-ui:
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
ignore:
|
|
|
|
- stable-website
|
2019-11-22 16:29:06 +00:00
|
|
|
- /^docs-.*/
|
2019-11-20 16:11:28 +00:00
|
|
|
website:
|
|
|
|
jobs:
|
2020-02-06 23:58:07 +00:00
|
|
|
- website-docker-image:
|
2020-02-18 18:42:50 +00:00
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- master
|
2019-11-20 16:11:28 +00:00
|
|
|
context: static-sites
|
|
|
|
version: 2
|