Skip to content

Commit

Permalink
Merge pull request #1 from vulcanize/cicd
Browse files Browse the repository at this point in the history
fix CI/CD. rename master to main branch
  • Loading branch information
ramilexe authored Jan 13, 2021
2 parents eee264c + 280564d commit d8acb93
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/on-master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Docker Compose Build
on:
push:
branches:
- master
- main

jobs:
build:
Expand Down
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM golang:1.13-alpine as builder

RUN apk --update --no-cache add make git g++ linux-headers
# DEBUG
RUN apk add busybox-extras

# Get and build gap-filler
ADD . /go/src/github.com/vulcanize/gap-filler
WORKDIR /go/src/github.com/vulcanize/gap-filler
RUN make linux

# app container
FROM alpine

# keep binaries immutable
COPY --from=builder /go/src/github.com/vulcanize/gap-filler/build/gap-filler-linux gap-filler

EXPOSE 8080

ENTRYPOINT ["/app/gap-filler"]
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ endif
ifneq ($(shell git status --porcelain),)
VERSION := $(VERSION)-dirty
endif
LDFLAGS := -ldflags "-w -s -X 'github.com/vulcanize/gap-filler-service/cmd.version=$(VERSION)'"
LDFLAGS := -ldflags "-w -s -X 'github.com/vulcanize/gap-filler/cmd.version=$(VERSION)'"

all: clean test linux darwin windows

Expand All @@ -26,15 +26,15 @@ test:

linux:
if [ ! -d "build" ]; then mkdir "build"; fi
GOOS=linux GOARCH=amd64 go build ${LDFLAGS} -o build/gapfiller-linux-${COMMIT}
GOOS=linux GOARCH=amd64 go build ${LDFLAGS} -o build/gap-filler-linux

darwin:
if [ ! -d "build" ]; then mkdir "build"; fi
GOOS=darwin GOARCH=amd64 go build ${LDFLAGS} -o build/gapfiller-darwin-${COMMIT}
GOOS=darwin GOARCH=amd64 go build ${LDFLAGS} -o build/gapfiller-darwin

windows:
if [ ! -d "build" ]; then mkdir "build"; fi
GOOS=windows GOARCH=amd64 go build ${LDFLAGS} -o build/gapfiller-windows-${COMMIT}
GOOS=windows GOARCH=amd64 go build ${LDFLAGS} -o build/gapfiller-windows

## Build docker image
.PHONY: docker-build
Expand Down

0 comments on commit d8acb93

Please sign in to comment.