From 63cbc1da3c3e6dd8caaad1bd17e274836ea06b88 Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Sun, 26 Jun 2016 23:02:18 +0200 Subject: [PATCH] define cleanup jobs --- .gitlab-ci.yml | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 76f896d..b3691ad 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,10 +3,12 @@ variables: stages: - build + - cleanup_build - deploy - - clean_after_deploy + - cleanup -Npm, Bower, Grunt: +build_job: + stage: build script: - npm install - $NPMPATH/bower install @@ -14,7 +16,6 @@ Npm, Bower, Grunt: tags: except: - tags - stage: build artifacts: paths: - dist/ @@ -23,6 +24,14 @@ Npm, Bower, Grunt: - index.html - manifest.appcache +cleanup_build_job: + stage: cleanup_build + script: + - rm -r node_modules + - rm -r bower_components + - rm -r dist + when: on_failure + staging: stage: deploy script: deploy.sh @@ -41,12 +50,10 @@ production: variables: ENVIRON: production -clean: - stage: clean_after_deploy +cleanup_job: + stage: cleanup script: - rm -r node_modules - rm -r bower_components when: always - - \ No newline at end of file