Browse Source

fix project compilation on recent GO versions

master
Nicolas Massé 5 years ago
parent
commit
1795b5dec4
  1. 4
      Makefile
  2. 13
      README.md

4
Makefile

@ -9,7 +9,7 @@ buildNodeFrontend:
cd web && rm build/static/**/*.map
embedFrontend:
cd cmd/golang-url-shortener && packr2 --legacy
cd cmd/golang-url-shortener && packr2
getCMDDependencies:
go get -v github.com/mattn/goveralls
@ -24,7 +24,7 @@ getGoDependencies:
buildProject:
rm -rf releases
mkdir releases
gox -output="releases/{{.Dir}}_{{.OS}}_{{.Arch}}/{{.Dir}}" -osarch="linux/amd64 linux/arm windows/amd64 windows/386 darwin/amd64" -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
CGO_ENABLED=0 gox -output="releases/{{.Dir}}_{{.OS}}_{{.Arch}}/{{.Dir}}" -osarch="linux/amd64 linux/arm windows/amd64 windows/386 darwin/amd64" -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
find releases -maxdepth 1 -mindepth 1 -type d -exec cp config/example.yaml {}/config.yaml \;
find releases -maxdepth 1 -mindepth 1 -type d -exec tar -cvjf {}.tar.bz2 {} \;

13
README.md

@ -48,3 +48,16 @@ Only because I just want to extend my current self hosted URL shorter (which was
- Travis CI
- Key / Value databases
- Dockerfile and Docker Image Creation
## Compilation from Source
```sh
test -n "$GOPATH" || echo "GOPATH is not set"
export GO111MODULE=auto
go get github.com/mxschmitt/golang-url-shortener
cd $GOPATH/src/github.com/mxschmitt/golang-url-shortener
git remote add mine git@github.com:nmasse-itix/golang-url-shortener.git
git pull mine master
make
```

Loading…
Cancel
Save