-
Notifications
You must be signed in to change notification settings - Fork 173
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
Use cron jobs from Circleci to trigger Docker Hub builds #312
Closed
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
abe1b6e
Add con job via circleci
ruffsl 58b1341
Add deploy job to master
ruffsl e2364ad
Remove trailing newline
ruffsl 26f4c6b
Use docker image with curl
ruffsl a1568c2
Fix string quotes
ruffsl 666ced2
Fix curl command format
ruffsl db959d6
Refactor
ruffsl 426bb22
Suppress stdout
ruffsl 12e2b83
Prevent CircleCI from hanging on curl competition
ruffsl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
version: 2.1 | ||
|
||
references: | ||
trigger_osrf_ros2_nightly: &trigger_osrf_ros2_nightly | ||
trigger_docker_hub: | ||
url: ${DOCKER_TRIGGER_URL_ROS2} | ||
data: >- | ||
'{"docker_tag": "nightly"}' | ||
trigger_osrf_ros2_devel: &trigger_osrf_ros2_devel | ||
trigger_docker_hub: | ||
url: ${DOCKER_TRIGGER_URL_ROS2} | ||
data: >- | ||
'{"docker_tag": "devel"}' | ||
|
||
commands: | ||
trigger_docker_hub: | ||
description: "Trigger Docker Hub" | ||
parameters: | ||
data: | ||
type: string | ||
url: | ||
type: string | ||
steps: | ||
- run: | ||
name: Trigger Docker Hub | ||
command: | | ||
curl --request POST \ | ||
--header "Content-Type: application/json" \ | ||
--data << parameters.data >> \ | ||
--url << parameters.url >> \ | ||
> /dev/null && true | ||
when: always | ||
|
||
executors: | ||
docker_exec: | ||
docker: | ||
- image: circleci/python | ||
|
||
jobs: | ||
osrf_ros2: | ||
executor: docker_exec | ||
steps: | ||
- *trigger_osrf_ros2_nightly | ||
- *trigger_osrf_ros2_devel | ||
osrf_ros2_nightly: | ||
executor: docker_exec | ||
steps: | ||
- *trigger_osrf_ros2_nightly | ||
osrf_ros2_devel: | ||
executor: docker_exec | ||
steps: | ||
- *trigger_osrf_ros2_devel | ||
|
||
workflows: | ||
version: 2 | ||
deploy: | ||
jobs: | ||
- osrf_ros2: | ||
context: dockerhub | ||
filters: | ||
branches: | ||
only: master | ||
nightly: | ||
jobs: | ||
- osrf_ros2_nightly: | ||
context: dockerhub | ||
triggers: | ||
- schedule: | ||
cron: "0 0 * * *" | ||
filters: | ||
branches: | ||
only: | ||
- master | ||
daily: | ||
jobs: | ||
- osrf_ros2_devel: | ||
context: dockerhub | ||
triggers: | ||
- schedule: | ||
cron: "0 12 * * *" | ||
filters: | ||
branches: | ||
only: | ||
- master |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these parameters masked out of the build log and is the build log public or just the build status?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build logs are public for public repos, but environment variables are not expanded prior to logging the contents of the run script, nor is the token printed to stdout by the return message from the POST request. I'm not sure CircleCI masks secrets yet, it was a requested feature last I checked. But that won't be an issue here. Example:
https://circleci.com/gh/ruffsl/docker_images/23