Change CircleCI config to 2.0 version
Environment variables are moved out to a script, because CircleCI 2.0 does not support expansion of '$foo' in 'env' section.
This commit is contained in:
1 parent
fc77e33d1d
commit
8620d0ae4f
6 files changed
+76
-67
No files matched your search
+51
-66
@@ -1,66 +1,51 @@
|
||||
general:
|
||||
branches:
|
||||
ignore:
|
||||
- gh\-pages
|
||||
|
||||
machine:
|
||||
pre:
|
||||
- curl -sSL https://s3.amazonaws.com/circle-downloads/install-circleci-docker.sh | bash -s -- 1.10.0
|
||||
services:
|
||||
- docker
|
||||
environment:
|
||||
GOPATH: /home/ubuntu:$GOPATH
|
||||
SRCDIR: /home/ubuntu/src/github.com/weaveworks/weave
|
||||
PATH: $PATH:$HOME/.local/bin:/opt/google-cloud-sdk/bin
|
||||
CLOUDSDK_CORE_DISABLE_PROMPTS: 1
|
||||
STATE: /home/ubuntu/state.env
|
||||
# Base name of VMs for integration tests:
|
||||
NAME: test-$CIRCLE_BUILD_NUM-$CIRCLE_NODE_INDEX
|
||||
TEST_VMS_SETUP_OUTPUT_FILE: $CIRCLE_ARTIFACTS/test_vms_setup_output.txt
|
||||
TEST_VMS_PROV_AND_CONF_LOCK_FILE: $CIRCLE_ARTIFACTS/test_vms_provisioned_and_configured.txt
|
||||
TEST_VMS_READY_LOCK_FILE: $CIRCLE_ARTIFACTS/test_vms_ready.txt
|
||||
# Google Cloud Platorm images for integration tests:
|
||||
USE_IMAGE: 1
|
||||
DISK_NAME_PREFIX: test-$CIRCLE_BUILD_NUM-0
|
||||
|
||||
dependencies:
|
||||
cache_directories:
|
||||
- "~/docker"
|
||||
post:
|
||||
- bin/circle-dependencies-post-sources
|
||||
# Provision & configure testing VMs:
|
||||
- "while [ ! -d $SRCDIR ]; do sleep 1; done; $SRCDIR/bin/provision_test_vms.sh":
|
||||
parallel: true
|
||||
background: true
|
||||
- bin/circle-dependencies-post
|
||||
|
||||
test:
|
||||
pre:
|
||||
- "$SRCDIR/bin/circle-test-pre":
|
||||
parallel: true
|
||||
background: true
|
||||
override:
|
||||
- "$SRCDIR/bin/circle-test-unit":
|
||||
parallel: true
|
||||
- "$SRCDIR/bin/circle-test-smoke":
|
||||
parallel: true
|
||||
timeout: 360
|
||||
post:
|
||||
- "$SRCDIR/bin/circle-test-teardown":
|
||||
parallel: true
|
||||
|
||||
teardown:
|
||||
pre:
|
||||
# Destroy testing VMs:
|
||||
- "cd $SRCDIR/test && ./run-integration-tests.sh destroy":
|
||||
parallel: true
|
||||
background: true
|
||||
- "$SRCDIR/bin/circle-teardown-pre":
|
||||
parallel: true
|
||||
|
||||
deployment:
|
||||
master:
|
||||
branch: master
|
||||
owner: weaveworks
|
||||
commands:
|
||||
- "$SRCDIR/bin/circle-deploy-master"
|
||||
version: 2
|
||||
jobs:
|
||||
build:
|
||||
machine:
|
||||
image: circleci/classic:201709-01
|
||||
environment:
|
||||
GOPATH: /home/circleci
|
||||
SRCDIR: /home/circleci/src/github.com/weaveworks/weave
|
||||
CIRCLE_ARTIFACTS: /tmp/artifacts
|
||||
parallelism: 2
|
||||
steps:
|
||||
- checkout
|
||||
- run: mkdir $CIRCLE_ARTIFACTS
|
||||
# copy source dir and submodule update --init
|
||||
- run: bin/circle-dependencies-post-sources
|
||||
- restore_cache:
|
||||
key: v1-cache-{{ checksum "build/Dockerfile" }}-{{ checksum "build/build.sh" }}
|
||||
# kick off creation of test VMs
|
||||
- run:
|
||||
command: bin/provision_test_vms.sh
|
||||
background: true
|
||||
# create build image and make all
|
||||
- run: bin/circle-dependencies-post
|
||||
- save_cache:
|
||||
key: v1-cache-{{ checksum "build/Dockerfile" }}-{{ checksum "build/build.sh" }}
|
||||
paths:
|
||||
- "~/docker"
|
||||
# when VMs are ready, copy built software to them
|
||||
- run:
|
||||
command: bin/circle-test-pre
|
||||
background: true
|
||||
- run: bin/circle-test-unit
|
||||
- run:
|
||||
command: bin/circle-test-smoke
|
||||
no_output_timeout: 360s
|
||||
# Generate code coverage reports
|
||||
- run: bin/circle-test-teardown
|
||||
# Destroy testing VMs:
|
||||
- run:
|
||||
command: bin/circle-destroy-vms
|
||||
background: true
|
||||
# run goveralls; copy coverage reports to artifacts dir
|
||||
- deploy:
|
||||
command: $SRCDIR/bin/circle-teardown-pre
|
||||
- store_artifacts:
|
||||
path: /tmp/artifacts
|
||||
- deploy:
|
||||
command: |
|
||||
if [ "${CIRCLE_BRANCH}" == "master" ]; then
|
||||
bin/circle-deploy-master
|
||||
fi
|
||||
Executable
+7
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
source "$SRCDIR/bin/circle-env"
|
||||
cd "$SRCDIR/test"
|
||||
./run-integration-tests.sh destroy
|
||||
@@ -0,0 +1,12 @@
|
||||
# Set environment variables here because CircleCI can't expand $FOO in 'env' section
|
||||
|
||||
export PATH="$PATH:$HOME/.local/bin:/opt/google-cloud-sdk/bin"
|
||||
export CLOUDSDK_CORE_DISABLE_PROMPTS=1
|
||||
# Base name of VMs for integration tests:
|
||||
export NAME=test-$CIRCLE_BUILD_NUM-$CIRCLE_NODE_INDEX
|
||||
export TEST_VMS_SETUP_OUTPUT_FILE=$CIRCLE_ARTIFACTS/test_vms_setup_output.txt
|
||||
export TEST_VMS_PROV_AND_CONF_LOCK_FILE=$CIRCLE_ARTIFACTS/test_vms_provisioned_and_configured.txt
|
||||
export TEST_VMS_READY_LOCK_FILE=$CIRCLE_ARTIFACTS/test_vms_ready.txt
|
||||
# Google Cloud Platorm images for integration tests:
|
||||
export USE_IMAGE=1
|
||||
export DISK_NAME_PREFIX=test-$CIRCLE_BUILD_NUM-0
|
||||
@@ -16,6 +16,8 @@ source "$(dirname "$0")/wait_for.sh"
|
||||
exit 1
|
||||
}
|
||||
|
||||
source "$SRCDIR/bin/circle-env"
|
||||
|
||||
# Provisioning from image typically take 90 seconds,
|
||||
# but if we are creating a GCP image, it can take more than 10 minutes:
|
||||
wait_for 900 "$TEST_VMS_PROV_AND_CONF_LOCK_FILE"
|
||||
|
||||
@@ -9,6 +9,8 @@ source "$(dirname "$0")/wait_for.sh"
|
||||
exit 1
|
||||
}
|
||||
|
||||
source "$SRCDIR/bin/circle-env"
|
||||
|
||||
# Provisioning from image typically take 90 seconds,
|
||||
# but if we are creating a GCP image, it can take more than 10 minutes:
|
||||
wait_for 900 "$TEST_VMS_READY_LOCK_FILE"
|
||||
|
||||
@@ -18,7 +18,6 @@ function install_ansible() {
|
||||
sudo apt-get install -qq -y python-pip python-dev libffi-dev libssl-dev \
|
||||
&& pip install --user -U setuptools cffi \
|
||||
&& pip install --user ansible
|
||||
export PATH="$PATH:$HOME/.local/bin"
|
||||
}
|
||||
|
||||
[ -n "$SECRET_KEY" ] || {
|
||||
@@ -26,6 +25,8 @@ function install_ansible() {
|
||||
exit 1
|
||||
}
|
||||
|
||||
source "$SRCDIR/bin/circle-env"
|
||||
|
||||
install_terraform >>"$TEST_VMS_SETUP_OUTPUT_FILE" 2>&1
|
||||
install_ansible >>"$TEST_VMS_SETUP_OUTPUT_FILE" 2>&1
|
||||
|
||||
|
||||
Reference in new issue
Block a user