Skip to content

Commit

Permalink
Merge pull request #16 from loafoe/master
Browse files Browse the repository at this point in the history
Support for go modules
  • Loading branch information
mlapshin committed Jan 13, 2020
2 parents 900d7c9 + 840bdb1 commit 8a639ad
Show file tree
Hide file tree
Showing 7 changed files with 688 additions and 389 deletions.
9 changes: 1 addition & 8 deletions .travis.yml
@@ -1,6 +1,6 @@
language: go
go:
- 1.10.x
- 1.12.x

cache:
directories:
Expand All @@ -25,13 +25,6 @@ script:
- GOOS=windows GOARCH=amd64 BINSUFFIX=-windows-amd64.exe make
- GOOS=windows GOARCH=386 BINSUFFIX=-windows-386.exe make
- GOOS=darwin GOARCH=amd64 BINSUFFIX=-darwin-amd64 make
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- "[ ! -z \"$TRAVIS_TAG\" ] && make docker || echo 'non-tag build'"

before_install:
- curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
- curl -L https://github.com/tcnksm/ghr/releases/download/v0.12.0/ghr_v0.12.0_linux_amd64.tar.gz --output ghr.tar.gz && tar zxvf ghr.tar.gz

after_script:
- ghr_v0.12.0_linux_amd64/ghr --username fhirbase -r fhirbase --token $GITHUB_TOKEN --prerelease -replace --debug nightly-build bin/
- "[ ! -z \"$TRAVIS_TAG\" ] && ghr_v0.12.0_linux_amd64/ghr --username fhirbase -r fhirbase --token $GITHUB_TOKEN -n $TRAVIS_TAG --debug $TRAVIS_TAG bin/"
22 changes: 20 additions & 2 deletions Dockerfile
@@ -1,7 +1,25 @@
# Build with modules
FROM golang:1.12.1-alpine as builder
RUN apk add --no-cache ca-certificates curl git build-base

# Get dependencies first for docker caching
WORKDIR /fhirbase
COPY go.mod .
COPY go.sum .
RUN go mod download

# Copy source
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -tags netgo -ldflags '-w -extldflags "-static"'

FROM postgres:10.5
WORKDIR /fhirbase

COPY demo/bundle.ndjson.gzip .
COPY bin/fhirbase-linux-amd64 /usr/bin/fhirbase
COPY --from=builder /fhirbase/demo/bundle.ndjson.gzip .
COPY --from=builder /fhirbase/fhirbase /usr/bin/fhirbase
COPY --from=builder /fhirbase/schema /fhirbase/schema
COPY --from=builder /fhirbase/transform /fhirbase/transform
COPY --from=builder /fhirbase/web /fhirbase/web

RUN chmod +x /usr/bin/fhirbase

Expand Down
327 changes: 0 additions & 327 deletions Gopkg.lock

This file was deleted.

0 comments on commit 8a639ad

Please sign in to comment.