This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aws cloudformation create-change-set \ | |
--stack-name app \ | |
--change-set-name app-$DOCKBIT_DEPLOYMENT_SHA \ | |
--template-body file://./AutoScalingRollingUpdates.json \ | |
--parameters \ | |
ParameterKey=KeyName,UsePreviousValue=true \ | |
ParameterKey=SHAVersion,ParameterValue=$DOCKBIT_DEPLOYMENT_SHA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in $(seq 1 20); do | |
aws cloudformation list-change-sets --stack-name app | grep CREATE_COMPLETE && if [ $? == 0 ]; then break; else continue; fi | |
done; | |
aws cloudformation execute-change-set \ | |
--stack-name app \ | |
--change-set-name app-$DOCKBIT_DEPLOYMENT_SHA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aws cloudformation wait stack-update-complete --stack-name=app |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM busybox | |
ARG app_version | |
RUN echo “Building $app_version” |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sending build context to Docker daemon 1.2 MB | |
Step 1 : FROM busybox | |
---> 1efc1d465fd6 | |
Step 2 : ARG app_version | |
---> Running in 94d310838e79 | |
---> 576425d2c33e | |
Removing intermediate container 94d310838e79 | |
Step 3 : RUN echo “Building $app_version” | |
---> Running in 7683d34558d1 | |
“Building 1.0” |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM busybox | |
ENV feature_enabled false | |
CMD sh -c 'if [ "$feature_enabled" = true ]; then echo "Feature activated"; else echo "Feature not activated"; fi' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ docker build -t my_app . | |
$ docker run -e feature_enabled=true my_app | |
Feature activated |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ruby:%%RUBY_VERSION%% | |
CMD ruby --version |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
render() { | |
sedStr=" | |
s!%%RUBY_VERSION%%!$version!g; | |
" | |
sed -r "$sedStr" $1 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ls | |
2.1 2.3 Dockerfile.template render.sh | |
$ cd 2.1 && docker build -t my_app:2.1 . | |
Sending build context to Docker daemon 2.048 kB | |
Step 1 : FROM ruby:2.1 | |
---> 2903b59d264e | |
Step 2 : CMD ruby --version | |
---> Running in cea80b05db0f | |
---> 08c4ae2b2188 | |
Removing intermediate container cea80b05db0f |