From ae2482d910ac564a317ee1248add25a38d2c7777 Mon Sep 17 00:00:00 2001 From: NGPixel Date: Sun, 23 Jul 2017 21:50:50 -0400 Subject: [PATCH] fix: updated wercker definition --- .build/semver_next.sh | 52 +++++++++++++++++++++++++++++++++++++++++++ server/app/data.yml | 3 +++ wercker.yml | 25 ++++++++++++++++++++- 3 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 .build/semver_next.sh diff --git a/.build/semver_next.sh b/.build/semver_next.sh new file mode 100644 index 00000000..1c39da9d --- /dev/null +++ b/.build/semver_next.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +# Increment a version string using Semantic Versioning (SemVer) terminology. + +# Parse command line options. + +while getopts ":Mmp" Option +do + case $Option in + M ) major=true;; + m ) minor=true;; + p ) patch=true;; + esac +done + +shift $(($OPTIND - 1)) + +version=$1 + +# Build array from version string. + +a=( ${version//./ } ) + +# If version string is missing or has the wrong number of members, show usage message. + +if [ ${#a[@]} -ne 3 ] +then + echo "usage: $(basename $0) [-Mmp] major.minor.patch" + exit 1 +fi + +# Increment version numbers as requested. + +if [ ! -z $major ] +then + ((a[0]++)) + a[1]=0 + a[2]=0 +fi + +if [ ! -z $minor ] +then + ((a[1]++)) + a[2]=0 +fi + +if [ ! -z $patch ] +then + ((a[2]++)) +fi + +echo "${a[0]}.${a[1]}.${a[2]}" diff --git a/server/app/data.yml b/server/app/data.yml index 4cbf33e2..da16577b 100644 --- a/server/app/data.yml +++ b/server/app/data.yml @@ -91,6 +91,9 @@ langs: - id: zh name: Chinese - 中文 + - + id: nl + name: Dutch - Nederlands - id: fr name: French - Français diff --git a/wercker.yml b/wercker.yml index 56351708..576a8798 100644 --- a/wercker.yml +++ b/wercker.yml @@ -15,7 +15,8 @@ build: name: build code: yarn run build - npm-test -deploy: + +deploy-github: steps: - script: name: package @@ -23,3 +24,25 @@ deploy: tar -czf wiki-js.tar.gz * -X .build/.deployexclude yarn install --production --ignore-scripts --prefer-offline tar -czf node_modules.tar.gz node_modules + SEMVER_LAST=`npm show wiki.js version` + SEMVER_NEXT=`./.build/semver_next.sh -p $SEMVER_LAST` + - github-create-release: + token: $GITHUB_TOKEN + tag: "v${SEMVER_NEXT}" + prerelease: true + - github-upload-asset: + token: $GITHUB_TOKEN + file: wiki-js.tar.gz + - github-upload-asset: + token: $GITHUB_TOKEN + file: node_modules.tar.gz +deploy-docker: + steps: + - internal/docker-push: + username: $DOCKER_HUB_USERNAME + password: $DOCKER_HUB_PASSWORD + tag: latest + ports: "3000" + entrypoint: node server + repository: requarks/wiki + registry: https://registry.hub.docker.com