Remove build time and git tag from binary artifact.
That way it's easy to build a given commit and check whether it's the same binary than the one published on Github.pull/550/head^2
parent
1deb46778c
commit
a823b6368a
|
@ -21,9 +21,7 @@ COPY internal internal
|
|||
# Set the build version and time
|
||||
RUN echo "Write tag ${BUILD_TAG} and commit ${BUILD_COMMIT} in binary." && \
|
||||
BUILD_TIME=`date +"%Y-%m-%d %T"` && \
|
||||
sed -i "s/__BUILD_TAG__/${BUILD_TAG}/" cmd/authelia/constants.go && \
|
||||
sed -i "s/__BUILD_COMMIT__/${BUILD_COMMIT}/" cmd/authelia/constants.go && \
|
||||
sed -i "s/__BUILD_TIME__/${BUILD_TIME}/" cmd/authelia/constants.go
|
||||
sed -i "s/__BUILD_COMMIT__/${BUILD_COMMIT}/" cmd/authelia/constants.go
|
||||
|
||||
# CGO_ENABLED=1 is mandatory for building go-sqlite3
|
||||
RUN cd cmd/authelia && \
|
||||
|
@ -59,4 +57,4 @@ EXPOSE 9091
|
|||
VOLUME /etc/authelia
|
||||
VOLUME /var/lib/authelia
|
||||
|
||||
CMD ["./authelia", "--config", "/etc/authelia/configuration.yml"]
|
||||
CMD ["./authelia", "--config", "/etc/authelia/configuration.yml"]
|
||||
|
|
|
@ -24,9 +24,7 @@ COPY internal internal
|
|||
# Set the build version and time
|
||||
RUN echo "Write tag ${BUILD_TAG} and commit ${BUILD_COMMIT} in binary." && \
|
||||
BUILD_TIME=`date +"%Y-%m-%d %T"` && \
|
||||
sed -i "s/__BUILD_TAG__/${BUILD_TAG}/" cmd/authelia/constants.go && \
|
||||
sed -i "s/__BUILD_COMMIT__/${BUILD_COMMIT}/" cmd/authelia/constants.go && \
|
||||
sed -i "s/__BUILD_TIME__/${BUILD_TIME}/" cmd/authelia/constants.go
|
||||
sed -i "s/__BUILD_COMMIT__/${BUILD_COMMIT}/" cmd/authelia/constants.go
|
||||
|
||||
# CGO_ENABLED=1 is mandatory for building go-sqlite3
|
||||
RUN cd cmd/authelia && \
|
||||
|
@ -66,4 +64,4 @@ EXPOSE 9091
|
|||
VOLUME /etc/authelia
|
||||
VOLUME /var/lib/authelia
|
||||
|
||||
CMD ["./authelia", "--config", "/etc/authelia/configuration.yml"]
|
||||
CMD ["./authelia", "--config", "/etc/authelia/configuration.yml"]
|
||||
|
|
|
@ -24,9 +24,7 @@ COPY internal internal
|
|||
# Set the build version and time
|
||||
RUN echo "Write tag ${BUILD_TAG} and commit ${BUILD_COMMIT} in binary." && \
|
||||
BUILD_TIME=`date +"%Y-%m-%d %T"` && \
|
||||
sed -i "s/__BUILD_TAG__/${BUILD_TAG}/" cmd/authelia/constants.go && \
|
||||
sed -i "s/__BUILD_COMMIT__/${BUILD_COMMIT}/" cmd/authelia/constants.go && \
|
||||
sed -i "s/__BUILD_TIME__/${BUILD_TIME}/" cmd/authelia/constants.go
|
||||
sed -i "s/__BUILD_COMMIT__/${BUILD_COMMIT}/" cmd/authelia/constants.go
|
||||
|
||||
# CGO_ENABLED=1 is mandatory for building go-sqlite3
|
||||
RUN cd cmd/authelia && \
|
||||
|
@ -66,4 +64,4 @@ EXPOSE 9091
|
|||
VOLUME /etc/authelia
|
||||
VOLUME /var/lib/authelia
|
||||
|
||||
CMD ["./authelia", "--config", "/etc/authelia/configuration.yml"]
|
||||
CMD ["./authelia", "--config", "/etc/authelia/configuration.yml"]
|
||||
|
|
|
@ -2,4 +2,3 @@ package main
|
|||
|
||||
var BuildTag = "__BUILD_TAG__"
|
||||
var BuildCommit = "__BUILD_COMMIT__"
|
||||
var BuildTime = "__BUILD_TIME__"
|
||||
|
|
|
@ -114,9 +114,7 @@ func main() {
|
|||
versionCmd := &cobra.Command{
|
||||
Use: "version",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
fmt.Printf("build git tag: %s\n", BuildTag)
|
||||
fmt.Printf("build git commit: %s\n", BuildCommit)
|
||||
fmt.Printf("build time: %s\n", BuildTime)
|
||||
},
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue