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."