From d960786fdb3a0af96b23778aa6d8d58565e440c0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20Hrb=C3=A1=C4=8D?= <david@hrbac.cz>
Date: Wed, 2 Nov 2016 12:07:19 +0100
Subject: [PATCH] nginx owner solution

---
 .gitlab-ci.yml | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index f13a5f15f..05e854869 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -45,13 +45,9 @@ deploy to stage:
   # WARNING: use only in docker container, if you use it with shell you will overwrite your user's ssh config
   - mkdir -p ~/.ssh
   - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
-  - adduser nginx
+  - adduser --quiet --no-create-home nginx
   script:
-  #- ls site/
-  #- echo $CI_BUILD_REF_NAME
-  #- ssh root@"$SSH_HOST_STAGE" uptime
-  - chown nginx site -R
-  - ls
+  - chown nginx:nginx site -R
   - rsync -av --delete site/ root@"$SSH_HOST_STAGE":/srv/docs.it4i.cz/devel/$CI_BUILD_REF_NAME/
 
 deploy to production:
@@ -70,10 +66,9 @@ deploy to production:
   # WARNING: use only in docker container, if you use it with shell you will overwrite your user's ssh config
   - mkdir -p ~/.ssh
   - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config 
+  - adduser --quiet --no-create-home nginx
   script:
-  #- ls site/
-  #- echo $CI_BUILD_REF_NAME
-  #- ssh root@"$SSH_HOST_STAGE" uptime
+  - chown nginx:nginx site -R
   - rsync -av --delete site/ root@"$SSH_HOST_STAGE":/srv/docs.it4i.cz/site/
   only:
   - master
-- 
GitLab