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

Adds CI/CD to devU #124

Merged
merged 11 commits into from
Oct 2, 2024
Merged

Adds CI/CD to devU #124

merged 11 commits into from
Oct 2, 2024

Conversation

RA341
Copy link
Collaborator

@RA341 RA341 commented Sep 26, 2024

Proposed changes


Added CI/CD to the repo, it currently only builds docker files and does not run tests. It pushes the images to ghcr

Also refactored the API dockerfile mentioned #126 combining the config generation when building the image.

Disclaimer: this was already done by a previous PR #116; I only refactored it a little.

It builds the following images

  • devU API
  • devU client
  • devU nginx
  • devU tango

with the following tags

  • beta - whenever a commit is pushed to develop branch.
  • latest - whenever a commit is pushed to the release branch ( this branch does not yet exist; it is meant for v1.0 )
  • versioned -
    • This image is built using tags, so if the release branch has tag 1.0, the docker image will be tagged accordingly.
    • This uses semantic-release plugin to automatically generate the version based on the commits.
    • Once we go 1.0 we need to follow the angular commit convention for the plugin to work
    • Until DevU reaches 1.0 we can continue to write normal commit messages.

The docker-compose file also includes a service called watchtower; this allows it to auto-update containers when a new image tag is pushed. The current configuration checks for new images every 30s. This is a very low-cost operation, and it barely uses any resources, so it will run fine without affecting the server.

Let me know if you have a question or if I need to change the naming convention, i.e. beta -> develop or something

I also included a example compose file; remember to include tango config, when using docker-compose.

Types of changes


What types of changes does your code introduce?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Checklist


Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of
them, don't hesitate to ask. This is simply a reminder of what we are going to look for before merging your code.

  • My changeset covers only what is described above (no extraneous changes)
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

api.Dockerfile Outdated
COPY --from=module_builder /tmp/devu-shared-modules ./devu-shared-modules

# Indicate that the api is running in docker; value here is irrelevant
ENV dev=0
Copy link
Member

Choose a reason for hiding this comment

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

Let's choose a better variable name than dev for this. I see isDocker below, which sounds better.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

how about is_docker then

Copy link
Member

@jessehartloff jessehartloff left a comment

Choose a reason for hiding this comment

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

merging so we can test CI/CD on the develop branch

@jessehartloff jessehartloff merged commit bdcc0c2 into makeopensource:develop Oct 2, 2024
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.

3 participants