Browse Source

moved build system to wercker

pull/247/head
Kilian Ciuffolo 10 years ago
parent
commit
e778900f4f
  1. 6
      .dockerignore
  2. 8
      .gitignore
  3. 29
      Dockerfile
  4. 4
      README.md
  5. 28
      _scripts/build.sh
  6. 9
      _scripts/get-baseurl.sh
  7. 0
      _scripts/init.sh
  8. 0
      _scripts/serve.sh
  9. 29
      wercker.yml

6
.dockerignore

@ -0,0 +1,6 @@
.bundle
.jekyll-metadata
_site
_config-prod.yml
_config-local.yml
vendor

8
.gitignore

@ -1,13 +1,9 @@
.bundle
.jekyll-metadata
_data/api/*
_data/api
_data/nav_api.*
_includes/menu.html
_includes/menu_demo.html
_includes/favicons.html
_includes/footer.html
_site
_config-prod.yml
_config-local.yml
api/*
api
vendor

29
Dockerfile

@ -0,0 +1,29 @@
# boilerplate
FROM kilianciuffolo/node:4.2.2
MAINTAINER kilian@lukibear.com
ENV DEBIAN_FRONTEND noninteractive
# pkgs
RUN \
apt-get update && \
apt-get install --no-install-recommends -y -q \
ruby \
ruby-dev \
rubygems \
patch \
ssh \
unzip \
zlib1g-dev \
&& \
apt-get clean autoclean && \
apt-get autoremove -y && \
rm -rf /var/lib/{apt,dpkg,cache,log}/
RUN gem install bundle
WORKDIR /tinymce-docs
COPY Gemfile ./
COPY Gemfile.lock ./
RUN bundle install --deployment

4
README.md

@ -5,11 +5,11 @@
$ git clone git@github.com:tinymce/tinymce-docs.git
$ cd tinymce-docs
$ sudo gem install bundle
$ ./init.sh
$ ./_scripts/init.sh
### Run development version
$ ./serve.sh
$ ./_scripts/serve.sh
Navigate to http://127.0.0.1:4000/

28
_scripts/build.sh

@ -0,0 +1,28 @@
#!/bin/bash
set -e
BRANCH="$WERCKER_GIT_BRANCH"
API_VERSION="$(cat .api-version)"
TARBALL_URL="https://codeload.github.com/tinymce/tinymce/tar.gz/$API_VERSION"
TMP_DIR="/tmp/tinymce-$API_VERSION"
BASEURL="$(_scripts/get-baseurl.sh)"
echo ""
echo " > exporting data files for tinymce: $API_VERSION"
mkdir "$TMP_DIR"
curl -s $TARBALL_URL | tar xzf - -C "$TMP_DIR" --strip-components 1
moxiedoc "$TMP_DIR/js/tinymce/classes" -t tinymcenext -o "$TMP_DIR/tinymce-api-reference.zip"
unzip -q -o "$TMP_DIR/tinymce-api-reference.zip"
echo " > installing gems"
bundle install --deployment --quiet --jobs=10
echo " > setting baseurl to: $BASEURL"
echo "baseurl: \"$BASEURL\"" > _config-prod.yml
echo -e " > builidng documentation\n"
bundle exec jekyll build --config _config.yml,_config-prod.yml
echo ""

9
_scripts/get-baseurl.sh

@ -0,0 +1,9 @@
#!/bin/bash
set -e
if [[ "master" == $WERCKER_GIT_BRANCH ]]; then
echo "/docs"
else
echo "/docs/pr/$WERCKER_GIT_BRANCH"
fi

0
init.sh → _scripts/init.sh

0
serve.sh → _scripts/serve.sh

29
wercker.yml

@ -0,0 +1,29 @@
box: kilianciuffolo/tinymce-docs:latest
no-response-timeout: 30
build:
steps:
- add-to-known_hosts:
hostname: github.com
- add-ssh-key:
keyname: SSH_KEY
- script:
name: install moxiedoc
code: npm i -g ephox/moxiedoc#feature/tinymcenext
- script:
name: build
code: _scripts/build.sh
deploy:
steps:
- script:
name: set $S3_BUCKET env
code: export S3_BUCKET="$S3_BUCKET/$WERCKER_GIT_BRANCH/"
- s3sync:
key-id: $S3_KEY
key-secret: $S3_SECRET
bucket-url: $S3_BUCKET
source-dir: $S3_SOURCE
after-steps:
- slack-notifier:
url: $SLACK_WEBHOOK_URL
Loading…
Cancel
Save