From ba62fb463ebb05c5a93738bf5f235fd0554f5e3e Mon Sep 17 00:00:00 2001 From: Athanasios <ath.kouk.oid@gmail.com> Date: Wed, 3 Mar 2021 21:17:22 +0100 Subject: [PATCH] add CI configuration --- .gitlab-ci.yml | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..f7d0313 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,41 @@ +variables: + EXPORT_DIR: "/var/www/html/pages" + +stages: + - test + - deploy + - cleanup + +test-job: + stage: test + script: + - echo "Testing files exist..." + - test -f public/index.html + - test -f public/main.js + - test -f public/settings.js + - test -f public/assets/css/style.css + - test -f public/assets/css/moblie.css + - test -f public/assets/images/header.jpg + - test -f public/home/index.html + - echo "Test finished, all ok" + only: + - master + +deploy-job: + stage: deploy + script: + - mkdir -p "$EXPORT_DIR/$CI_PROJECT_NAME" + - cp -r public/* "$EXPORT_DIR/$CI_PROJECT_NAME" + tags: + - production + only: + - master + when: manual + +cleanup-job: + stage: cleanup + script: + - rm -r "$EXPORT_DIR/$CI_PROJECT_NAME" + tags: + - production + when: manual \ No newline at end of file -- GitLab