Skip to content
This repository has been archived by the owner on Aug 4, 2023. It is now read-only.

Commit

Permalink
Merge pull request #474 from h3poteto/feature/mod
Browse files Browse the repository at this point in the history
Introduce go module mode instead of dep
  • Loading branch information
h3poteto committed Nov 2, 2019
2 parents 35f0cf4 + 729cf4e commit 4c88550
Show file tree
Hide file tree
Showing 7 changed files with 193 additions and 630 deletions.
15 changes: 8 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ version: 2
jobs:
build:
docker:
- image: h3poteto/golang:1.11.2
- image: h3poteto/golang:1.13.4
environment:
GO11MODULE: "on"
APPROOT: /go/src/github.com/h3poteto/fascia
APPENV: test
DATABASE_URL: 127.0.0.1
Expand All @@ -25,18 +26,18 @@ jobs:
- restore_cache:
name: Restoring cache - vendor
keys:
- vendor-{{ checksum "Gopkg.toml" }}-{{ checksum "Gopkg.lock" }}
- mod-{{ arch }}-{{ checksum "go.mod" }}-{{ checksum "go.sum" }}
- run:
name: Install
command: go mod download
- run:
name: Generate assets file
command: go generate
- run:
name: Go packages install
command: .circleci/scripts/dep_ensure.sh
- save_cache:
name: Saving cache - vendor
key: vendor-{{ checksum "Gopkg.toml" }}-{{ checksum "Gopkg.lock" }}
key: mod-{{arch }}-{{ checksum "go.mod" }}-{{ checksum "go.sum" }}
paths:
- "vendor"
- "/go/pkg/mod"
- run:
name: Checking mysql connection
command: |
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ RUN set -x \
&& npm run release-compile


FROM h3poteto/golang:1.11.2
FROM h3poteto/golang:1.13.4

USER root
ENV GOPATH /go
ENV APPROOT ${GOPATH}/src/github.com/h3poteto/fascia
ENV APPENV production
ENV GO11MODULE on

RUN set -x \
&& apk add --no-cache \
Expand All @@ -34,7 +35,7 @@ RUN chown -R go:go ${APPROOT}
USER go

RUN set -x \
&& dep ensure \
&& go module download \
&& go generate \
&& go build -o bin/fascia

Expand Down

0 comments on commit 4c88550

Please sign in to comment.