Created
March 8, 2016 10:20
-
-
Save panggi/cf68fcf43689ee134292 to your computer and use it in GitHub Desktop.
script to create docker image with option to accept environment variable
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 | |
| envs=(development staging sandbox production) | |
| for i in "${envs[@]}" | |
| do | |
| if [ "$1" == "$i" ] | |
| then | |
| grunt $1 | |
| if [ "$1" != 'development' ] | |
| then | |
| gulp | |
| fi | |
| docker build --build-arg NODE=$1 -t username/project . | |
| docker images | |
| fi | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment