Skip to content

Commit

Permalink
Merge pull request #2 from sensiblecodeio/standardise-build
Browse files Browse the repository at this point in the history
Standardise the build
  • Loading branch information
StevenMaude authored Jun 10, 2020
2 parents c35228d + ff7d556 commit 5a72e6a
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/ci-build.yml
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"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/associate-ebs
15 changes: 15 additions & 0 deletions Dockerfile
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
9 changes: 9 additions & 0 deletions Makefile
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

0 comments on commit 5a72e6a

Please sign in to comment.