Skip to content

Commit

Permalink
chore: migrating docker compose v2 (#570)
Browse files Browse the repository at this point in the history
<!--
We appreciate the effort for this pull request but before that please
make sure you read the contribution guidelines, then fill out the blanks
below.

Please format the PR title appropriately based on the type of change:
  <type>[!]: <description>
Where <type> is one of: docs, chore, feat, fix, test, misc.
Add a '!' after the type for breaking changes (e.g. feat!: new breaking
feature).

**All third-party contributors acknowledge that any contributions they
provide will be made under the same open-source license that the
open-source project is provided under.**

Please enter each Issue number you are resolving in your PR after one of
the following words [Fixes, Closes, Resolves]. This will auto-link these
issues and close them when this PR is merged!
e.g.
Fixes #1
Closes #2
-->

# Fixes #

Since April 2, 2024 GitHub deprecated Docker compose v1. Complete issue
can be found
[here](https://github.com/orgs/community/discussions/116610). Following
this [migration guide](https://docs.docker.com/compose/migrate/).

### Checklist
- [x] I acknowledge that all my contributions will be made under the
project's license
- [ ] Run `make test-docker`
- [ ] Verify affected language:
- [ ] Generate [twilio-go](https://github.com/twilio/twilio-go) from our
[OpenAPI specification](https://github.com/twilio/twilio-oai) using the
[build_twilio_go.py](./examples/build_twilio_go.py) using `python
examples/build_twilio_go.py path/to/twilio-oai/spec/yaml
path/to/twilio-go` and inspect the diff
    - [ ] Run `make test` in `twilio-go`
    - [ ] Create a pull request in `twilio-go`
    - [ ] Provide a link below to the pull request
- [ ] I have made a material change to the repo (functionality, testing,
spelling, grammar)
- [ ] I have read the [Contribution
Guidelines](https://github.com/twilio/twilio-oai-generator/blob/main/CONTRIBUTING.md)
and my PR follows them
- [ ] I have titled the PR appropriately
- [ ] I have updated my branch with the main branch
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have added the necessary documentation about the functionality
in the appropriate .md file
- [ ] I have added inline documentation to the code I modified

If you have questions, please create a GitHub Issue in this repository.
  • Loading branch information
tiwarishubham635 authored Apr 4, 2024
1 parent 8491d1a commit ecd6976
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions scripts/prism.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ for language in ${LANGUAGES}; do
done

cd examples/prism
docker-compose build --pull "${testing_services[@]}"
docker-compose up -d --force-recreate --remove-orphans "${testing_services[@]}"
docker compose build --pull "${testing_services[@]}"
docker compose up -d --force-recreate --remove-orphans "${testing_services[@]}"

function wait_for() {
echo -n "Waiting for tests to complete"
for language in ${LANGUAGES}; do
while true; do
if [[ "$(docker-compose ps -q -a "${language}-test" | xargs docker inspect -f "{{.State.Status}}")" != "exited" ]]; then
if [[ "$(docker compose ps -q -a "${language}-test" | xargs docker inspect -f "{{.State.Status}}")" != "exited" ]]; then
echo -n "."
sleep 10
else
Expand All @@ -30,9 +30,9 @@ EXIT_CODE=0
function check_status() {
for language in ${LANGUAGES}; do
docker_test_service="${language}-test"
if [[ $(docker-compose ps -q -a "$docker_test_service" | xargs docker inspect -f "{{.State.ExitCode}}") -ne 0 ]]; then
EXIT_CODE=$(($EXIT_CODE || $(docker-compose ps -q -a "$docker_test_service" | xargs docker inspect -f "{{.State.ExitCode}}")))
echo "Failed $language with EXIT code $(docker-compose ps -q -a "$docker_test_service" | xargs docker inspect -f "{{.State.ExitCode}}")"
if [[ $(docker compose ps -q -a "$docker_test_service" | xargs docker inspect -f "{{.State.ExitCode}}") -ne 0 ]]; then
EXIT_CODE=$(($EXIT_CODE || $(docker compose ps -q -a "$docker_test_service" | xargs docker inspect -f "{{.State.ExitCode}}")))
echo "Failed $language with EXIT code $(docker compose ps -q -a "$docker_test_service" | xargs docker inspect -f "{{.State.ExitCode}}")"
cat "../${language}/test-report.out"
else
echo "$language completed successfully"
Expand All @@ -42,5 +42,5 @@ function check_status() {

wait_for
check_status
docker-compose down
docker compose down
exit $EXIT_CODE

0 comments on commit ecd6976

Please sign in to comment.