From f73d74dd73585e164368acc484f27085507d3950 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 13 Mar 2019 10:38:49 -0400 Subject: [PATCH] move to ps appveyor --- appveyor.yml | 51 ++++++++++++++++++++++++++++++++++++++++++--------- build-ci.sh | 41 ----------------------------------------- 2 files changed, 42 insertions(+), 50 deletions(-) delete mode 100644 build-ci.sh diff --git a/appveyor.yml b/appveyor.yml index 909fc284e5..8d4152755a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -7,31 +7,64 @@ branches: - l10n_master - gh-pages -environment: - APPVEYOR_YML_DISABLE_PS_LINUX: true - services: - docker stack: node 10 init: -- ps: Install-Product node 10 +- ps: | + if($isWindows) { + Install-Product node 10 + } install: -- 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 +- ps: | + $env:PACKAGE_VERSION = (Get-Content -Raw -Path .\package.json | ConvertFrom-Json).version + $env:PROD_DEPLOY = "false" + $env:TAG_NAME = "" + if($env:APPVEYOR_REPO_TAG -eq "true" -and $env:APPVEYOR_RE_BUILD -eq "True") { + $env:PROD_DEPLOY = "true" + $env:TAG_NAME = $env:APPVEYOR_REPO_TAG_NAME.TrimStart("v") + echo "This is a production deployment for ${env:TAG_NAME}." + } + if($isWindows) { + choco install cloc --no-progress + cloc --include-lang TypeScript,JavaScript,HTML,Sass,CSS --vcs git + } before_build: - node --version - npm --version +- sh: | + if [ "${DOCKER_USERNAME}" != "" -a "${DOCKER_PASSWORD}" != "" ] + then + echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin + fi - 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 +- sh: chmod +x ./build.sh +- ps: | + if($isLinux) { + ./build.sh + ./build.sh tag dev + + if($env:PROD_DEPLOY -eq "true") { + ./build.sh tag beta + ./build.sh tag $env:TAG_NAME + } + + docker images + ./build.sh push dev + + if($env:PROD_DEPLOY -eq "true") { + ./build.sh push beta + ./build.sh push latest + ./build.sh push $env:TAG_NAME + } + } - cmd: npm install - cmd: npm run build:prod diff --git a/build-ci.sh b/build-ci.sh deleted file mode 100644 index 3195ef32e0..0000000000 --- a/build-ci.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/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 - -echo "Prod deploy: ${PROD_DEPLOY}" -echo "Tag name: ${TAG_NAME}" - -if [ "${DOCKER_USERNAME}" != "" -a "${DOCKER_PASSWORD}" != "" ] -then - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin -fi - -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