Skip to content
This repository was archived by the owner on Nov 10, 2023. It is now read-only.

Commit 36577e6

Browse files
committed
Update Go to 1.11 & circleci configs
1 parent cde6ecb commit 36577e6

3 files changed

Lines changed: 48 additions & 27 deletions

File tree

.circleci/config.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
version: 2
2+
jobs:
3+
build:
4+
docker:
5+
- image: docker:18.06.1-ce-git
6+
working_directory: ~/whereabouts
7+
steps:
8+
- checkout
9+
- setup_remote_docker:
10+
version: 18.05.0-ce
11+
- run: docker build --pull -t ${DOCKER_HUB_IMAGE} .
12+
- run: mkdir -p workspace
13+
- run: docker save ${DOCKER_HUB_IMAGE} | gzip > image.tar.gz
14+
- persist_to_workspace:
15+
root: workspace
16+
paths:
17+
- image.tar.gz
18+
deploy:
19+
docker:
20+
- image: docker:18.06.1-ce
21+
working_directory: ~/whereabouts
22+
steps:
23+
- attach_workspace:
24+
at: workspace
25+
- setup_remote_docker:
26+
version: 18.05.0-ce
27+
- deploy:
28+
name: Deploy the image to Docker Hub
29+
command: |
30+
zcat workspace/image.tar.gz | docker load
31+
docker tag ${DOCKER_HUB_IMAGE} ${DOCKER_HUB_IMAGE}:${CIRCLE_TAG}
32+
docker login -u ${DOCKER_HUB_USER} -p ${DOCKER_HUB_PASS}
33+
docker push ${DOCKER_HUB_IMAGE}:${CIRCLE_TAG}
34+
docker push ${DOCKER_HUB_IMAGE}
35+
36+
workflows:
37+
version: 2
38+
build-and-deploy:
39+
jobs:
40+
- build
41+
- deploy:
42+
required:
43+
- build
44+
filters:
45+
tags:
46+
only: /^v[0-9]+\.[0-9]+\.[0-9]+$/

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
FROM golang:1.8-alpine AS builder
1+
FROM golang:1.11-alpine AS builder
22
WORKDIR /go/src/whereabouts
33
COPY . .
44
RUN CGO_ENABLED=0 go build -o /whereabouts -ldflags="-s -w"
55

6-
FROM alpine:3.6
6+
FROM alpine:3.8
77
RUN apk --no-cache add ca-certificates
88
COPY --from=builder /whereabouts /
99
RUN adduser -D app && chown app:app /whereabouts

circle.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)