From 0b3a38af3c35972c8cca32fdd704d6c9b39c9c62 Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Thu, 15 Sep 2016 21:32:14 +0200 Subject: [PATCH] adapted CI config and deploy script to the new angular/systemjs build environment --- .gitlab-ci.yml | 73 +++++++++++++++++++++++++------------------------- deploy.sh | 11 +++++++- 2 files changed, 47 insertions(+), 37 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 916c442..a3d953d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,42 +1,43 @@ -#variables: -# NPMPATH: "node_modules/.bin" - stages: -# - build -# - cleanup_build + - build + - cleanup_build - deploy -# - cleanup + - cleanup .run_deploy: &run_deploy script: - chmod +x ./deploy.sh - ./deploy.sh -#build_job: -# stage: build -# script: -# - npm install -# - $NPMPATH/bower install -# - $NPMPATH/grunt -# tags: -# - javascript -# except: -# - tags -# artifacts: -# paths: -# - dist/*.min.* -# - info/ -# - resources/ -# - index.html -# - manifest.appcache +build_job: + stage: build + script: + - npm install + tags: + - javascript + except: + - tags + artifacts: + paths: + - app/*.css + - app/*.html + - app/*.js + - app/*.js.map + - node_modules/core-js/client/shim.js + - node_modules/zone.js/dist/zone.js + - node_modules/reflect-metadata/Reflect.js + - node_modules/systemjs/dist/system.src.js + - dencode.css + - index.html + - package.json + - systemjs.config.js -#cleanup_build_job: -# stage: cleanup_build -# script: -# - rm -rf node_modules -# - rm -rf bower_components -# - rm -rf dist -# when: on_failure +cleanup_build_job: + stage: cleanup_build + script: + - rm -rf node_modules + - rm -rf typings + when: on_failure develop: stage: deploy @@ -70,9 +71,9 @@ production: ENVIRON: production TARGET: $WWW_DEPLOY_ROOT_PRODUCTION -#cleanup_job: -# stage: cleanup -# script: -# - rm -rf node_modules -# - rm -rf bower_components -# when: always +cleanup_job: + stage: cleanup + script: + - rm -rf node_modules + - rm -rf typings + when: always diff --git a/deploy.sh b/deploy.sh index ab6faf6..528f257 100644 --- a/deploy.sh +++ b/deploy.sh @@ -20,6 +20,15 @@ fi rm -rf "${destination}/*" rm -rf "${destination}/.??*" -cp -a dencode.css dencode.js index.html quoted-printable.js utf8.js "${destination}" + +cp -a dencode.css index.html package.json systemjs.config.js "${destination}" + +mkdir "${destination}/app" +cp -a app/*.css app/*.html app/*.js app/*.js.map "${destination}/app" + +mkdir -p "${destination}/node_modules/{core-js/client,zone.js/dist,reflect-metadata,systemjs/dist}" +cp -a node_modules/core-js/client/shim.js "${destination}/node_modules/zone.js/dist" +cp -a node_modules/reflect-metadata/Reflect.js "${destination}/node_modules/reflect-metadata" +cp -a node_modules/systemjs/dist/system.src.js "${destination}/node_modules/systemjs/dist" echo "Deployment successful."