From 51a524ffa40c4d566a3ef95edb0496af5411b790 Mon Sep 17 00:00:00 2001 From: Sofus Rose Date: Thu, 26 Jan 2017 18:35:08 -0500 Subject: [PATCH] Added user feature to upload.sh --- .gitlab-ci.yml | 23 +++++++++++------------ doc/upload.sh | 7 +++++-- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 99cf4c3..05c30b1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,20 +3,18 @@ image: python:3.5 stages: - build - test - - deploy + #~ - deploy # - review before_script: - #~ - apt-get update && apt-get -y install gcc libmagickwand-dev make + - apt-get update && apt-get -y install git-lfs + - git lfs install - pip3 install -U pip setuptools wheel - pip3 install -r requirements.txt - python3 setup.py build_ext -i #Need the C++ extension only. - mkdir testpath -after_script: - - rm -rf dist build docs/build openlut.egg-info - build: stage: build script: @@ -39,15 +37,16 @@ build_docs: test: stage: test script: + - git lfs pull - python3 tests/suite.py -deploy_docs: - stage: deploy - environment: - name: Documentation - url: https://www.sofusrose.com/openlut - script: - - docs/upload.sh +#~ deploy_docs: + #~ stage: deploy + #~ environment: + #~ name: Documentation + #~ url: https://www.sofusrose.com/openlut + #~ script: + #~ - docs/upload.sh #~ when: manual diff --git a/doc/upload.sh b/doc/upload.sh index 6080274..4a357b6 100755 --- a/doc/upload.sh +++ b/doc/upload.sh @@ -1,6 +1,9 @@ #!/bin/bash -REMOTE=sofus@wakingnexus +USER="$1" +if [ -z $USER ]; then USER="sofus"; fi + +REMOTE="${USER}@wakingnexus" #Remove the old docs. ssh $REMOTE 'bash -s' << 'ENDSSH' @@ -15,7 +18,7 @@ rsync -avzP build/html/* $REMOTE:/var/www/openlut/ #Set strong permissions. ssh $REMOTE 'bash -s' << 'ENDSSH' -chown -R sofus:www-data /var/www/openlut/* +chown -R $USER:www-data /var/www/openlut/* find /var/www/openlut -type f -exec chmod 0640 {} \; find /var/www/openlut -type d -exec chmod 2750 {} \;