Replace makefile with bash scripts
This commit is contained in:
parent
e17520cfaa
commit
f133277b08
10 changed files with 71 additions and 75 deletions
|
@ -1,3 +1,3 @@
|
||||||
https://github.com/heroku/heroku-buildpack-nodejs
|
https://github.com/heroku/heroku-buildpack-nodejs
|
||||||
https://github.com/RealOrangeOne/heroku-buildpack-hugo
|
https://github.com/RealOrangeOne/heroku-buildpack-hugo
|
||||||
https://github.com/RealOrangeOne/heroku-buildpack-make
|
https://github.com/weibeld/heroku-buildpack-run
|
||||||
|
|
|
@ -22,7 +22,7 @@ jobs:
|
||||||
- node_modules
|
- node_modules
|
||||||
- run:
|
- run:
|
||||||
name: Build site
|
name: Build site
|
||||||
command: make release
|
command: ./scripts/release.sh
|
||||||
- run:
|
- run:
|
||||||
name: Run Tests
|
name: Run Tests
|
||||||
command: make test
|
command: ./scripts/test.sh
|
||||||
|
|
63
Makefile
63
Makefile
|
@ -1,63 +0,0 @@
|
||||||
BASEDIR=$(PWD)
|
|
||||||
NODE_BIN=$(BASEDIR)/node_modules/.bin
|
|
||||||
|
|
||||||
STATIC_SRC=$(BASEDIR)/static/src
|
|
||||||
STATIC_BUILD=$(BASEDIR)/static/build
|
|
||||||
OUTPUT_DIR=$(BASEDIR)/public
|
|
||||||
|
|
||||||
|
|
||||||
release: build
|
|
||||||
$(NODE_BIN)/speedpack $(OUTPUT_DIR) -o $(OUTPUT_DIR)
|
|
||||||
|
|
||||||
|
|
||||||
build: install
|
|
||||||
rm -rf $(OUTPUT_DIR)
|
|
||||||
rm -rf $(STATIC_BUILD)
|
|
||||||
rm -rf $(BASEDIR)/resources
|
|
||||||
mkdir -p $(STATIC_BUILD)/js $(STATIC_BUILD)/css
|
|
||||||
hugo gen chromastyles --style=tango > $(STATIC_SRC)/scss/highlight.css
|
|
||||||
$(NODE_BIN)/browserify $(STATIC_SRC)/js/index.js -o $(STATIC_BUILD)/js/app.js
|
|
||||||
$(NODE_BIN)/node-sass $(STATIC_SRC)/scss/style.scss $(STATIC_BUILD)/css/style.css --source-map-embed
|
|
||||||
cp -r $(BASEDIR)/node_modules/lightgallery/dist/fonts $(STATIC_BUILD)
|
|
||||||
cp -r $(STATIC_SRC)/img $(STATIC_BUILD)/img
|
|
||||||
cp node_modules/mermaid/dist/mermaid.min.js $(STATIC_BUILD)/js/mermaid.min.js
|
|
||||||
@hugo -vDEF --stepAnalysis --gc
|
|
||||||
mkdir -p $(OUTPUT_DIR)/.well-known/
|
|
||||||
cp $(BASEDIR)/static/keybase.txt $(OUTPUT_DIR)/keybase.txt
|
|
||||||
cp $(BASEDIR)/static/security.txt $(OUTPUT_DIR)/.well-known/security.txt
|
|
||||||
|
|
||||||
server: build
|
|
||||||
hugo server --noHTTPCache --disableFastRender --gc
|
|
||||||
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -rf $(STATIC_BUILD)
|
|
||||||
rm -rf $(OUTPUT_DIR)
|
|
||||||
rm -rf $(BASEDIR)/node_modules
|
|
||||||
|
|
||||||
|
|
||||||
install: node_modules
|
|
||||||
@hugo version
|
|
||||||
|
|
||||||
node_modules:
|
|
||||||
npm install
|
|
||||||
|
|
||||||
|
|
||||||
test:
|
|
||||||
$(NODE_BIN)/sass-lint -vqc .sass-lint.yml
|
|
||||||
$(NODE_BIN)/eslint $(STATIC_SRC)/js
|
|
||||||
$(NODE_BIN)/yamllint data/*.yml
|
|
||||||
$(NODE_BIN)/yamllint config.yml
|
|
||||||
$(NODE_BIN)/mdspell --en-gb -ranx 'content/**/*.md'
|
|
||||||
$(NODE_BIN)/blcl -ero ./public/
|
|
||||||
|
|
||||||
deadlink:
|
|
||||||
$(NODE_BIN)/blcl -ro ./public/ \
|
|
||||||
--exclude "open.spotify.com"\
|
|
||||||
--exclude "p.scdn.co"\
|
|
||||||
--exclude "staticflickr.com"\
|
|
||||||
--exclude "twitter.com/intent"\
|
|
||||||
--exclude "facebook.com/sharer"\
|
|
||||||
--exclude "reddit.com/submit"
|
|
||||||
|
|
||||||
.PHONY: build clean install test
|
|
10
README.md
10
README.md
|
@ -2,12 +2,4 @@
|
||||||
|
|
||||||
[![Circle CI](https://circleci.com/gh/RealOrangeOne/theorangeone.net.svg?style=svg)](https://circleci.com/gh/RealOrangeOne/theorangeone.net)
|
[![Circle CI](https://circleci.com/gh/RealOrangeOne/theorangeone.net.svg?style=svg)](https://circleci.com/gh/RealOrangeOne/theorangeone.net)
|
||||||
|
|
||||||
## Installation
|
https://theorangeone.net
|
||||||
```bash
|
|
||||||
make
|
|
||||||
```
|
|
||||||
|
|
||||||
## Run Tests
|
|
||||||
```bash
|
|
||||||
make test
|
|
||||||
```
|
|
||||||
|
|
1
buildpack-run.sh
Symbolic link
1
buildpack-run.sh
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
./scripts/build.sh
|
23
scripts/build.sh
Executable file
23
scripts/build.sh
Executable file
|
@ -0,0 +1,23 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
source ./scripts/common.sh
|
||||||
|
|
||||||
|
rm -rf $OUTPUT_DIR
|
||||||
|
rm -rf $STATIC_BUILD
|
||||||
|
rm -rf $BASEDIR/resources
|
||||||
|
mkdir -p $STATIC_BUILD/js $STATIC_BUILD/css
|
||||||
|
hugo gen chromastyles --style=tango > $STATIC_SRC/scss/highlight.css
|
||||||
|
browserify $STATIC_SRC/js/index.js -o $STATIC_BUILD/js/app.js
|
||||||
|
node-sass $STATIC_SRC/scss/style.scss $STATIC_BUILD/css/style.css --source-map-embed
|
||||||
|
|
||||||
|
cp -r $BASEDIR/node_modules/lightgallery/dist/fonts $STATIC_BUILD
|
||||||
|
cp -r $STATIC_SRC/img $STATIC_BUILD/img
|
||||||
|
cp node_modules/mermaid/dist/mermaid.min.js $STATIC_BUILD/js/mermaid.min.js
|
||||||
|
|
||||||
|
hugo -vDEF --stepAnalysis --gc
|
||||||
|
mkdir -p $OUTPUT_DIR/.well-known/
|
||||||
|
|
||||||
|
cp $BASEDIR/static/keybase.txt $OUTPUT_DIR/keybase.txt
|
||||||
|
cp $BASEDIR/static/security.txt $OUTPUT_DIR/.well-known/security.txt
|
8
scripts/common.sh
Executable file
8
scripts/common.sh
Executable file
|
@ -0,0 +1,8 @@
|
||||||
|
BASEDIR=$PWD
|
||||||
|
NODE_BIN=$BASEDIR/node_modules/.bin
|
||||||
|
|
||||||
|
STATIC_SRC=$BASEDIR/static/src
|
||||||
|
STATIC_BUILD=$BASEDIR/static/build
|
||||||
|
OUTPUT_DIR=$BASEDIR/public
|
||||||
|
|
||||||
|
export PATH=$BASEDIR/node_modules/.bin/:$PATH
|
9
scripts/release.sh
Executable file
9
scripts/release.sh
Executable file
|
@ -0,0 +1,9 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
source ./scripts/common.sh
|
||||||
|
|
||||||
|
bash ./scripts/build.sh
|
||||||
|
|
||||||
|
speedpack $OUTPUT_DIR -o $OUTPUT_DIR
|
7
scripts/server.sh
Executable file
7
scripts/server.sh
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
bash ./scripts/build.sh
|
||||||
|
|
||||||
|
hugo server --noHTTPCache --disableFastRender --gc
|
19
scripts/test.sh
Executable file
19
scripts/test.sh
Executable file
|
@ -0,0 +1,19 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
source ./scripts/common.sh
|
||||||
|
|
||||||
|
sass-lint -vqc .sass-lint.yml
|
||||||
|
eslint $STATIC_SRC/js
|
||||||
|
yamllint data/*.yml
|
||||||
|
yamllint config.yml
|
||||||
|
mdspell --en-gb -ranx 'content/**/*.md'
|
||||||
|
|
||||||
|
blcl -ro ./public/ \
|
||||||
|
--exclude "open.spotify.com"\
|
||||||
|
--exclude "p.scdn.co"\
|
||||||
|
--exclude "staticflickr.com"\
|
||||||
|
--exclude "twitter.com/intent"\
|
||||||
|
--exclude "facebook.com/sharer"\
|
||||||
|
--exclude "reddit.com/submit" || true
|
Loading…
Reference in a new issue