Skip to content

Commit 96c3e1b

Browse files
author
Angel Barrera
committed
Add container image automatic deploy
1 parent 7d5c3d1 commit 96c3e1b

3 files changed

Lines changed: 27 additions & 3 deletions

File tree

.goreleaser.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ before:
22
hooks:
33
- go mod download
44
builds:
5-
-
6-
env:
5+
- env:
76
- CGO_ENABLED=0
87
- GO111MODULE=on
8+
dockers:
9+
- image_templates:
10+
- angelbarrera92/{{.ProjectName}}:latest
11+
- angelbarrera92/{{.ProjectName}}:{{ .Major }}
12+
- angelbarrera92/{{.ProjectName}}:{{ .Tag }}

.travis.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ addons:
1010
# needed for the snap pipe:
1111
- snapd
1212

13+
services:
14+
- docker
15+
1316
env:
1417
- GO111MODULE=on PATH=/snap/bin:$PATH
1518

@@ -28,4 +31,9 @@ deploy:
2831
script: curl -sL https://git.io/goreleaser | bash
2932
on:
3033
tags: true
31-
condition: $TRAVIS_OS_NAME = linux
34+
condition: $TRAVIS_OS_NAME = linux
35+
36+
after_success:
37+
# docker login is required if you want to push docker images.
38+
# DOCKER_PASSWORD should be a secret in your .travis.yml configuration.
39+
- test -n "${TRAVIS_TAG}" && docker login -u=angelbarrera92 -p="${DOCKER_PASSWORD}"

Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM alpine as alpine
2+
3+
RUN apk add -U --no-cache ca-certificates
4+
5+
FROM scratch
6+
7+
WORKDIR /
8+
9+
COPY --from=alpine /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
10+
COPY basic-auth-reverse-proxy /basic-auth-reverse-proxy
11+
12+
ENTRYPOINT [ "/basic-auth-reverse-proxy" ]

0 commit comments

Comments
 (0)