Skip to content

Commit

Permalink
fix(pipeline): buildspec works with Dockerfiles in subdirs (#902)
Browse files Browse the repository at this point in the history
Fixes #893

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
efekarakus and mergify[bot] authored May 6, 2020
1 parent 98a03e5 commit f87b156
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions templates/cicd/buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@ phases:
# - Login and push the image.
- >
for app in $apps; do
for docker_dir in $(cat $CODEBUILD_SRC_DIR/ecs-project/$app/manifest.yml | ruby -ryaml -rjson -e 'puts JSON.pretty_generate(YAML.load(ARGF))' | jq '.image.build' | sed 's/"//g'); do
cd $CODEBUILD_SRC_DIR/$docker_dir;
docker build -t $app:$tag .;
for df_rel_path in $(cat $CODEBUILD_SRC_DIR/ecs-project/$app/manifest.yml | ruby -ryaml -rjson -e 'puts JSON.pretty_generate(YAML.load(ARGF))' | jq '.image.build' | sed 's/"//g'); do
df_path=$CODEBUILD_SRC_DIR/$df_rel_path
df_dir_path=$(dirname "$df_path")
docker build -t $app:$tag -f $df_path $df_dir_path;
image_id=$(docker images -q $app:$tag);
for env in $envs; do
repo=$(cat $CODEBUILD_SRC_DIR/infrastructure/$app-$env.params.json | jq '.Parameters.ContainerImage' | sed 's/"//g');
Expand Down

0 comments on commit f87b156

Please sign in to comment.