Makefile now builds full release
the build was successful Details

This commit is contained in:
kolaente 2017-11-28 14:42:11 +01:00 committed by kolaente
parent a658797b6d
commit c87ce78598
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
4 changed files with 51 additions and 13 deletions

View File

@ -34,13 +34,13 @@ pipeline:
when:
event: [ push, tag, pull_request ]
# static:
# image: karalabe/xgo-latest:latest
# pull: true
# environment:
# TAGS: bindata sqlite
# GOPATH: /srv/app
# commands:
# - make release
# when:
# event: [ push, tag ]
static:
image: karalabe/xgo-latest:latest
pull: true
environment:
TAGS: bindata sqlite
GOPATH: /srv/app
commands:
- make release
when:
event: [ push, tag ]

5
.gitignore vendored
View File

@ -1,7 +1,10 @@
.idea/*
Library
dist/*
dist/
frontend/node_modules/
frontend/dist/
frontend/npm-debug.log*
frontend/yarn-debug.log*
frontend/yarn-error.log*
frontend/yarn-error.log*
config.ini

View File

@ -87,12 +87,20 @@ $(EXECUTABLE): $(SOURCES)
go build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -o $@
.PHONY: release
release: release-dirs release-windows release-linux release-darwin release-copy release-check
release: release-dirs release-windows release-linux release-darwin release-frontend release-copy release-check release-os-package
.PHONY: release-dirs
release-dirs:
mkdir -p $(DIST)/binaries $(DIST)/release
.PHONY: release-frontend
release-frontend:
mv frontend/siteconfig.json frontend/siteconfig.json.old; \
echo '{"API_URL": "/api/v1/"}' > frontend/siteconfig.json; \
npm --prefix frontend run build; \
rm frontend/dist/siteconfig.json; \
mv frontend/siteconfig.json.old frontend/siteconfig.json;
.PHONY: release-windows
release-windows:
@hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
@ -126,7 +134,16 @@ endif
.PHONY: release-copy
release-copy:
$(foreach file,$(wildcard $(DIST)/binaries/$(EXECUTABLE)-*),cp $(file) $(DIST)/release/$(notdir $(file));)
mkdir $(DIST)/release/frontend
cp frontend/dist $(DIST)/release/frontend/ -R
cp config.ini $(DIST)/release/
.PHONY: release-check
release-check:
cd $(DIST)/release; $(foreach file,$(wildcard $(DIST)/release/$(EXECUTABLE)-*),sha256sum $(notdir $(file)) > $(notdir $(file)).sha256;)
cd $(DIST)/release; $(foreach file,$(wildcard $(DIST)/release/$(EXECUTABLE)-*),sha256sum $(notdir $(file)) > $(notdir $(file)).sha256;)
.PHONY: release-os-package
release-os-package:
$(foreach file,$(wildcard $(DIST)/release/$(EXECUTABLE)-*),mkdir $(file)-full;mv $(file) $(file)-full/; mv $(file).sha256 $(file)-full/; cp config.ini $(file)-full/; cp $(DIST)/release/frontend $(file)-full/ -R; )
rm $(DIST)/release/frontend $(DIST)/release/config.ini -rf

18
config.ini.sample Normal file
View File

@ -0,0 +1,18 @@
[General]
JWTSecret = blablaGEHEMIN§)!§
; The interface on which to run the webserver
Interface = :8080
[Database]
User = root
Password = supersecret
Host = 127.0.0.1
Database = library
ShowQueries = false
; First user to be created, on every startup the program checks if he exists, if not it creates it
[User]
Name = nope
Username = user
Password = 1234
Email = nope@none.com