File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33Versions before 2.0 were only available on internal repository, before open-sourcing the project.
44
5+ ## 2.7
6+
7+ * deployment lifecycle: deploy, halt on error
8+
59## 2.6
610
711* helpers: aws_cf_distribution
Original file line number Diff line number Diff line change 22
33source " ${BASH_SOURCE%/* } /../common"
44
5- fake_log_in " $( basename " $0 " ) $@ "
5+ fake_log_in " $( basename " $0 " ) $@ "
6+ [[ ! -z " $YOKE_FAKES_ECSDEPLOY_EXIT " ]] && exit $YOKE_FAKES_ECSDEPLOY_EXIT
7+
8+ # success
9+ exit 0
Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ last_execution_output() {
164164 assert_equal " $family " " Hello"
165165}
166166
167- @test ' lifecycle - post-deploy' {
167+ @test ' lifecycle - post-deploy executed on success ' {
168168 run ./yoke install -c any -s any -t 12345 -w test/deployments/lifecycle_post_deploy
169169 assert_equal $status 0 || fail " ${lines[@]} "
170170
@@ -173,6 +173,15 @@ last_execution_output() {
173173 [[ $output =~ $expected ]] || fail " not matching. expected: \" $expected \" , actual: \" $output \" "
174174}
175175
176+ @test ' lifecycle - post-deploy skipped on failure' {
177+ YOKE_FAKES_ECSDEPLOY_EXIT=55 run ./yoke install -c any -s any -t 12345 -w test/deployments/lifecycle_post_deploy
178+ assert_equal $status 55 || fail " ${lines[@]} "
179+
180+ local unexpected=' On post-deploy'
181+ local output=$( last_execution_output )
182+ [[ ! $output =~ $unexpected ]] || fail " unexpected: \" $unexpected \" , actual: \" $output \" "
183+ }
184+
176185@test ' lifecycle - post-deploy, with ECS environment variables' {
177186 run ./yoke install -c my-cluster -s my-service -t 12345 -w test/deployments/lifecycle_post_deploy
178187 assert_equal $status 0 || fail " ${lines[@]} "
Original file line number Diff line number Diff line change @@ -182,6 +182,11 @@ function do_deploy() {
182182
183183 [[ " $DEBUG " != " false" ]] && log " [deploy] executing (${# command_line[@]} params): ecs-deploy ${command_line[@]} "
184184 ecs-deploy ${command_line[@]}
185+
186+ local ecs_deploy_result=$?
187+ [[ $ecs_deploy_result -eq 0 ]] || {
188+ echo " Could not deploy" ; exit $ecs_deploy_result ;
189+ }
185190}
186191
187192# skip when sourcing the script
@@ -253,6 +258,5 @@ if [ "$0" = "$BASH_SOURCE" ] ; then
253258
254259 do_initialize
255260 do_deploy
256-
257261 on_post_deploy
258262fi
You can’t perform that action at this time.
0 commit comments