Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement new build process, enabling continuous integration #8

Merged
merged 19 commits into from
Jun 10, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
ehthumbs.db
Thumbs.db
DalaFloda*
dist/*
hgnm-2014.zip

# Created by https://www.gitignore.io/api/node
### Node ###
Expand Down
19 changes: 19 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
language: node_js
node_js:
- '4'
- '4.2'
- '5.1'
install:
- npm install
script:
- npm run build
deploy:
provider: releases
api_key:
secure: CJa6+7F3KMRxjwdAx/4zgLU55l1uUE3CPUN0ezitehbcJX+yQoKfM0LevIgZw2UVjyGD3xXttTe3YDG0ypG9jqqxhJSa3bA7dV9OnP4+rY/vPvjZLRmBTqSjb5S/d4oB78l4hxgxw7+RuwEr0DXhaFJ4BzJ00zplQ9TAmlPOZPs=
file: hgnm-2014.zip
skip_cleanup: true
on:
repo: HGNM/hgnm-2014
tags: true
node: '4.2'
17 changes: 17 additions & 0 deletions install-dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

# Check all required CLIs are available
dependencies=( wget unzip )
for dependency in "${dependencies[@]}"; do
command -v $dependency >/dev/null 2>&1 || { echo >&2 "‘$dependency’ command is required but it’s not installed. Aborting."; exit 1; }
done

# Get required proprietary fonts for theme
wget -O df.zip "http://chrisswithinbank.net/wp-content/uploads/2016/06/1407-HRGQJV.zip"
if [[ -f "df.zip" ]]; then
unzip df.zip -d font/
rm df.zip
else
echo "Can’t find file: df.zip. Fatal error…"
exit 1
fi
11 changes: 10 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
"description": "Repository for WordPress theme development for hgnm.org",
"scripts": {
"start": "npm run css:build && npm run css:watch",
"build": "npm run css:build && npm run copy && npm run zip",
"css:build": "node-sass --include-path scss scss/style.scss style.css",
"css:watch": "node-sass --include-path scss scss/style.scss style.css -w"
"css:watch": "node-sass --include-path scss scss/style.scss style.css -w",
"copy": "cpy '**/*' '!scss/*' '!dist/*' '!.gitignore' '!.travis.yml' '!install-dependencies.sh' '!node_modules/**/*' '!hgnm-2014.zip' 'dist/' --parents --nodir",
"zip": "bestzip hgnm-2014.zip dist/",
"postinstall": "./install-dependencies.sh"
},
"repository": "HGNM/hgnm-2014",
"keywords": [
Expand All @@ -19,6 +23,11 @@
},
"homepage": "https://github.com/HGNM/hgnm-2014#readme",
"devDependencies": {
"bestzip": "^1.1.3",
"cpy-cli": "git+https://github.com/chimon2000/cpy-cli.git",
"node-sass": "^3.7.0"
},
"engines": {
"node": ">=4.0.0"
}
}