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

Create a basic GHA job to replace travis #17

Merged
merged 2 commits into from
Sep 21, 2021

Conversation

elfiesmelfie
Copy link
Contributor

@elfiesmelfie elfiesmelfie commented Sep 14, 2021

Adding two jobs to build containers for use in collectd ci

  • a daily job for unstable/rolling distros
  • a weekly job for stable/released distros

Both jobs do the same thing for each listed distro:

  • build the container
  • push the tagged contaienr to dockerhub

@@ -0,0 +1,36 @@
name: Build

on:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this should also run on pushes to the separate container branches.

However, this would generate all new containers for everything, not just the changed container.
It might take some tweaking.

Comment on lines 6 to 8
# This will eventually be run on a schedule, daily initially, but some might be better weekly.
# schedule:
# - cron: '0 0 * * *'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
# This will eventually be run on a schedule, daily initially, but some might be better weekly.
# schedule:
# - cron: '0 0 * * *'
schedule:
- cron: '0 0 * * *'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This enables running daily at midnight, IINM.

github doesn't recognise @daily, @Weekly, etc aliases.

@mrunge mrunge closed this Sep 16, 2021
@mrunge mrunge reopened this Sep 16, 2021
@elfiesmelfie elfiesmelfie force-pushed the gha/build_containers branch 4 times, most recently from 789c0fb to 75de965 Compare September 16, 2021 17:02
Comment on lines +4 to +8
# These push/pr options will be removed one they are proven to work (one PR/push ought to do it)
pull_request:
branches: main
push:
branches: main
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These two conditions are here to get the workflow to trigger now, and show that it works. The can be removed prior to merging, by incorporating this suggestion

Suggested change
# These push/pr options will be removed one they are proven to work (one PR/push ought to do it)
pull_request:
branches: main
push:
branches: main
# These push/pr options will be removed one they are proven to work (one PR/push ought to do it)
pull_request:
branches: main
push:
branches: main

Comment on lines +4 to +8
# These push/pr options will be removed one they are proven to work (one PR/push ought to do it)
pull_request:
branches: main
push:
branches: main
Copy link
Contributor Author

@elfiesmelfie elfiesmelfie Sep 16, 2021

Choose a reason for hiding this comment

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

These two conditions are here to get the workflow to trigger now, and show that it works. The can be removed prior to merging, by incorporating this suggestion

Suggested change
# These push/pr options will be removed one they are proven to work (one PR/push ought to do it)
pull_request:
branches: main
push:
branches: main

@elfiesmelfie
Copy link
Contributor Author

The workflows aren't running here because they need to be merged to main, AFAICT. I've done this in my fork, and the workflows are running, and you can view them at [1]. They appear not to pass, however, it's mostly because I don't have credentials in my fork.
If you check the workflows that have run at [1], you can select them individually, and see the annotation on them, as well as the output. Some indicate that a username/password is required, which means it has gotten past the build stage successfully, and is trying to log into dockerhub to push the containers.

At this point, everything appear to be "working" (workflow failing due to incorrect credentials) for each branch except fedora_rawhide_x86_64.
[1] https://github.com/elfiesmelfie/ci-docker/actions

These will act as a template and allow new actions to be tested when
changes are pushed to dev branches.
This consist of two sets of jobs:
* daily builds that build unstable/rolling distros
* weekly job for stable distros

Both jobs will:

* Build each of the specified containers
* Push the container images to dockerhub
Copy link
Member

@mrunge mrunge 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 to me. I am aware of this reporting issues, but it's not working at the moment anyways.

@mrunge mrunge merged commit a53f8ba into collectd:main Sep 21, 2021
@elfiesmelfie elfiesmelfie deleted the gha/build_containers branch September 21, 2021 13:56
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