Skip to content
This repository was archived by the owner on Jan 21, 2025. It is now read-only.

Commit 8e0fd62

Browse files
Merge pull request #6 from rackspace-infrastructure-automation/mc-tf-testing-update-reaper
Reaper file/configuration sync update 10/17/2018 13:24:25
2 parents 140fc67 + 8af83ef commit 8e0fd62

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

.circleci/bin/plan.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ set -e
55
WORKING_DIR=$(pwd)
66
WORKSPACE_DIR="$WORKING_DIR/workspace"
77
LAYERS_DIR="$WORKING_DIR/layers"
8+
ARTIFACT_DIR="${WORKSPACE_DIR}/artifacts"
89

910
if [ -f "$WORKSPACE_DIR/changed_layers" ]; then
1011
LAYERS=$(cat "$WORKSPACE_DIR/changed_layers")
@@ -26,4 +27,7 @@ for LAYER in $LAYERS; do
2627
# for debugging, show these files exist
2728
ls -la "$WORKSPACE_DIR/.terraform.$LAYER.tar.gz"
2829
ls -la "$WORKSPACE_DIR/terraform.$LAYER.plan"
30+
31+
# Copy plan stdout to artifact directory
32+
(cd "$LAYERS_DIR/$LAYER" && cp layerplan.log ${ARTIFACT_DIR}/terraform.${LAYER}.plan.log)
2933
done

.circleci/config.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ jobs:
99
- checkout:
1010
path: ~/branches/${CIRCLE_BRANCH}
1111
- run: mkdir -p ~/workspace/plan_results
12+
- run: mkdir -p ~/workspace/artifacts
1213
- run: ln -s ~/branches/${CIRCLE_BRANCH} ~/module
1314
- run: cp -pr ~/module/.circleci/bin ~/bin
1415
- run: chmod +x ~/bin/*.sh
@@ -24,7 +25,7 @@ jobs:
2425
command: cd ~ && ~/bin/plan.sh
2526
- run:
2627
name: apply master branch
27-
command: cd ~ && ~/bin/apply.sh
28+
command: cd ~ && ~/bin/apply.sh || echo "Apply Failed"
2829
- run:
2930
name: switch symlink to branch
3031
command: |
@@ -77,7 +78,9 @@ jobs:
7778
when: always
7879
- persist_to_workspace:
7980
root: ~/workspace
80-
paths: plan_results/*
81+
paths:
82+
- plan_results/*
83+
- artifacts/*
8184
check_destruction:
8285
docker:
8386
- image: hashicorp/terraform:0.11.8
@@ -91,6 +94,9 @@ jobs:
9194
- run:
9295
name: raise errors if destroy detected
9396
command: cd ~ && ~/bin/raise.sh
97+
- store_artifacts:
98+
path: ~/workspace/artifacts
99+
94100

95101
workflows:
96102
version: 2

0 commit comments

Comments
 (0)