Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[maykinmedia/open-api-framework#96] Add quick-start.yml #9

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

danielmursa-dev
Copy link

@danielmursa-dev danielmursa-dev force-pushed the feature/add-quick-start branch from c518126 to 2090134 Compare February 3, 2025 13:06
steps:
- uses: actions/checkout@v4
- name: Start docker containers
run: docker compose up -d --build || ( docker compose logs >&2 && exit 1; )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For my information: is the explicit exit 1 needed, wouldn't the build/bringing the containers up failing cause a non zero exit code by itself? In any case I think it's fine to use this to make sure the job fails if there are any errors

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it is necessary because if the build command succeeds, everything continues normally. If it fails, however, we proceed to the next part, after ||, then print the logs and exit with 1;

done
- name: Load fixtures
if: ${{ inputs.fixtures != '' }}
run: docker compose exec -T web src/manage.py loaddata ${{ inputs.fixtures }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it work if you pass multiple fixture names to fixtures?

Copy link
Author

@danielmursa-dev danielmursa-dev Feb 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it works, here there is an example: maykinmedia/open-klant#328

Comment on lines 37 to 38
SUPERUSER="${{ inputs.superuser || 'admin' }}"
WEB_SERVICE="${{ inputs.web_service || 'web' }}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we're not testing logging in in this job, I don't think we have to make these variable, but as long as it's not required to pass them it's fine by me to leave this as is

.github/workflows/quick-start.yml Outdated Show resolved Hide resolved
@danielmursa-dev danielmursa-dev marked this pull request as draft February 10, 2025 13:54
@danielmursa-dev danielmursa-dev marked this pull request as ready for review February 10, 2025 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add docker-compose quickstart job to all projects
2 participants