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

Commit 23c259f

Browse files
authored
Update make and add docker file to compile it in container (#12)
1 parent 4e99751 commit 23c259f

File tree

3 files changed

+29
-5
lines changed

3 files changed

+29
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ npm-debug.log
7272
node_modules
7373

7474
# Project and app
75+
build/*
7576
config.json
7677
!resource/sound/voice/testing_voice.wav
7778
resource/sound/voice/*

Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM golang:1.10-alpine
2+
3+
LABEL description="Image to compile project from container"
4+
5+
# Create working paths
6+
RUN mkdir -p /go/src/github.com/LinMAD/BitAccretion
7+
WORKDIR /go/src/github.com/LinMAD/BitAccretion
8+
9+
# Install dependecies
10+
RUN apk update && apk add --update \
11+
build-base make \
12+
git \
13+
nodejs nodejs-npm \
14+
alsa-lib-dev

Makefile

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,27 @@ prepare:
1515
go get -u golang.org/x/lint/golint
1616
go mod download
1717

18+
## Clean from artifacts
19+
clean:
20+
rm -rf build && mkdir build
21+
mkdir -p build/resource
22+
1823
## Compile go code
19-
build: golint gotest
20-
go build -o BitAccretion main.go
24+
build: golint gotest clean
25+
go build -o ./build/BitAccretion main.go
2126

2227
## Compile sound player
2328
plugin_sound:
24-
go build -buildmode=plugin -o ./sound.so extension/sound/player.go
29+
rm -rf build/sound.so
30+
cp -r resource/sound ./build/resource
31+
go build -buildmode=plugin -o ./build/sound.so extension/sound/player.go
2532

2633
## Compile fake provider
2734
plugin_fake:
28-
go build -buildmode=plugin -o ./provider.so extension/fake/provider.go
35+
rm -rf build/provider.so
36+
go build -buildmode=plugin -o ./build/provider.so extension/fake/provider.go
2937

3038
## Compile new relic provider
3139
plugin_relic:
32-
go build -buildmode=plugin -o ./provider.so extension/newrelic/provider.go
40+
rm -rf build/provider.so
41+
go build -buildmode=plugin -o ./build/provider.so extension/newrelic/provider.go

0 commit comments

Comments
 (0)