2020-12-08 21:18:11 +00:00
|
|
|
version: 2.1
|
|
|
|
|
|
|
|
references:
|
|
|
|
# environment specific references - aim to avoid conflicts
|
|
|
|
go-machine-image: &go_machine_image
|
2022-01-18 18:17:37 +00:00
|
|
|
ubuntu-2004:202111-02
|
2020-12-08 21:18:11 +00:00
|
|
|
go-windows-image: &go_windows_image
|
|
|
|
windows-server-2019-vs2019:stable
|
|
|
|
|
|
|
|
# common references
|
|
|
|
common_envs: &common_envs
|
|
|
|
NOMAD_SLOW_TEST: 1
|
|
|
|
GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml
|
|
|
|
GOTESTSUM_JSONFILE: /tmp/test-reports/testjsonfile.json
|
|
|
|
# disable implicit git paging. CircleCI runs commands with in a tty
|
|
|
|
# making git assume it's an interactive session.
|
|
|
|
PAGER: cat
|
|
|
|
GIT_PAGER: cat
|
|
|
|
|
|
|
|
commands:
|
|
|
|
install-buf:
|
2019-01-31 13:31:10 +00:00
|
|
|
steps:
|
2020-12-08 21:18:11 +00:00
|
|
|
- run:
|
|
|
|
name: install buf
|
|
|
|
command: |
|
|
|
|
sudo ./scripts/vagrant-linux-priv-buf.sh
|
|
|
|
install-vault:
|
|
|
|
parameters:
|
|
|
|
version:
|
|
|
|
type: string
|
|
|
|
default: 1.2.4
|
2019-01-31 13:31:10 +00:00
|
|
|
steps:
|
2020-12-08 21:18:11 +00:00
|
|
|
- run:
|
|
|
|
name: Install Vault
|
|
|
|
command: |
|
|
|
|
set -x
|
|
|
|
|
|
|
|
case "${OSTYPE}" in
|
|
|
|
linux*) os="linux" ;;
|
|
|
|
darwin*) os="darwin" ;;
|
|
|
|
msys*) os="windows" ;;
|
|
|
|
*) echo "unknown os: ${OSTYPE}"; exit 1 ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
curl -SL --fail -o /tmp/vault.zip https://releases.hashicorp.com/vault/"<< parameters.version >>"/vault_"<< parameters.version >>"_"${os}"_amd64.zip
|
|
|
|
|
|
|
|
if [[ "${os}" != "windows" ]]; then
|
|
|
|
sudo unzip -d /usr/local/bin /tmp/vault.zip
|
|
|
|
rm -rf /tmp/vault*
|
|
|
|
else
|
|
|
|
rm -rf c:\Windows\vault.exe
|
|
|
|
unzip /tmp/vault.zip -d "/c/Windows"
|
|
|
|
rm -rf /tmp/vault*
|
|
|
|
fi
|
|
|
|
install-consul:
|
|
|
|
parameters:
|
|
|
|
version:
|
|
|
|
type: string
|
|
|
|
default: 1.8.3
|
2019-08-30 11:44:23 +00:00
|
|
|
steps:
|
2020-12-08 21:18:11 +00:00
|
|
|
- run:
|
|
|
|
name: Install Consul << parameters.version >>
|
|
|
|
command: |
|
|
|
|
curl -SL --fail -o /tmp/consul.zip https://releases.hashicorp.com/consul/<< parameters.version >>/consul_<< parameters.version >>_linux_amd64.zip
|
|
|
|
sudo unzip -d /usr/local/bin /tmp/consul.zip
|
|
|
|
rm -rf /tmp/consul*
|
|
|
|
install-golang:
|
|
|
|
parameters:
|
|
|
|
target_directory:
|
|
|
|
type: string
|
|
|
|
default: /usr/local
|
2019-08-30 11:44:23 +00:00
|
|
|
steps:
|
2020-12-08 21:18:11 +00:00
|
|
|
- run:
|
|
|
|
name: Install golang
|
|
|
|
command: |
|
|
|
|
set -x
|
|
|
|
|
2023-02-14 20:03:26 +00:00
|
|
|
echo installing golang ${GO_VERSION}
|
2020-12-08 21:18:11 +00:00
|
|
|
|
|
|
|
case "${OSTYPE}" in
|
|
|
|
linux*) os="linux" ;;
|
|
|
|
darwin*) os="darwin" ;;
|
|
|
|
msys*) os="windows" ;;
|
|
|
|
*) echo "unknown os: ${OSTYPE}"; exit 1 ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if [[ "${os}" != "windows" ]]
|
|
|
|
then
|
|
|
|
sudo rm -rf << parameters.target_directory >>/go
|
|
|
|
sudo mkdir -p << parameters.target_directory >>
|
2023-02-14 20:03:26 +00:00
|
|
|
curl -SL --fail -o /tmp/golang.tar.gz https://dl.google.com/go/go${GOLANG_VERSION}.${os}-amd64.tar.gz
|
2020-12-08 21:18:11 +00:00
|
|
|
sudo tar -C << parameters.target_directory >> -xzf /tmp/golang.tar.gz
|
|
|
|
rm -rf /tmp/golang.tar.gz
|
|
|
|
else
|
|
|
|
rm -rf << parameters.target_directory >>/go
|
|
|
|
mkdir -p <<parameters.target_directory >>
|
2023-02-14 20:03:26 +00:00
|
|
|
curl -SL --fail -o /tmp/go.zip https://dl.google.com/go/go${GOLANG_VERSION}.windows-amd64.zip
|
2020-12-08 21:18:11 +00:00
|
|
|
unzip -q -o /tmp/go.zip -d << parameters.target_directory >>
|
|
|
|
rm -rf /tmp/go.zip
|
|
|
|
fi
|
|
|
|
|
|
|
|
install-circleci-local-cli:
|
|
|
|
parameters:
|
|
|
|
version:
|
|
|
|
type: string
|
|
|
|
default: 0.1.5879
|
|
|
|
|
|
|
|
sha256:
|
|
|
|
type: string
|
|
|
|
default: f178ea62c781aec06267017404f87983c87f171fd0e66ef3737916246ae66dd6
|
2020-05-04 23:02:15 +00:00
|
|
|
steps:
|
2020-12-08 21:18:11 +00:00
|
|
|
- run:
|
|
|
|
name: Install CircleCI CLI << parameters.version >>
|
|
|
|
command: |
|
|
|
|
CCI_VERSION="<< parameters.version >>"
|
|
|
|
CCI_SHA256="<< parameters.sha256 >>"
|
2020-05-04 23:02:15 +00:00
|
|
|
|
2020-12-08 21:18:11 +00:00
|
|
|
URL="https://github.com/CircleCI-Public/circleci-cli/releases/download/v${CCI_VERSION}/circleci-cli_${CCI_VERSION}_linux_amd64.tar.gz"
|
2020-05-04 23:02:15 +00:00
|
|
|
|
2020-12-08 21:18:11 +00:00
|
|
|
mkdir -p /tmp/circleci-cli/
|
|
|
|
curl --fail --show-error --location \
|
|
|
|
-o /tmp/circleci-cli/cli.tar.gz "${URL}"
|
2020-05-15 16:22:15 +00:00
|
|
|
|
2020-12-08 21:18:11 +00:00
|
|
|
echo "$CCI_SHA256 /tmp/circleci-cli/cli.tar.gz" | sha256sum -c
|
2020-05-04 23:02:15 +00:00
|
|
|
|
2020-12-08 21:18:11 +00:00
|
|
|
tar -xz --strip-components=1 \
|
|
|
|
-C /tmp/circleci-cli \
|
|
|
|
-f /tmp/circleci-cli/cli.tar.gz \
|
|
|
|
"circleci-cli_${CCI_VERSION}_linux_amd64/circleci"
|
2020-05-04 23:02:15 +00:00
|
|
|
|
2020-12-08 21:18:11 +00:00
|
|
|
sudo cp /tmp/circleci-cli/circleci /usr/bin/circleci-local-cli
|
2020-05-15 16:22:15 +00:00
|
|
|
|
2020-12-08 21:18:11 +00:00
|
|
|
circleci-local-cli version
|
|
|
|
run-tests:
|
2019-01-31 13:31:10 +00:00
|
|
|
steps:
|
2020-12-08 21:18:11 +00:00
|
|
|
- run:
|
|
|
|
name: Running Nomad Tests
|
|
|
|
no_output_timeout: 20m
|
|
|
|
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
|
|
|
|
|
|
|
|
if [ ! -z $GOTEST_MOD ]; then
|
|
|
|
sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make test-nomad-module
|
|
|
|
else
|
|
|
|
sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make test-nomad
|
|
|
|
fi
|
2020-03-23 15:28:54 +00:00
|
|
|
|
2020-12-08 21:18:11 +00:00
|
|
|
jobs:
|
|
|
|
test-windows:
|
|
|
|
executor: go-windows
|
2020-05-30 14:29:47 +00:00
|
|
|
|
2020-12-08 21:18:11 +00:00
|
|
|
steps:
|
|
|
|
- run: git config --global core.autocrlf false
|
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
name: Setup
|
|
|
|
command: |
|
|
|
|
mkdir -p $GOBIN
|
|
|
|
mkdir -p $GOTESTSUM_PATH
|
|
|
|
- install-golang:
|
|
|
|
target_directory: "c:"
|
2022-08-18 16:25:05 +00:00
|
|
|
- run:
|
|
|
|
name: Show installed Go version
|
|
|
|
command: |
|
|
|
|
export PATH=/c/go/bin:/c/gopath/bin:$PATH
|
|
|
|
go version
|
2020-12-08 21:18:11 +00:00
|
|
|
- install-vault:
|
|
|
|
version: $VAULT_VERSION
|
|
|
|
- run: vault version
|
|
|
|
- run: choco install make
|
|
|
|
- run:
|
|
|
|
name: Install golang dependencies
|
|
|
|
command: |
|
2022-06-10 12:41:12 +00:00
|
|
|
export PATH=/c/go/bin:/c/gopath/bin:$PATH
|
2020-12-08 21:18:11 +00:00
|
|
|
make deps
|
|
|
|
- run:
|
|
|
|
name: Pre-download docker test image
|
2022-06-08 19:06:00 +00:00
|
|
|
command: docker pull docker.mirror.hashicorp.services/hashicorpdev/busybox-windows:server2016-0.1
|
2020-12-08 21:18:11 +00:00
|
|
|
- run:
|
|
|
|
name: Build nomad
|
|
|
|
command: |
|
2022-06-10 12:41:12 +00:00
|
|
|
export PATH=/c/go/bin:/c/gopath/bin:$PATH
|
2020-12-08 21:18:11 +00:00
|
|
|
go build -o $GOBIN\nomad.exe
|
|
|
|
- run:
|
|
|
|
name: Run tests with gotestsum
|
|
|
|
command: |
|
|
|
|
# Only test docker driver tests for now
|
2022-06-10 12:41:12 +00:00
|
|
|
export PATH=/c/go/bin:/c/gopath/bin:$PATH
|
2020-12-08 21:18:11 +00:00
|
|
|
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
|
|
|
|
|
|
|
|
- store_test_results:
|
|
|
|
path: c:\tmp\test-reports
|
|
|
|
- store_artifacts:
|
|
|
|
path: c:\tmp\test-reports
|
|
|
|
test-ui:
|
2019-11-20 16:11:28 +00:00
|
|
|
docker:
|
2022-05-05 20:05:13 +00:00
|
|
|
- image: docker.mirror.hashicorp.services/circleci/node:14-browsers
|
2020-12-08 21:18:11 +00:00
|
|
|
environment:
|
|
|
|
# See https://git.io/vdao3 for details.
|
|
|
|
JOBS: 2
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_cache:
|
|
|
|
keys:
|
2020-12-16 16:37:12 +00:00
|
|
|
- v3-deps-{{ checksum "ui/yarn.lock" }}
|
2020-12-08 21:18:11 +00:00
|
|
|
- run:
|
|
|
|
name: yarn install
|
2020-12-16 18:05:36 +00:00
|
|
|
command: cd ui && yarn install --frozen-lockfile
|
2020-12-08 21:18:11 +00:00
|
|
|
- save_cache:
|
2020-12-16 16:37:12 +00:00
|
|
|
key: v3-deps-{{ checksum "ui/yarn.lock" }}
|
2020-12-08 21:18:11 +00:00
|
|
|
paths:
|
|
|
|
- ./ui/node_modules
|
|
|
|
- run:
|
|
|
|
name: lint:js
|
|
|
|
command: cd ui && yarn run lint:js
|
|
|
|
- run:
|
|
|
|
name: lint:hbs
|
|
|
|
command: cd ui && yarn run lint:hbs
|
|
|
|
- run:
|
|
|
|
name: Ember tests
|
|
|
|
command: mkdir -p /tmp/test-reports && cd ui && yarn test
|
|
|
|
- store_test_results:
|
|
|
|
path: /tmp/test-reports
|
|
|
|
- store_artifacts:
|
|
|
|
path: /tmp/test-reports
|
|
|
|
test-machine:
|
|
|
|
executor: "<< parameters.executor >>"
|
|
|
|
parameters:
|
|
|
|
test_packages:
|
|
|
|
type: string
|
|
|
|
default: ""
|
|
|
|
test_module:
|
|
|
|
type: string
|
|
|
|
default: ""
|
|
|
|
exclude_packages:
|
|
|
|
type: string
|
|
|
|
default: ""
|
|
|
|
executor:
|
|
|
|
type: string
|
2022-01-18 18:17:37 +00:00
|
|
|
default: "go-machine"
|
2020-12-08 21:18:11 +00:00
|
|
|
goarch:
|
|
|
|
type: string
|
|
|
|
default: "amd64"
|
2021-04-05 21:21:41 +00:00
|
|
|
enable_race_testing:
|
2021-04-06 20:38:52 +00:00
|
|
|
type: boolean
|
|
|
|
default: false
|
2019-11-20 16:11:28 +00:00
|
|
|
environment:
|
2020-12-08 21:18:11 +00:00
|
|
|
GOTEST_PKGS_EXCLUDE: "<< parameters.exclude_packages >>"
|
|
|
|
GOTEST_PKGS: "<< parameters.test_packages >>"
|
|
|
|
GOTEST_MOD: "<< parameters.test_module >>"
|
|
|
|
GOTESTARCH: "<< parameters.goarch >>"
|
2021-04-06 21:29:55 +00:00
|
|
|
ENABLE_RACE: "<<# parameters.enable_race_testing >>TRUE<</ parameters.enable_race_testing >>"
|
2019-11-20 16:11:28 +00:00
|
|
|
steps:
|
2020-12-08 21:18:11 +00:00
|
|
|
- checkout
|
|
|
|
- install-golang
|
|
|
|
- install-buf
|
|
|
|
- install-consul
|
|
|
|
- install-vault
|
|
|
|
- run:
|
|
|
|
name: Install 32bit gcc libs
|
|
|
|
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
|
|
|
|
- run: PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make bootstrap
|
|
|
|
- run-tests
|
|
|
|
- store_test_results:
|
|
|
|
path: /tmp/test-reports
|
|
|
|
- store_artifacts:
|
|
|
|
path: /tmp/test-reports
|
|
|
|
test-e2e:
|
|
|
|
executor: go
|
2020-03-23 15:28:54 +00:00
|
|
|
steps:
|
2020-12-08 21:18:11 +00:00
|
|
|
- checkout
|
|
|
|
- run: apt-get update; apt-get install -y sudo unzip
|
|
|
|
# e2e tests require privileged mount/umount permissions when running as root
|
|
|
|
# TODO: switch to using machine executor and run as root to test e2e path
|
|
|
|
- run:
|
|
|
|
name: prepare non-root user
|
|
|
|
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
|
|
|
|
|
2021-07-14 20:12:04 +00:00
|
|
|
# configure git and ssh for the user
|
|
|
|
cp -r ~/.ssh /home/circleci/.ssh
|
|
|
|
chown -R circleci:circleci /home/circleci/.ssh
|
|
|
|
sudo -H -u circleci git config --global url."ssh://git@github.com".insteadOf "https://github.com"
|
|
|
|
|
2020-12-08 21:18:11 +00:00
|
|
|
- run: sudo -E -H -u circleci PATH=${PATH} make deps
|
|
|
|
- run: sudo -E -H -u circleci PATH=${PATH} make integration-test
|
|
|
|
- run: sudo -E -H -u circleci PATH=${PATH} make e2e-test
|
|
|
|
test-container:
|
|
|
|
executor: go
|
|
|
|
parameters:
|
|
|
|
test_packages:
|
|
|
|
type: string
|
|
|
|
default: ""
|
|
|
|
exclude_packages:
|
|
|
|
type: string
|
|
|
|
default: ""
|
|
|
|
goarch:
|
|
|
|
type: string
|
|
|
|
default: "amd64"
|
2020-03-23 15:28:54 +00:00
|
|
|
environment:
|
2020-12-08 21:18:11 +00:00
|
|
|
GOTEST_PKGS: "<< parameters.test_packages >>"
|
|
|
|
GOTEST_PKGS_EXCLUDE: "<< parameters.exclude_packages >>"
|
|
|
|
GOTESTARCH: "<< parameters.goarch >>"
|
2020-06-24 02:56:29 +00:00
|
|
|
steps:
|
2020-12-08 21:18:11 +00:00
|
|
|
- checkout
|
|
|
|
- run: apt-get update; apt-get install -y shellcheck sudo unzip
|
|
|
|
- run: make deps
|
|
|
|
- install-buf
|
|
|
|
- install-consul
|
|
|
|
- install-vault
|
|
|
|
- run-tests
|
|
|
|
- store_test_results:
|
|
|
|
path: /tmp/test-reports
|
|
|
|
- store_artifacts:
|
|
|
|
path: /tmp/test-reports
|
|
|
|
build-darwin-binaries:
|
|
|
|
executor: go-macos
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
name: configure PATH
|
|
|
|
command:
|
|
|
|
echo 'export PATH="${GOPATH}/bin:${HOME}/goinstall/go/bin:$PATH"' >> ${BASH_ENV}
|
|
|
|
|
|
|
|
- install-golang:
|
|
|
|
target_directory: ~/goinstall
|
|
|
|
- run: source ${BASH_ENV} && make deps
|
|
|
|
- run: PATH="$GOPATH/bin:${HOME}/goinstall/go/bin:$PATH" make generate-structs
|
2021-01-13 15:56:25 +00:00
|
|
|
|
|
|
|
- run:
|
|
|
|
name: prepare ui cache
|
|
|
|
command: git log -n 1 --pretty=format:%H ui > /tmp/ui-sha
|
|
|
|
|
|
|
|
- restore_cache:
|
|
|
|
name: restore compiled ui assets
|
|
|
|
keys:
|
|
|
|
- v1-binary-ui-assets-darwin-{{ checksum "/tmp/ui-sha" }}
|
|
|
|
- run:
|
|
|
|
name: prepare ui
|
|
|
|
command: |
|
|
|
|
if [[ -f ~/caches/ui-assets/bindata_assetfs.go ]]; then
|
|
|
|
cp ~/caches/ui-assets/bindata_assetfs.go ./command/agent/bindata_assetfs.go
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
./scripts/vagrant-linux-unpriv-ui.sh
|
|
|
|
|
|
|
|
export PATH="$GOPATH/bin:/usr/local/go/bin:$PATH"
|
2023-02-14 20:03:26 +00:00
|
|
|
|
2021-01-13 15:56:25 +00:00
|
|
|
source ${BASH_ENV}
|
|
|
|
. ~/.nvm/nvm.sh
|
|
|
|
cd ui && yarn install --frozen-lockfile && cd ..
|
|
|
|
JOBS=2 make ember-dist static-assets
|
|
|
|
|
|
|
|
mkdir -p ~/caches/ui-assets
|
|
|
|
cp ./command/agent/bindata_assetfs.go ~/caches/ui-assets/bindata_assetfs.go
|
|
|
|
- save_cache:
|
|
|
|
name: save compiled ui assets
|
|
|
|
key: v1-binary-ui-assets-darwin-{{ checksum "/tmp/ui-sha" }}
|
|
|
|
paths:
|
|
|
|
- ~/caches/ui-assets
|
|
|
|
- run:
|
|
|
|
name: build binaries
|
|
|
|
command: |
|
|
|
|
source ${BASH_ENV}
|
2021-01-14 13:16:58 +00:00
|
|
|
export GO_TAGS="ui $(grep -e '^GO_TAGS ?=' ./GNUmakefile | cut -d= -f2)"
|
2021-01-13 15:56:25 +00:00
|
|
|
make pkg/darwin_amd64.zip
|
2020-12-08 21:18:11 +00:00
|
|
|
- store_artifacts:
|
|
|
|
path: pkg/darwin_amd64.zip
|
|
|
|
destination: /builds/nomad_darwin_amd64.zip
|
2019-11-20 16:11:28 +00:00
|
|
|
build-binaries:
|
2020-12-08 21:18:11 +00:00
|
|
|
executor: go
|
2019-05-16 13:14:34 +00:00
|
|
|
steps:
|
2020-12-08 21:18:11 +00:00
|
|
|
- checkout
|
|
|
|
- run: apt-get update; apt-get install -y sudo unzip zip
|
|
|
|
- run: make deps
|
|
|
|
- install-buf
|
|
|
|
- run: sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make generate-structs
|
2021-01-13 15:56:25 +00:00
|
|
|
|
|
|
|
- run:
|
|
|
|
name: prepare ui cache
|
|
|
|
command: git log -n 1 --pretty=format:%H ui > /tmp/ui-sha
|
|
|
|
|
|
|
|
- restore_cache:
|
|
|
|
name: restore compiled ui assets
|
|
|
|
keys:
|
|
|
|
- v1-binary-ui-assets-linux-{{ checksum "/tmp/ui-sha" }}
|
|
|
|
- run:
|
|
|
|
name: prepare ui
|
|
|
|
command: |
|
|
|
|
if [[ -f /tmp/ui-assets/bindata_assetfs.go ]]; then
|
|
|
|
cp /tmp/ui-assets/bindata_assetfs.go ./command/agent/bindata_assetfs.go
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
./scripts/vagrant-linux-unpriv-ui.sh
|
|
|
|
|
|
|
|
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
|
|
|
|
export PATH="$GOPATH/bin:/usr/local/go/bin:$PATH"
|
|
|
|
. ~/.nvm/nvm.sh
|
|
|
|
cd ui && yarn install --frozen-lockfile && cd ..
|
|
|
|
JOBS=2 make ember-dist static-assets
|
|
|
|
|
|
|
|
mkdir -p /tmp/ui-assets
|
|
|
|
cp ./command/agent/bindata_assetfs.go /tmp/ui-assets/bindata_assetfs.go
|
|
|
|
|
|
|
|
- save_cache:
|
|
|
|
name: save compiled ui assets
|
|
|
|
key: v1-binary-ui-assets-linux-{{ checksum "/tmp/ui-sha" }}
|
|
|
|
paths:
|
|
|
|
- /tmp/ui-assets
|
|
|
|
- run:
|
|
|
|
name: build binaries
|
|
|
|
command: |
|
2021-01-14 13:16:58 +00:00
|
|
|
export GO_TAGS="ui $(grep -e '^GO_TAGS ?=' ./GNUmakefile | cut -d= -f2)"
|
2021-01-13 15:56:25 +00:00
|
|
|
make pkg/windows_amd64.zip pkg/linux_amd64.zip
|
2020-12-08 21:18:11 +00:00
|
|
|
- store_artifacts:
|
2021-01-13 15:56:25 +00:00
|
|
|
path: pkg
|
|
|
|
destination: /builds
|
2020-12-08 21:18:11 +00:00
|
|
|
- store_artifacts:
|
2021-01-13 15:56:25 +00:00
|
|
|
path: /tmp/ui-assets
|
|
|
|
destination: /ui-assets
|
2020-12-08 21:18:11 +00:00
|
|
|
executors:
|
|
|
|
go:
|
|
|
|
working_directory: /go/src/github.com/hashicorp/nomad
|
|
|
|
docker:
|
2023-03-13 16:47:07 +00:00
|
|
|
- image: docker.mirror.hashicorp.services/golang:1.20.2
|
2022-01-18 18:17:37 +00:00
|
|
|
resource_class: medium
|
2019-11-20 16:11:28 +00:00
|
|
|
environment:
|
2020-12-08 21:18:11 +00:00
|
|
|
<<: *common_envs
|
|
|
|
GOPATH: /go
|
|
|
|
|
|
|
|
go-machine:
|
|
|
|
working_directory: ~/go/src/github.com/hashicorp/nomad
|
2019-11-20 16:11:28 +00:00
|
|
|
machine:
|
2020-12-08 21:18:11 +00:00
|
|
|
image: *go_machine_image
|
2022-03-15 12:42:43 +00:00
|
|
|
resource_class: large
|
2020-12-08 21:18:11 +00:00
|
|
|
environment: &machine_env
|
|
|
|
<<: *common_envs
|
2023-03-13 16:47:07 +00:00
|
|
|
GOLANG_VERSION: 1.20.2
|
2020-12-08 21:18:11 +00:00
|
|
|
|
|
|
|
go-macos:
|
|
|
|
working_directory: ~/go/src/github.com/hashicorp/nomad
|
|
|
|
macos:
|
2022-07-05 14:38:00 +00:00
|
|
|
xcode: 13.4.1
|
2020-12-08 21:18:11 +00:00
|
|
|
environment:
|
|
|
|
<<: *common_envs
|
|
|
|
GOPATH: /Users/distiller/go
|
2023-03-13 16:47:07 +00:00
|
|
|
GOLANG_VERSION: 1.20.2
|
2019-08-31 16:34:22 +00:00
|
|
|
|
2020-12-08 21:18:11 +00:00
|
|
|
go-windows:
|
|
|
|
machine:
|
|
|
|
image: *go_windows_image
|
|
|
|
resource_class: windows.medium
|
|
|
|
shell: bash --login -eo pipefail
|
|
|
|
working_directory: c:\gopath\src\github.com\hashicorp\nomad
|
|
|
|
environment:
|
|
|
|
GOPATH: c:\gopath
|
|
|
|
GOBIN: c:\gopath\bin
|
|
|
|
GOTESTSUM_PATH: c:\tmp\test-reports
|
2023-03-13 16:47:07 +00:00
|
|
|
GOLANG_VERSION: 1.20.2
|
2022-03-18 12:48:08 +00:00
|
|
|
GOTESTSUM_VERSION: 1.7.0
|
2020-12-08 21:18:11 +00:00
|
|
|
VAULT_VERSION: 1.4.1
|
2020-05-30 14:29:47 +00:00
|
|
|
|
2019-11-20 16:11:28 +00:00
|
|
|
workflows:
|
|
|
|
build-test:
|
|
|
|
jobs:
|
2020-12-08 21:18:11 +00:00
|
|
|
- build-binaries:
|
|
|
|
# almost always build binaries as they may be needed
|
|
|
|
# for e2e tests
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
ignore:
|
|
|
|
- stable-website
|
|
|
|
|
2022-12-20 20:45:01 +00:00
|
|
|
- test-e2e:
|
|
|
|
filters:
|
2020-12-08 21:18:11 +00:00
|
|
|
branches:
|
|
|
|
ignore:
|
|
|
|
- /^.-ui\b.*/
|
|
|
|
- /^docs-.*/
|
2021-12-07 21:39:52 +00:00
|
|
|
- /^backport/docs-.*/
|
2020-12-08 21:18:11 +00:00
|
|
|
- stable-website
|
|
|
|
|
|
|
|
- test-ui:
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
ignore:
|
|
|
|
- stable-website
|
|
|
|
- /^docs-.*/
|
2021-12-07 21:39:52 +00:00
|
|
|
- /^backport/docs-.*/
|
2020-12-08 21:18:11 +00:00
|
|
|
- /^e2e-.*/
|
|
|
|
|
|
|
|
# Note: comment-out this job in ENT
|
|
|
|
- test-windows:
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
ignore:
|
|
|
|
- /^.-ui\b.*/
|
|
|
|
- /^docs-.*/
|
2021-12-07 21:39:52 +00:00
|
|
|
- /^backport/docs-.*/
|
2020-12-08 21:18:11 +00:00
|
|
|
- /^e2e-.*/
|
|
|
|
- stable-website
|