@@ -4,13 +4,13 @@ runUnitTests:
4
4
go test -v ./...
5
5
6
6
buildNodeFrontend :
7
- cd static && yarn install
8
- cd static && yarn build
9
- cd static && rm build/static/** /* .map
7
+ cd web && yarn install
8
+ cd web && yarn build
9
+ cd web && rm build/static/** /* .map
10
10
11
11
embedFrontend :
12
- cd handlers/tmpls && esc -o tmpls.go -pkg tmpls -include ^* \. html .
13
- cd handlers && esc -o static.go -pkg handlers -prefix ../static/ build ../static /build
12
+ cd internal/ handlers/tmpls && esc -o tmpls.go -pkg tmpls -include ^* \. html .
13
+ cd internal/ handlers && esc -o static.go -pkg handlers -prefix ../../web/ build ../../web /build
14
14
15
15
getCMDDependencies :
16
16
go get -v github.com/mattn/goveralls
@@ -23,13 +23,13 @@ getGoDependencies:
23
23
buildProject :
24
24
rm -rf releases
25
25
mkdir releases
26
- gox -output=" releases/{{.Dir}}_{{.OS}}_{{.Arch}}/{{.Dir}}" -osarch=" linux/amd64 linux/arm windows/amd64 windows/386" -ldflags=" -X github.com/mxschmitt/golang-url-shortener/util.ldFlagNodeJS=` node --version` -X github.com/mxschmitt/golang-url-shortener/util.ldFlagCommit=` git rev-parse HEAD` -X github.com/mxschmitt/golang-url-shortener/util.ldFlagYarn=` yarn --version` -X github.com/mxschmitt/golang-url-shortener/util.ldFlagCompilationTime=` TZ=UTC date +%Y-%m-%dT%H:%M:%S+0000` "
27
- find releases -maxdepth 1 -mindepth 1 -type d -exec cp build/ config.yaml {} \;
26
+ gox -output=" releases/{{.Dir}}_{{.OS}}_{{.Arch}}/{{.Dir}}" -osarch=" linux/amd64 linux/arm windows/amd64 windows/386" -ldflags=" -X github.com/mxschmitt/golang-url-shortener/internal/ util.ldFlagNodeJS=` node --version` -X github.com/mxschmitt/golang-url-shortener/internal/ util.ldFlagCommit=` git rev-parse HEAD` -X github.com/mxschmitt/golang-url-shortener/internal/ util.ldFlagYarn=` yarn --version` -X github.com/mxschmitt/golang-url-shortener/internal/ util.ldFlagCompilationTime=` TZ=UTC date +%Y-%m-%dT%H:%M:%S+0000` " ./cmd/golang-url-shortener
27
+ find releases -maxdepth 1 -mindepth 1 -type d -exec cp config/example .yaml {} \;
28
28
find releases -maxdepth 1 -mindepth 1 -type d -exec tar -cvjf {}.tar.bz2 {} \;
29
29
30
30
buildDockerImage :
31
31
rm -rf docker_releases
32
32
mkdir docker_releases
33
- CGO_ENABLED=0 gox -output=" docker_releases/{{.Dir}}_{{.OS}}_{{.Arch}}/{{.Dir}}" -osarch=" linux/amd64 linux/arm" -ldflags=" -X github.com/mxschmitt/golang-url-shortener/util.ldFlagNodeJS=` node --version` -X github.com/mxschmitt/golang-url-shortener/util.ldFlagCommit=` git rev-parse HEAD` -X github.com/mxschmitt/golang-url-shortener/util.ldFlagYarn=` yarn --version` -X github.com/mxschmitt/golang-url-shortener/util.ldFlagCompilationTime=` TZ=UTC date +%Y-%m-%dT%H:%M:%S+0000` "
34
- docker build -t mxschmitt/golang_url_shortener:arm -f Dockerfile.arm .
35
- docker build -t mxschmitt/golang_url_shortener -f Dockerfile.amd64 .
33
+ CGO_ENABLED=0 gox -output=" docker_releases/{{.Dir}}_{{.OS}}_{{.Arch}}/{{.Dir}}" -osarch=" linux/amd64 linux/arm" -ldflags=" -X github.com/mxschmitt/golang-url-shortener/internal/ util.ldFlagNodeJS=` node --version` -X github.com/mxschmitt/golang-url-shortener/internal/ util.ldFlagCommit=` git rev-parse HEAD` -X github.com/mxschmitt/golang-url-shortener/internal/ util.ldFlagYarn=` yarn --version` -X github.com/mxschmitt/golang-url-shortener/internal/ util.ldFlagCompilationTime=` TZ=UTC date +%Y-%m-%dT%H:%M:%S+0000` " ./cmd/golang-url-shortener
34
+ docker build -t mxschmitt/golang_url_shortener:arm -f build/ Dockerfile.arm .
35
+ docker build -t mxschmitt/golang_url_shortener -f build/ Dockerfile.amd64 .
0 commit comments