Remove git commit message from binary

This appears to have broken CI at least three times now and
prevented us from shipping a release binary for a tag.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
This commit is contained in:
Alex Ellis (OpenFaaS Ltd)
2021-01-31 09:21:33 +00:00
parent 82cd46ef2a
commit f98213a428
4 changed files with 1 additions and 7 deletions

View File

@ -42,7 +42,6 @@ jobs:
build-args: |
VERSION=${{ steps.get_tag.outputs.TAG }}
GIT_COMMIT=${{ github.sha }}
GIT_COMMIT_MESSAGE=${{ steps.get_commit_message.outputs.commit_message }}
tags: |
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/gateway:${{ steps.get_tag.outputs.TAG }}
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/gateway:${{ github.sha }}

View File

@ -45,7 +45,6 @@ jobs:
build-args: |
VERSION=${{ steps.get_tag.outputs.TAG }}
GIT_COMMIT=${{ github.sha }}
GIT_COMMIT_MESSAGE="${{ steps.get_commit_message.outputs.commit_message }}"
tags: |
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/gateway:${{ steps.get_tag.outputs.TAG }}
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/gateway:${{ github.sha }}

View File

@ -11,7 +11,6 @@ ARG TARGETOS
ARG TARGETARCH
ARG GIT_COMMIT
ARG GIT_COMMIT_MESSAGE
ARG VERSION
COPY --from=license-check /license-check /usr/bin/
@ -45,7 +44,6 @@ RUN go test $(go list ./... | grep -v integration | grep -v /vendor/ | grep -v /
RUN CGO_ENABLED=${CGO_ENABLED} GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build --ldflags "-s -w \
-X \"github.com/openfaas/faas/gateway/version.GitCommitSHA=${GIT_COMMIT}\" \
-X \"github.com/openfaas/faas/gateway/version.GitCommitMessage=${GIT_COMMIT_MESSAGE}\" \
-X \"github.com/openfaas/faas/gateway/version.Version=${VERSION}\" \
-X github.com/openfaas/faas/gateway/types.Arch=${TARGETARCH}" \
-a -installsuffix cgo -o gateway .

View File

@ -26,11 +26,9 @@ const NameExpression = "-a-zA-Z_0-9."
func main() {
if len(version.GitCommitMessage) == 0 {
version.GitCommitMessage = "Place-holder for commit message"
version.GitCommitMessage = "See GitHub for latest changes"
}
// log.Printf("Commit: %s", version.GitCommitMessage)
osEnv := types.OsEnv{}
readConfig := types.ReadConfig{}
config, configErr := readConfig.Read(osEnv)