forked from pwaller/associate-ebs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from sensiblecodeio/standardise-build
Standardise the build
- Loading branch information
Showing
4 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: | ||
master | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
name: Build and run | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Build | ||
run: | | ||
make build | ||
- name: Run | ||
run: | | ||
./associate-ebs 2>&1 | grep "usage: associate-ebs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/associate-ebs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM golang:1.14.4-alpine | ||
|
||
# Turn off cgo for a more static binary. | ||
# Specify cache directory so that we can run as nobody to build the binary. | ||
ENV CGO_ENABLED=0 XDG_CACHE_HOME=/tmp/.cache | ||
|
||
USER nobody:nogroup | ||
|
||
WORKDIR /go/src/github.com/sensiblecodeio/associate-ebs | ||
|
||
COPY go.mod go.sum ./ | ||
RUN go mod download | ||
|
||
COPY . . | ||
RUN go install -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
build: | ||
docker build -t associate-ebs . | ||
docker run --rm associate-ebs cat /go/bin/associate-ebs > associate-ebs | ||
chmod u+x associate-ebs | ||
|
||
clean: | ||
rm associate-ebs | ||
|
||
.PHONY: clean |