From 375f733def6df449f9d2b01b8b7fbd5d23d9dd43 Mon Sep 17 00:00:00 2001 From: Eric Pfeiffer Date: Fri, 14 Apr 2017 12:15:10 -0500 Subject: [PATCH 1/4] Use Travis CI for building docker images and docs --- .travis.yml | 27 +++++++++++++++------------ scripts/build.sh | 24 ++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 12 deletions(-) create mode 100644 scripts/build.sh diff --git a/.travis.yml b/.travis.yml index 972a5c8..c8f190f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,22 +1,25 @@ -language: go -install: - - export HUGO_VERSION=0.20 - - export HUGO_PACKAGE=hugo_${HUGO_VERSION}_Linux-64bit - - curl -L https://github.com/spf13/hugo/releases/download/v$HUGO_VERSION/$HUGO_PACKAGE.tar.gz | tar xz - - mkdir $HOME/bin - - mv ./hugo_${HUGO_VERSION}_linux_amd64/hugo_${HUGO_VERSION}_linux_amd64 $HOME/bin/hugo -script: - - rm -rf docs - - cd DOCUMENTATION/_settings - - hugo +language: bash +sudo: required +services: + - docker + +env: + matrix: + - PHP_VERSION=56 + - PHP_VERSION=70 + - PHP_VERSION=71 + - HUGO_VERSION=0.20 + +script: ./scripts/build.sh deploy: provider: pages skip_cleanup: true - local_dir: public + local_dir: ../../docs github_token: $GITHUB_TOKEN on: branch: master + condition: "-n ${HUGO_VERSION}" notifications: email: false diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100644 index 0000000..f245837 --- /dev/null +++ b/scripts/build.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +if [ -n ${PHP_VERSION} ]; then + cp env-example .env + docker-compose build + docker images +fi + +if [ -n ${HUGO_VERSION} ]; then + HUGO_PACKAGE=hugo_${HUGO_VERSION}_Linux-64bit + HUGO_BIN=hugo_${HUGO_VERSION}_linux_amd64 + + # Download hugo binary + curl -L https://github.com/spf13/hugo/releases/download/v$HUGO_VERSION/$HUGO_PACKAGE.tar.gz | tar xz + mkdir $HOME/bin + mv ./${HUGO_BIN}/${HUGO_BIN} $HOME/bin/hugo + + # Remove existing docs + rm -r ./docs + + # Build docs + cd DOCUMENTATION/_settings + hugo +fi From 94a383bea9fa45e90e62c992c73608fd352209a0 Mon Sep 17 00:00:00 2001 From: Eric Pfeiffer Date: Fri, 14 Apr 2017 12:19:56 -0500 Subject: [PATCH 2/4] Forgot to make script executable. Oops --- scripts/build.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/build.sh diff --git a/scripts/build.sh b/scripts/build.sh old mode 100644 new mode 100755 From ae01a9fd49fb4095d38b50c2125e98ee0c2dde19 Mon Sep 17 00:00:00 2001 From: Eric Pfeiffer Date: Fri, 14 Apr 2017 12:31:09 -0500 Subject: [PATCH 3/4] Fix the if statements for checking if env is set. --- scripts/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index f245837..ddfa275 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,12 +1,12 @@ #!/usr/bin/env bash -if [ -n ${PHP_VERSION} ]; then +if [ -n "${PHP_VERSION}" ]; then cp env-example .env docker-compose build docker images fi -if [ -n ${HUGO_VERSION} ]; then +if [ -n "${HUGO_VERSION}" ]; then HUGO_PACKAGE=hugo_${HUGO_VERSION}_Linux-64bit HUGO_BIN=hugo_${HUGO_VERSION}_linux_amd64 From 9f4aaa9bc7bcd0ae08774c5043c8d752b810a56f Mon Sep 17 00:00:00 2001 From: Eric Pfeiffer Date: Fri, 14 Apr 2017 12:56:18 -0500 Subject: [PATCH 4/4] fix deploy local_dir. --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index c8f190f..ae5ce54 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,11 +15,11 @@ script: ./scripts/build.sh deploy: provider: pages skip_cleanup: true - local_dir: ../../docs + local_dir: docs github_token: $GITHUB_TOKEN on: branch: master - condition: "-n ${HUGO_VERSION}" + condition: -n "${HUGO_VERSION}" notifications: email: false