Skip to content
Snippets Groups Projects
Commit ddf29d6b authored by Thomas Schneider's avatar Thomas Schneider
Browse files

WIP: add container build stuff

parent 17288401
No related branches found
No related tags found
No related merge requests found
Pipeline #4148 failed
...@@ -28,3 +28,40 @@ lint: ...@@ -28,3 +28,40 @@ lint:
reports: reports:
junit: golangci-output.xml junit: golangci-output.xml
expire_in: 7 days expire_in: 7 days
build:
image: golang:1-alpine
stage: build
before_script:
- go version
script:
- >-
CGO_ENABLED=0
go build
-v
-o webhook
-ldflags '-w -s -extldflags "-static"'
.
artifacts:
paths:
- webhook
build-image:
image: alpine:3
stage: deploy
needs:
- build
before_script:
- apk --no-cache add buildah ca-certificates-bundle
- >-
buildah login
--username "$CI_REGISTRY_USER"
--password "$CI_REGISTRY_PASSWORD"
"$CI_REGISTRY"
script:
- ctr=$(buildah from scratch)
- buildah copy $ctr /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
- buildah copy $ctr webhook /webhook
- buildah config --entrypoint '["/webhook"]' $ctr
- buildah commit --squash $ctr $CI_REGISTRY_IMAGE:exp-$CI_COMMIT_SHA
- buildah push $CI_REGISTRY_IMAGE:exp-$CI_COMMIT_SHA
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment