-
Notifications
You must be signed in to change notification settings - Fork 7
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
Compile time versioning #42
Conversation
Is there a need to build this locally? I've changed the method to work around the codefresh/goreleaser method... But this Alternately, we could use a |
hack/docker_entrypoint.sh
Outdated
iris "$@" |
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.
With ldflags we dont need that file anymore
Dockerfile
Outdated
|
||
COPY dist/iris_linux_386/iris /usr/local/bin/ | ||
COPY hack/docker_entrypoint.sh /entrypoint.sh | ||
COPY VERSION /VERSION | ||
|
||
ENTRYPOINT ["sh", "entrypoint.sh"] |
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 now be just ENTRYPOINT [ "/usr/local/bin/iris" ]
Dockerfile
Outdated
@@ -1,10 +1,9 @@ | |||
FROM alpine:3.8 | |||
|
|||
RUN apk add --update ca-certificates | |||
RUN apk --no-cache add --update ca-certificates | |||
|
|||
COPY dist/iris_linux_386/iris /usr/local/bin/ | |||
COPY hack/docker_entrypoint.sh /entrypoint.sh |
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.
Irrelevant as well
Thanks, wanted to update ldflags a long time ago |
image: alpine:3.8 | ||
stage: Integration | ||
commands: | ||
- apk add --no-cache curl jq python py-pip | ||
- pip install yq | ||
- sh ${{CF_VOLUME_PATH}}/iris/hack/.codefresh/push-helm.sh | ||
# ^-- cfexports IRIS_VERSION from VERSION file |
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.
cf_export IRIS_VERSION=$(cat VERSION)
should do the job
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.
No, that's just a comment explaining that the script exports that. It took me a while to find where IRIS_VERSION
was coming from, so I added the comment pointing to that script.
https://github.com/olegsu/iris/blob/master/hack/.codefresh/push-helm.sh#L25
lgtm |
This will build a Docker image with compile time version info built in. It hooks into the
build.sh
, so localmake
will work as well.I don't know how you're building in Codefresh, so this may or may not work there. But you can steal the basic idea, or tell me how to change this to get to where it needs to be.Closes #35