-
Notifications
You must be signed in to change notification settings - Fork 6
ci: Include multiplatform build template #12
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
Conversation
|
There was an error running your pipeline, see logs for details. |
0f9e6a4 to
7c570b6
Compare
|
There was an error running your pipeline, see logs for details. |
7c570b6 to
1966820
Compare
|
There was an error running your pipeline, see logs for details. |
9fc8b47 to
20c5a85
Compare
|
There was an error running your pipeline, see logs for details. |
20c5a85 to
15054b2
Compare
oldgiova
left a comment
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, just minor suggestions
| - if: '$CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z-]+)?/' | ||
| when: manual | ||
| - when: never | ||
| image: "quay.io/skopeo/stable:${SKOPEO_VERSION}" |
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.
Good to me. Minor (optional) suggestion: switch skopeo for regctl, just to have a unique standard tool. reference:
image: "registry.gitlab.com/northern.tech/mender/mender-test-containers:docker-multiplatform-buildx-v1-master"
regctl image copy ${GITLAB_REGISTRY_TAG} $DOCKER_REPOSITORY:$DOCKER_PUBLISH_TAG
But up to you
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.
I prefer using as few in-house images as possible in our pipelines since this generally leads to more maintenance overhead.
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.
I prefer using as few in-house images as possible in our pipelines since this generally leads to more maintenance overhead.
off-house images have given us headaches in the past too 😅 There it no golden rule.
| build:docker: | ||
| rules: | ||
| - when: never | ||
| script: ["true"] |
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.
Isn't this optional with the when: never rule?
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.
I tried that first, but then gitlab complained about the script section being empty.
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.
Basically here we should be overriding jobs from the template which have their script. If GitLab complained about script section being empty it means that the job was not added by the template in the first place, and hence no need for the rules to remove it.
You can use the pipeline editor while working on CI to quickly visualize and sanitize the pipeline.
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.
... but it would've been added if the branch was staging.
lluiscampos
left a comment
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.
Careful with the GOLANG_VERSION
.gitlab-ci.yml
Outdated
| GOLANG_VERSION: | ||
| description: "The version of the image: `docker.io/library/golang` to use for testing" | ||
| value: "1.21.1" |
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.
|
|
||
| DOCKER_REGISTRY: "docker.io" | ||
| DOCKER_REPOSITORY: northerntechhq/nt-connect | ||
|
|
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.
Real nice setting the variables ✨
| build:docker: | ||
| rules: | ||
| - when: never | ||
| script: ["true"] |
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.
Basically here we should be overriding jobs from the template which have their script. If GitLab complained about script section being empty it means that the job was not added by the template in the first place, and hence no need for the rules to remove it.
You can use the pipeline editor while working on CI to quickly visualize and sanitize the pipeline.
| - if: '$CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z-]+)?/' | ||
| when: manual | ||
| - when: never | ||
| image: "quay.io/skopeo/stable:${SKOPEO_VERSION}" |
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.
I prefer using as few in-house images as possible in our pipelines since this generally leads to more maintenance overhead.
off-house images have given us headaches in the past too 😅 There it no golden rule.
| "docker://${DOCKER_REPOSITORY}:${CI_COMMIT_SHA}" \ | ||
| "docker://${DOCKER_REPOSITORY}:${CI_COMMIT_REF_NAME}" | ||
| fi | ||
| artifacts: {} |
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.
Can you explain me why we need this job in the first place? What are the key differences from the one in the template?
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.
It uses a different set of rules for tagging. We use golang semantic versions for releases vX.Y.Z which results in tag X.Y.Z and X.Y. We don't use saas-* tags. We publish main and staging along with the commit sha.
Signed-off-by: Alf-Rune Siqveland <alf.rune@northern.tech>
15054b2 to
02fd7a4
Compare
Signed-off-by: Alf-Rune Siqveland <alf.rune@northern.tech>
No description provided.