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

Add github actions and test #45

Merged
merged 7 commits into from
Oct 6, 2021
Merged

Add github actions and test #45

merged 7 commits into from
Oct 6, 2021

Conversation

nilsnolde
Copy link
Collaborator

@nilsnolde nilsnolde commented Oct 5, 2021

  • migrated image builds to github actions
  • kept dockerhub as repo
  • only tag pushes will actually push the image to dockerhub
  • added a test that's triggered on tag pushes & pull requests

and sorry @jcoupey , those env vars were just half the story.. you'd also need to generate a token on dockerhub that you can use as the docker password env: https://github.com/docker/login-action#docker-hub. would've expected that your actual password works, but it's safer this way anyways I guess..

can you let me know when you did that? once that's done I'll push a v1.11.0-rc.1 tag and see if it pushes to dockerhub alright and we can merge (apart from general review)..

the test already went through: https://github.com/VROOM-Project/vroom-docker/runs/3805886373?check_suite_focus=true

@nilsnolde nilsnolde requested a review from jcoupey October 5, 2021 17:16
push:
branches:
- 'master'
- 'add-gh-actions'
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

just for initial testing, next commit will remove it again, now that it's a PR

PORT=3005

# save the query to eval later
status_request="curl -X POST -H 'Content-Type: application/json' -d @tests/test_req.json http://localhost:${PORT}"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

just requests the healthcheck example, included in this repo

Copy link
Contributor

@jcoupey jcoupey left a comment

Choose a reason for hiding this comment

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

Looks good as far as my limited GitHub Actions experience can tell. I did replace the DOCKER_PASSWORD secret with a token generated from Docker Hub for user DOCKER_USERNAME.

@nilsnolde nilsnolde merged commit 58c7274 into master Oct 6, 2021
@nilsnolde
Copy link
Collaborator Author

@jcoupey doesn't quite work yet for some reason.. don't think it's the github action, I guess there's still a problem with the secrets:
https://github.com/VROOM-Project/vroom-docker/runs/3812883690?check_suite_focus=true

ref docker/login: https://github.com/docker/login-action#docker-hub

@nilsnolde
Copy link
Collaborator Author

what's your username? you need to use the docker ID (for me nilsnolde), not the email (I think you log in on dockerhub.com with email, but you can't authenticate with it, dockerhub is a mess)

@nilsnolde
Copy link
Collaborator Author

you can try in your terminal if it works with the values: docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"

@jcoupey
Copy link
Contributor

jcoupey commented Oct 6, 2021

I was using docker id all right (not email). I just reset the DOCKER_USERNAME and DOCKER_PASSWORD values using id and token and it seems to work after re-running the job?

The fun (!?) thing is that using the same credentials in the above docker login command fails (permission denied).

@jcoupey
Copy link
Contributor

jcoupey commented Oct 6, 2021

And the RC tag is now available on Docker hub: https://hub.docker.com/layers/vroomvrp/vroom-docker/1.11.0-rc.1/images/sha256-f9fb835cc471676d39aaa0b89c16c8c2e2caa8c545e445ed4e05806e1c9e6d0c?context=explore

Nit: this tag breaks the convention from previous versions, it should be v1.11.0-rc.1

@jcoupey
Copy link
Contributor

jcoupey commented Oct 6, 2021

In related news: looks like GitHub only relies on diffs to decide if a PR is merged, regardless of whether the branch has actually been git-merged. A bit misleading at first!

@nilsnolde
Copy link
Collaborator Author

nilsnolde commented Oct 6, 2021

great!

Nit: this tag breaks the convention from previous versions, it should be v1.11.0-rc.1

that's then a bug in https://github.com/docker/metadata-action#typesemver, where it says tags: type=semver,pattern={{raw}} would simply use the raw tag name without strictly converting to semantic versioning. I'll use tags: type=semver,pattern=v{{raw}} then.

you wanna remove the docker image from dockerhub and I'll force push the tag again with the fix above so it's consistent?

@jcoupey
Copy link
Contributor

jcoupey commented Oct 6, 2021

you wanna remove the docker image from dockerhub and I'll force push the tag again with the fix above so it's consistent?

Yes, I just deleted it.

@nilsnolde
Copy link
Collaborator Author

nilsnolde commented Oct 6, 2021

jeez.. https://github.com/VROOM-Project/vroom-docker/runs/3813717695?check_suite_focus=true

the metadata action still thinks the v should be dropped.. that's why I hate these blackbox plugin tools which are basically untestable.. I'll postpone this for now and get back to it on the weekend

btw, nothing was pushed this time, I cancelled the workflow before it got that far

@nilsnolde
Copy link
Collaborator Author

@jcoupey
Copy link
Contributor

jcoupey commented Oct 7, 2021

Thanks for the effort @nilsnolde.

@nilsnolde
Copy link
Collaborator Author

wasn't quite out of the woods yet.. didn't really work for anything else than tagged releases. to avoid overly complex instructions, I just split it up in 2 action files.

@nilsnolde nilsnolde deleted the add-gh-actions branch November 16, 2023 09:30
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