Andrea Pollastri 5 years ago
parent
commit
0ce0bf11ca
2 changed files with 3 additions and 3 deletions
  1. 2 0
      storage/app/scripts/deploy.sh
  2. 1 3
      storage/app/scripts/hostadd.sh

+ 2 - 0
storage/app/scripts/deploy.sh

@@ -10,6 +10,7 @@ WORK_TREE="/home/###CIPI-USER###/web"
 GIT_DIR="/home/###CIPI-USER###/git/deploy.git"
 GIT_DIR="/home/###CIPI-USER###/git/deploy.git"
 chmod 600 $SSH_KEY
 chmod 600 $SSH_KEY
 eval $(ssh-agent -s)
 eval $(ssh-agent -s)
+ssh-add $SSH_KEY
 if [ -d "$GIT_DIR" ]; then
 if [ -d "$GIT_DIR" ]; then
     cd $WORK_TREE
     cd $WORK_TREE
     git --work-tree=$WORK_TREE --git-dir=$GIT_DIR fetch
     git --work-tree=$WORK_TREE --git-dir=$GIT_DIR fetch
@@ -19,6 +20,7 @@ if [ -d "$GIT_DIR" ]; then
 else
 else
     git init --bare $GIT_DIR
     git init --bare $GIT_DIR
     rm -rf $WORK_TREE
     rm -rf $WORK_TREE
+    mkdir $WORK_TREE
     git --work-tree=$WORK_TREE --git-dir=$GIT_DIR remote add origin $REPO
     git --work-tree=$WORK_TREE --git-dir=$GIT_DIR remote add origin $REPO
     git --work-tree=$WORK_TREE --git-dir=$GIT_DIR fetch
     git --work-tree=$WORK_TREE --git-dir=$GIT_DIR fetch
     git --work-tree=$WORK_TREE --git-dir=$GIT_DIR fetch origin --tags --force
     git --work-tree=$WORK_TREE --git-dir=$GIT_DIR fetch origin --tags --force

+ 1 - 3
storage/app/scripts/hostadd.sh

@@ -360,9 +360,7 @@ fi
 
 
 #GIT INIT
 #GIT INIT
 if [ "$AUTO_INSTALL" = "git" ]; then
 if [ "$AUTO_INSTALL" = "git" ]; then
-    cd /home/$USER_NAME/
-    mkdir /home/$USER_NAME/git/deploy.git
-    ssh-keygen -t rsa -f git/deploy -q -P ""
+    ssh-keygen -t rsa -f /home/$USER_NAME/git/deploy -q -P ""
     chown -R $USER_NAME:$USER_NAME /home/$USER_NAME/git/
     chown -R $USER_NAME:$USER_NAME /home/$USER_NAME/git/
     sudo cp /home/$USER_NAME/git/deploy.pub /home/$USER_NAME/deployment_key.pub
     sudo cp /home/$USER_NAME/git/deploy.pub /home/$USER_NAME/deployment_key.pub
     sudo cp /cipi/deploy.sh /home/$USER_NAME/deploy.sh
     sudo cp /cipi/deploy.sh /home/$USER_NAME/deploy.sh