Skip to content
Snippets Groups Projects
Commit 871b6960 authored by Thomas Wood's avatar Thomas Wood
Browse files

Latest commit is now published to https://jscert.github.io/jsexplain/branch/master

parent b8dc3441
No related branches found
No related tags found
No related merge requests found
node_modules/* node_modules/*
!node_modules/esprima !node_modules/esprima
dist
language: c
sudo: required
install:
- wget https://raw.githubusercontent.com/ocaml/ocaml-ci-scripts/master/.travis-ocaml.sh
- bash -ex .travis-ocaml.sh
- make init
- eval `opam config env`
script:
- make
env:
global:
- OCAML_VERSION=4.03
- OPAMYES=true
os:
- linux
- osx
deploy:
skip_cleanup: true
provider: script
script: make publish-github
on:
condition: $TRAVIS_OS_NAME = linux
all_branches: true
PUB_FILES=driver.html libraries jquery-ui-1.11.4.custom jquery_scroll \ all: generator mljsref jsjsref
jsref/displayed_sources.js tools.js node_modules/esprima/esprima.js \
esprima-to-ast.js jsref/lineof.js navig-driver.js \
jsref/assembly.js
all: generator jsjsref mljsref
# Init stages
init: init:
opam switch 4.03.0 opam switch 4.03.0
eval `opam config env` eval `opam config env`
...@@ -12,9 +8,7 @@ init: ...@@ -12,9 +8,7 @@ init:
opam pin -yn add JS_Parser "https://github.com/resource-reasoning/JS_Parser.git#v0.1.0" opam pin -yn add JS_Parser "https://github.com/resource-reasoning/JS_Parser.git#v0.1.0"
opam install -y jsjsref --deps-only opam install -y jsjsref --deps-only
publish: generator $(PUB_FILES) # Build Stages
rsync -azR --no-p --rsh=ssh -O $^ gf:/home/groups/ajacs/htdocs/jsexplain/
generator: generator:
$(MAKE) -C generator $(MAKE) -C generator
...@@ -27,6 +21,7 @@ jsjsref: generator ...@@ -27,6 +21,7 @@ jsjsref: generator
mljsref: generator-stdlib mljsref: generator-stdlib
$(MAKE) -C jsref mljsref $(MAKE) -C jsref mljsref
# Test Stages
test_init: test_init:
git submodule update --init test/test262 git submodule update --init test/test262
npm install npm install
...@@ -34,8 +29,27 @@ test_init: ...@@ -34,8 +29,27 @@ test_init:
test: jsjsref test: jsjsref
node_modules/.bin/mocha node_modules/.bin/mocha
# Publication Stages
PUB_FILES=driver.html libraries jquery-ui-1.11.4.custom jquery_scroll \
jsref/displayed_sources.js tools.js node_modules/esprima/esprima.js \
esprima-to-ast.js jsref/lineof.js navig-driver.js \
jsref/assembly.js
dist: jsjsref $(PUB_FILES)
mkdir -p $@
cp -r $(PUB_FILES) $@
publish: dist
# /./ syntax tells rsync where to start relative paths from
rsync -azR --no-p --rsh=ssh -O $^/./ gf:/home/groups/ajacs/htdocs/jsexplain/
publish-github: dist
tools/upload-github-pages.sh dist
# Clean stages
clean: clean:
$(MAKE) -C generator clean $(MAKE) -C generator clean
$(MAKE) -C jsref clean $(MAKE) -C jsref clean
rm -Rf dist || true
.PHONY: publish jsjsref mljsref generator generator-stdlib test_init test clean .PHONY: jsjsref mljsref generator generator-stdlib test_init test publish publish-github clean
#!/bin/sh
# Uploads given directory (default: dist) to gh-pages branch under directory <branch name>
# usage: upload-github-pages.sh [directory]
set -e
set +x
if [ -z "$TRAVIS" -o "$TRAVIS_PULL_REQUEST" != "false" ]; then
echo "This is not a push Travis-ci build, doing nothing..."
exit 0
else
echo "Deploying to Github pages..."
fi
DOCDIR=.gh-pages
DEPLOY_SRC=${1:-dist}
DEPLOY_TARGET=${TRAVIS_TAG:+tag/$TRAVIS_TAG}
DEPLOY_TARGET=${DEPLOY_TARGET:-branch/$TRAVIS_BRANCH}
REDACT_PATTERN=""
# Error out if $GH_TOKEN and $DH_DEPLOY_KEY are empty or unset
if [ -n "$GH_TOKEN" ]; then
REPO="https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git"
REDACT_PATTERN="s/$GH_TOKEN/!REDACTED!/g"
elif [ -n "$GH_DEPLOY_KEY" ]; then
# $GH_DEPLOY_KEY should be inserted into project settings quoted and with newlines escaped as \n
eval `ssh-agent`
printf "%b" "$GH_DEPLOY_KEY" | ssh-add /dev/stdin
REPO="git@github.com:${TRAVIS_REPO_SLUG}.git"
else
echo "GH_TOKEN or GH_DEPLOY_KEY variable must be set"
exit 1
fi
git clone $REPO $DOCDIR 2>&1 | sed -e "$REDACT_PATTERN"
git -C $DOCDIR checkout gh-pages ||
(git -C $DOCDIR checkout --orphan gh-pages &&
find $DOCDIR \! \( -path "*/.git/*" -o -path "*/.git" -o -path "$DOCDIR" \) -delete)
rm -Rf $DOCDIR/$DEPLOY_TARGET || true
mkdir -p $DOCDIR/$DEPLOY_TARGET
cp -rT $DEPLOY_SRC $DOCDIR/$DEPLOY_TARGET
git -C $DOCDIR add -A .
git -C $DOCDIR config user.email "travis@travis-ci.org"
git -C $DOCDIR config user.name "Travis"
git -C $DOCDIR commit --allow-empty -m "Travis build $TRAVIS_BUILD_NUMBER for $TRAVIS_BRANCH $TRAVIS_COMMIT pushed docs to gh-pages"
git -C $DOCDIR push origin gh-pages 2>&1 | sed -e "$REDACT_PATTERN"
if [ -n "$GH_DEPLOY_KEY" ]; then eval `ssh-agent -k`; fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment