Skip to content

Commit

Permalink
Merge pull request #1658 from ConductionNL/fix/docker-compose
Browse files Browse the repository at this point in the history
replace docker-compose by docker compose
  • Loading branch information
rjzondervan authored Aug 22, 2024
2 parents 61c3237 + 7d895b0 commit 03ad272
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,29 +59,29 @@ jobs:
- name: Print definitive APP_ENV
run: echo "APP_ENV is now $APP_ENV"
- name: Build the Docker image
run: docker-compose build --build-arg APP_ENV=$APP_ENV --build-arg APP_BUILD_ALL_FIXTURES=true
run: docker compose build --build-arg APP_ENV=$APP_ENV --build-arg APP_BUILD_ALL_FIXTURES=true
- name: Run the docker image
run: docker-compose up -d
run: docker compose up -d
- name: Taking some sleep (for containers to come up)
run: sleep 120
- name: Check if all containers are running
run: docker ps
- name: Dumping the logs
run: docker-compose logs
run: docker compose logs
- name: Database Update
run: docker-compose exec -T php bin/console doctrine:schema:update --force
run: docker compose exec -T php bin/console doctrine:schema:update --force
- if: (github.ref == 'refs/heads/main')
name: Add docker tag latest
run: |
images=$(docker-compose images -q | xargs docker inspect --format='{{ index .RepoTags 0}}' | cut -d':' -f1 | grep $APP_NAME)
images=$(docker compose images -q | xargs docker inspect --format='{{ index .RepoTags 0}}' | cut -d':' -f1 | grep $APP_NAME)
for image in $images
do
docker tag "${image}":${APP_ENV} "${image}":"latest"
done
echo 'IMAGES=$images' >> $GITHUB_ENV
- name: Add docker tags
run: |
images=$(docker-compose images -q | xargs docker inspect --format='{{ index .RepoTags 0}}' | cut -d':' -f1 | grep $APP_NAME)
images=$(docker compose images -q | xargs docker inspect --format='{{ index .RepoTags 0}}' | cut -d':' -f1 | grep $APP_NAME)
for image in $images
do
docker tag "${image}":${APP_ENV} "${image}":"$GITHUB_REF_NAME.$RELEASE"
Expand All @@ -100,20 +100,20 @@ jobs:
fi
- if: steps.containerregistry-login.outputs.success == 'true' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/development' || contains(github.ref, 'version-' ) || contains( github.ref, 'feature-'))
name: Push to Container Registry
run: docker-compose push
run: docker compose push

- if: steps.containerregistry-login.outputs.success == 'true' && (github.ref == 'refs/heads/main')
name: Push latest container to Container Registry
run: |
images=$(docker-compose images -q | xargs docker inspect --format='{{ index .RepoTags 0}}' | cut -d':' -f1 | grep $APP_NAME)
images=$(docker compose images -q | xargs docker inspect --format='{{ index .RepoTags 0}}' | cut -d':' -f1 | grep $APP_NAME)
for image in $images
do
docker push "${image}":"latest"
done
- if: steps.containerregistry-login.outputs.success == 'true' && (contains(github.ref, 'version-' ) || contains( github.ref, 'feature-') || (github.ref == 'refs/heads/main'))
name: Push versioned containers to Container Registry
run: |
images=$(docker-compose images -q | xargs docker inspect --format='{{ index .RepoTags 0}}' | cut -d':' -f1 | grep $APP_NAME)
images=$(docker compose images -q | xargs docker inspect --format='{{ index .RepoTags 0}}' | cut -d':' -f1 | grep $APP_NAME)
for image in $images
do
docker push "${image}":"$GITHUB_REF_NAME.$RELEASE"
Expand All @@ -130,4 +130,4 @@ jobs:
fi
- name: Chores
if: (success() || failure())
run: docker-compose down
run: docker compose down

0 comments on commit 03ad272

Please sign in to comment.