From 01fdf9e1b1eb5355f7580bbc13bb34ee19b6630c Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Tue, 20 Jul 2021 13:24:40 +0200
Subject: [PATCH] Move the deployment config into .gitlab-ci

Users shouldn't need to care about this
---
 .gitlab-ci.yml                      | 2 +-
 .gitlab-ci/.gitignore               | 1 +
 deploy.php => .gitlab-ci/deploy.php | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)
 create mode 100644 .gitlab-ci/.gitignore
 rename deploy.php => .gitlab-ci/deploy.php (98%)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 68abacd..7757a0d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -78,7 +78,7 @@ cs-fixer:
     - chmod 700 ~/.ssh && chmod 600 ~/.ssh/id_rsa
     - ssh-keyscan -t rsa "${DEPLOY_HOST}" >> ~/.ssh/known_hosts
     # Deploy
-    - dep deploy "${CI_ENVIRONMENT_NAME}"
+    - dep deploy --file ./.gitlab-ci/deploy.php "${CI_ENVIRONMENT_NAME}"
     - echo "Deployed to ${CI_ENVIRONMENT_URL}"
     # Simple health check
     - curl --max-time 10 --retry 3 --output /dev/null --silent --show-error --fail --location "${CI_ENVIRONMENT_URL}"
diff --git a/.gitlab-ci/.gitignore b/.gitlab-ci/.gitignore
new file mode 100644
index 0000000..49ce3c1
--- /dev/null
+++ b/.gitlab-ci/.gitignore
@@ -0,0 +1 @@
+/vendor
\ No newline at end of file
diff --git a/deploy.php b/.gitlab-ci/deploy.php
similarity index 98%
rename from deploy.php
rename to .gitlab-ci/deploy.php
index e29d9f1..32342fe 100644
--- a/deploy.php
+++ b/.gitlab-ci/deploy.php
@@ -40,7 +40,7 @@ host('development')
     ->set('KEYCLOAK_CLIENT_ID', 'auth-dev-mw-dev')
     ->set('KEYCLOAK_FRONTEND_CLIENT_ID', 'auth-dev-mw-frontend')
     ->set('rsync', $rsync_config)
-    ->set('rsync_src', __DIR__)
+    ->set('rsync_src', __DIR__.'/../')
     ->set('rsync_dest', '{{release_path}}')
     ->set('cachetool', '127.0.0.1:9001');
 
-- 
GitLab