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

[ci] setup gh actions + dependabot #507

Merged
merged 5 commits into from
Apr 19, 2022

Conversation

renefritze
Copy link
Contributor

This sets up a workflow that builds the package in a configurable environment in one job and builds and pushes the docker image in another. Both currently fail due to #505 and I'll need to rebase this PR once that issue is resolved.
I wanted to use the repository name as the image name to push into ghcr, so my fork's name wouldn't be hardcoded. However image names must be all lowercase. For the time being I just renamed my fork.

@dgarijo
Copy link
Owner

dgarijo commented Apr 13, 2022

Thanks a lot, @renefritze. I have a couple of questions and 1 comment:

  • Comment: can you please push to the dev branch? It's where we push things between releases.
  • Q: I am not very familiar with ghcr. Would this replace dockerhub for the Docker image hub? I don't understand very well where will the image be uploaded.
  • Q: Is mvn package enough? I usually do mvn install for generating the JAR.
  • Q: Do I need to configure any secrets to make this work?
    Again, thanks a lot for this! Please add yourself to the contributor list in the README.

@renefritze renefritze changed the base branch from master to develop April 13, 2022 11:17
@renefritze
Copy link
Contributor Author

Thanks a lot, @renefritze. I have a couple of questions and 1 comment:

* Comment: can you please push to the dev branch? It's where we push things between releases.

Sure. Changed the PR target.

* Q: I am not very familiar with ghcr. Would this replace dockerhub for the Docker image hub? I don't understand very well where will the image be uploaded.
* Q: Do I need to configure any secrets to make this work?

These two are closely related. I chose the Github registry over dockerhub simply because you wouldn't need to configure any secrets for that. The workflow always has an active github token it uses.
If you want to use Dockerhub, then yes, I'd need to change the login portion of the workflow. And you'd need to create secrets here. Other than being a little simpler to setup, I think ghcr rate limit's are much less severe than on dockerhub.

* Q: Is mvn package enough? I usually do mvn install for generating the JAR.

I actually know next to nothing about java build tools, I just used the line from the Dockerfile 😉
Should that be mvn package && mvn install then?

  Again, thanks a lot for this! Please add yourself to the contributor list in the README.

You're very welcome. I'll do that.

@dgarijo
Copy link
Owner

dgarijo commented Apr 13, 2022

@renefritze ,
thanks. About the ghcr, your rationale makes sense to me. If I do a docker pull, would I need to configure anything to add this registry, or it knows by default?

About the mvn install, then I suggest leaving it as the Dockerfile does. I think it works either way.

@renefritze
Copy link
Contributor Author

@renefritze , thanks. About the ghcr, your rationale makes sense to me. If I do a docker pull, would I need to configure anything to add this registry, or it knows by default?

It is added as a prefix, so it would be docker pull ghcr.io/dgarijo/widoco:some_tag
The docker client, by default, is configured to just automatically add the docker.io prefix if you don't add one, which makes the "normal" pulls work.

@renefritze
Copy link
Contributor Author

btw, it would be easy to check the maven build against multiple different Java versions, which I think is a very nice thing if you have/want specified a range of supported versions.

@dgarijo
Copy link
Owner

dgarijo commented Apr 13, 2022 via email

@renefritze
Copy link
Contributor Author

I don't have experience with actual Github Releases from Actions. Uploading the produced jars from different jobs as artefacts so you can download them I can do.

@dgarijo
Copy link
Owner

dgarijo commented Apr 13, 2022 via email

@dgarijo
Copy link
Owner

dgarijo commented Apr 13, 2022 via email

@dgarijo
Copy link
Owner

dgarijo commented Apr 18, 2022

@renefritze the web service is up, and I have committed a small fix (now it's https). If you make this PR final, I will be happy to do a release to test it out.

@renefritze
Copy link
Contributor Author

The docker image builds and the maven tests also succeed. Have a look at the action summary
The JARs in those zip files all have the same identical filename. I guess putting the JDK source version in there to distinguish them would be a good idea?
The uploaded docker image can be found here
I've also pushed a git tag to my fork so you'll see how the image would be named for release versions.

@renefritze renefritze marked this pull request as ready for review April 19, 2022 07:38
this should now also work if the repo name isn't all lowercase
@dgarijo
Copy link
Owner

dgarijo commented Apr 19, 2022

Thanks a lot. Where can the JARS be seen? I cannot find them.

And yes, I agree that adding the Java version would be extremely helpful.

@dgarijo
Copy link
Owner

dgarijo commented Apr 19, 2022

nvm, I can see them now. This looks awesome, merging!

@dgarijo dgarijo merged commit 72a0e7f into dgarijo:develop Apr 19, 2022
@renefritze renefritze deleted the setup_gh_actions branch April 19, 2022 10:58
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.

2 participants