-
Notifications
You must be signed in to change notification settings - Fork 980
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
Support to deploy specific image #1507
Conversation
example. https://github.com/kenhys/fluentd-kubernetes-daemonset/actions/runs/9888071990
|
need to reconsider define-matrix. |
Simplified now.
https://github.com/kenhys/fluentd-kubernetes-daemonset/actions/runs/9901671261
https://github.com/kenhys/fluentd-kubernetes-daemonset/actions/runs/9901705884 |
Thanks! It was my fault. I'm Sorry for this. env:
ALL_COMPONENTS: >
[
"debian-azureblob",
"debian-cloudwatch",
"debian-elasticsearch7",
"debian-elasticsearch8",
"debian-forward",
"debian-gcs",
"debian-graylog",
"debian-kafka",
"debian-kafka2",
"debian-kinesis",
"debian-logentries",
"debian-loggly",
"debian-logzio",
"debian-opensearch",
"debian-papertrail",
"debian-s3",
"debian-syslog"
]
outputs:
components: ${{ env.ALL_COMPONENTS }} Based on this, how about outputting only the component if its name is included in the tag? define-matrix:
runs-on: ubuntu-latest
env:
ALL_COMPONENTS: >
[
"debian-azureblob",
"debian-cloudwatch",
"debian-elasticsearch7",
"debian-elasticsearch8",
"debian-forward",
"debian-gcs",
"debian-graylog",
"debian-kafka",
"debian-kafka2",
"debian-kinesis",
"debian-logentries",
"debian-loggly",
"debian-logzio",
"debian-opensearch",
"debian-papertrail",
"debian-s3",
"debian-syslog"
]
outputs:
components: >
${{ steps.arrange-components.outputs.for_all == 'true' && env.ALL_COMPONENTS
|| format('["{0}"]', steps.arrange-components.outputs.component) }}
steps:
- id: arrange-components
run: |
echo "for_all=true" >> "$GITHUB_OUTPUT"
for component in ${{ join(fromJSON(env.ALL_COMPONENTS), ' ') }}; do
if [[ ${{ env.github.ref_name }} == *"$component"* ]]; then
echo "for_all=false" >> "$GITHUB_OUTPUT"
echo "component=$component" >> "$GITHUB_OUTPUT"
break
fi
done |
I have checked this works.
|
Before: when tagged, it deploy all images After: Allow to deploy specific image with tag * tag v1.17.0-1.n => deploy all images * tag v1.17.0-debian-graylog-1.n => deploy graylog images Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
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.
LGTM! Thanks!
Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
Backport #1507 to deploy specific image for v1.16
Before:
when tagged, it deploy all images
After:
Allow to deploy specific image with tag