Compare commits

..

3 Commits

Author SHA1 Message Date
13866843bb Package archive with gitlab CI 2017-04-03 21:23:24 +02:00
1e31b671da Fix CI script 2017-04-03 21:07:56 +02:00
41cd8d2ba2 Build package 2017-04-03 21:06:29 +02:00
3 changed files with 42 additions and 13 deletions

4
.gitignore vendored
View File

@ -3,6 +3,6 @@
build
*.o
*.min.js
/bouquins
bouquins
externals
ksql.h
bouquins*.tar.gz

View File

@ -4,14 +4,10 @@ stages:
build:
stage: build
script:
- make
- make package
artifacts:
paths:
- '*.o'
- bouquins
- '*.min.js'
- '*.html'
- '*.min.js'
- build/*
expire_in: 1 hour
tags:
- kcgi

View File

@ -60,11 +60,19 @@ sinclude GNUmakefile.local
DATABASE = metadata.db
OBJS = db.o db_author.o db_book.o db_series.o json.o main.o
EXT = externals
BOOTSTRAP_VERSION = 3.3.7
BOOTSTRAP_DIST = bootstrap-$(BOOTSTRAP_VERSION)-dist
BOOTSTRAP_URL = https://github.com/twbs/bootstrap/releases/download/v$(BOOTSTRAP_VERSION)/$(BOOTSTRAP_DIST).zip
BOOTSTRAP_TMP_ZIP = $(EXT)/bootstrap.zip
VUE_URL = https://vuejs.org/js/vue.min.js
VUEJS = $(EXT)/vue.min.js
HTMLS = index.html book.html author.html series.html search.html
JSMINS = index.min.js book.min.js author.min.js series.min.js search.min.js
EXTJS = externals/vue.min.js
CSS = externals/bootstrap.min.css
FONTS = externals/fonts/*
JSMINS = index.min.js book.min.js author.min.js series.min.js search.min.js $(VUEJS)
CSS = $(EXT)/$(BOOTSTRAP_DIST)/css/bootstrap.min.css
FONTS = $(EXT)/$(BOOTSTRAP_DIST)/fonts/*
CFLAGS += -g -W -Wall -O2 $(SECURE)
CFLAGS += -DLOGFILE=\"$(LOGFILE)\"
@ -80,10 +88,35 @@ all: $(TARGET) $(HTMLS) $(JSMINS)
api: swagger.json
$(BOOTSTRAP_TMP_ZIP):
fetch -o $(BOOTSTRAP_TMP_ZIP) $(BOOTSTRAP_URL)
$(EXT)/$(BOOTSTRAP_DIST): $(BOOTSTRAP_TMP_ZIP)
unzip -d $(EXT) $(BOOTSTRAP_TMP_ZIP)
$(VUEJS):
fetch -o $(VUEJS) $(VUE_URL)
$(EXT): $(EXT)/$(BOOTSTRAP_DIST) $(VUEJS)
packwww: $(EXT) $(HTMLS) $(JSMINS)
mkdir -p build build/css build/fonts build/js
cp $(HTMLS) build
cp $(JSMINS) $(VUEJS) build/js
cp $(CSS) build/css
cp $(FONTS) build/fonts
packcgi: $(TARGET)
mkdir -p build/cgi-bin
cp $(TARGET) build/cgi-bin
cp $(OBJS) build/cgi-bin
package: packcgi packwww
installwww: all
mkdir -p $(HTDOCS) $(HTDOCS)/css $(HTDOCS)/fonts $(HTDOCS)/js
install -m 0444 $(HTMLS) $(HTDOCS)
install -m 0444 $(JSMINS) $(EXTJS) $(HTDOCS)/js
install -m 0444 $(JSMINS) $(HTDOCS)/js
install -m 0444 $(CSS) $(HTDOCS)/css
install -m 0444 $(FONTS) $(HTDOCS)/fonts