diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000000..145c27683e --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,40 @@ +image: +- Visual Studio 2017 +- Ubuntu1804 + +branches: + except: + - l10n_master + - gh-pages + +environment: + APPVEYOR_YML_DISABLE_PS_LINUX: true + +services: +- docker + +stack: node 10 + +init: +- ps: Install-Product node $env:nodejs_version + +install: +- sh: echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin +- ps: choco install cloc --no-progress +- ps: cloc --include-lang TypeScript,JavaScript,HTML,Sass,CSS --vcs git +- ps: $env:package_version = (Get-Content -Raw -Path package.json | ConvertFrom-Json).version + +before_build: +- cmd: node --version +- cmd: npm --version +- cmd: set "GIT_PATH=C:\Program Files\Git\mingw64\libexec\git-core" +- cmd: set "PATH=%GIT_PATH%;%PATH%" + +build_script: +- sh: chmod +x ./build-ci.sh +- sh: ./build-ci.sh +- cmd: npm install +- cmd: npm run build:prod + +after_build: +- sh: docker logout diff --git a/build-ci.sh b/build-ci.sh new file mode 100644 index 0000000000..9c6f6ee872 --- /dev/null +++ b/build-ci.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash +set -e + +echo "Repo tag name: ${APPVEYOR_REPO_TAG_NAME}" +echo "Rebuild: ${APPVEYOR_RE_BUILD}" + +PROD_DEPLOY=false +TAG_NAME="" +if [ "${APPVEYOR_REPO_TAG_NAME}" != "" -a "${APPVEYOR_RE_BUILD}" == "true" ] +then + PROD_DEPLOY=true + TAG_NAME=${APPVEYOR_REPO_TAG_NAME#"v"} +fi + +npm install +npm run build:prod + +chmod +x ./build.sh +./build.sh +./build.sh tag dev + +if [ "${PROD_DEPLOY}" == "true" ] +then + ./build.sh tag beta + ./build.sh tag $TAG_NAME +fi + +docker images +./build.sh push dev + +if [ "${PROD_DEPLOY}" == "true" ] +then + ./build.sh push beta + ./build.sh push latest + ./build.sh push $TAG_NAME +fi