Skip to content

Commit

Permalink
fixes #43 #44
Browse files Browse the repository at this point in the history
  • Loading branch information
seyuf committed Feb 2, 2023
1 parent 2769772 commit ae98c9a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
8 changes: 1 addition & 7 deletions scripts/deploy-production.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#!/bin/bash

#set -e
set -e

PROJECT_PATH="$(pwd)"


echo "project path is $PROJECT_PATH";

which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )
Expand All @@ -13,13 +12,10 @@ mkdir ~/.ssh/ && echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_
ssh-add ~/.ssh/id_rsa
echo "$SSH_CONFIG" > /etc/ssh/ssh_config && chmod 600 /etc/ssh/ssh_config



echo "Create artifact and send to server"

cd $PROJECT_PATH


echo "Deploying to production server";

mkdir -p deployer/scripts/
Expand All @@ -33,11 +29,9 @@ ARCHIVES="deployer/scripts/production"
[ -d "pwa-studio" ] && ARCHIVES="$ARCHIVES pwa-studio"
[ -d "magento" ] && ARCHIVES="$ARCHIVES magento"


tar cfz "$BUCKET_COMMIT" $ARCHIVES
scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null "$BUCKET_COMMIT" production:$HOST_DEPLOY_PATH_BUCKET


cd /opt/config/php-deployer

echo 'Deploying production ...';
Expand Down
7 changes: 1 addition & 6 deletions scripts/deploy-staging.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#!/bin/bash

#set -e
set -e

PROJECT_PATH="$(pwd)"


echo "project path is $PROJECT_PATH";

which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )
Expand All @@ -13,8 +12,6 @@ mkdir ~/.ssh/ && echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_
ssh-add ~/.ssh/id_rsa
echo "$SSH_CONFIG" > /etc/ssh/ssh_config && chmod 600 /etc/ssh/ssh_config



echo "Create artifact and send to server"

cd $PROJECT_PATH
Expand Down Expand Up @@ -42,7 +39,6 @@ cd /opt/config/php-deployer

echo 'Deploying staging ...';


echo '------> Deploying bucket ...';
# deploy bucket
php7.4 ./vendor/bin/dep deploy-bucket staging \
Expand Down Expand Up @@ -79,7 +75,6 @@ php7.4 ./vendor/bin/dep $DEFAULT_DEPLOYER staging \
-o write_use_sudo=$WRITE_USE_SUDO

echo "running magento and/or pwa deployer"

if [ -d "$PROJECT_PATH/magento" ]
then
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null staging "cd $HOST_DEPLOY_PATH/current/magento/ && /bin/bash $HOST_DEPLOY_PATH/deployer/scripts/staging/post_release_setup.sh"
Expand Down

0 comments on commit ae98c9a

Please sign in to comment.