Skip to content

Commit 9b6d5bf

Browse files
cliedemanchristophwitzko
authored andcommitted
fix: Added gitlab docker image
1 parent 348f821 commit 9b6d5bf

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

.gitlab-ci.yml

+26-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ image: golang:1.14
33
stages:
44
- test
55
- build
6+
- image
67

78
test:
89
stage: test
@@ -11,6 +12,30 @@ test:
1112

1213
build:
1314
stage: build
15+
variables:
16+
CGO_ENABLED: 0
17+
artifacts:
18+
- ./out
1419
script:
15-
- go build ./cmd/semantic-release/
20+
- go build -o out/semantic-release ./cmd/semantic-release/
1621
- ./semantic-release -dry || true
22+
23+
image:
24+
stage: image
25+
tags:
26+
- docker
27+
cache: {}
28+
image: docker:latest
29+
variables:
30+
DOCKER_DRIVER: overlay2
31+
REGISTRY_IMAGE: registry.gitlab.com/go-semantic-release/semantic-release
32+
services:
33+
- docker:dind
34+
dependencies:
35+
- build
36+
only:
37+
- tags
38+
script:
39+
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
40+
- docker build --tag $REGISTRY_IMAGE:$CI_COMMIT_TAG
41+
- docker push $REGISTRY_IMAGE/web/server:$CI_COMMIT_TAG

Dockerfile

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Obtain latest ca-certificates
2+
FROM alpine:latest as certs
3+
RUN apk --update add ca-certificates
4+
5+
FROM scratch
6+
ADD out/semantic-release /usr/local/bin/release
7+
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
8+
CMD ["release"]

0 commit comments

Comments
 (0)