This repository was archived by the owner on Jan 21, 2025. It is now read-only.
File tree 2 files changed +12
-2
lines changed
2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 5
5
WORKING_DIR=$( pwd)
6
6
WORKSPACE_DIR=" $WORKING_DIR /workspace"
7
7
LAYERS_DIR=" $WORKING_DIR /layers"
8
+ ARTIFACT_DIR=" ${WORKSPACE_DIR} /artifacts"
8
9
9
10
if [ -f " $WORKSPACE_DIR /changed_layers" ]; then
10
11
LAYERS=$( cat " $WORKSPACE_DIR /changed_layers" )
@@ -26,4 +27,7 @@ for LAYER in $LAYERS; do
26
27
# for debugging, show these files exist
27
28
ls -la " $WORKSPACE_DIR /.terraform.$LAYER .tar.gz"
28
29
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)
29
33
done
Original file line number Diff line number Diff line change 9
9
- checkout :
10
10
path : ~/branches/${CIRCLE_BRANCH}
11
11
- run : mkdir -p ~/workspace/plan_results
12
+ - run : mkdir -p ~/workspace/artifacts
12
13
- run : ln -s ~/branches/${CIRCLE_BRANCH} ~/module
13
14
- run : cp -pr ~/module/.circleci/bin ~/bin
14
15
- run : chmod +x ~/bin/*.sh
24
25
command : cd ~ && ~/bin/plan.sh
25
26
- run :
26
27
name : apply master branch
27
- command : cd ~ && ~/bin/apply.sh
28
+ command : cd ~ && ~/bin/apply.sh || echo "Apply Failed"
28
29
- run :
29
30
name : switch symlink to branch
30
31
command : |
77
78
when : always
78
79
- persist_to_workspace :
79
80
root : ~/workspace
80
- paths : plan_results/*
81
+ paths :
82
+ - plan_results/*
83
+ - artifacts/*
81
84
check_destruction :
82
85
docker :
83
86
- image : hashicorp/terraform:0.11.8
91
94
- run :
92
95
name : raise errors if destroy detected
93
96
command : cd ~ && ~/bin/raise.sh
97
+ - store_artifacts :
98
+ path : ~/workspace/artifacts
99
+
94
100
95
101
workflows :
96
102
version : 2
You can’t perform that action at this time.
0 commit comments