2024-06-17 20:41:47 +00:00
|
|
|
#!/usr/bin/env sh
|
|
|
|
|
2024-06-22 19:47:23 +00:00
|
|
|
TARGETDIR='futtern-app'
|
|
|
|
|
|
|
|
if [ -d $TARGETDIR ]; then
|
|
|
|
rm -rf $TARGETDIR
|
2024-06-17 20:41:47 +00:00
|
|
|
fi
|
2024-06-22 19:47:23 +00:00
|
|
|
mkdir $TARGETDIR
|
|
|
|
cd $TARGETDIR || return
|
2024-06-17 20:41:47 +00:00
|
|
|
|
|
|
|
pathsToCopy="public bin config migrations src templates composer.json composer.lock symfony.lock .env etc"
|
|
|
|
|
|
|
|
for path in $pathsToCopy
|
|
|
|
do
|
|
|
|
cp -r ../../"$path" ./
|
|
|
|
done
|
|
|
|
|
|
|
|
rm ./bin/phpunit
|
|
|
|
APP_ENV=prod composer install --no-dev -a
|
|
|
|
mkdir -p ~/.ssh/
|
|
|
|
# Print the SSH key, replacing newline characters with actual new lines
|
|
|
|
echo "$SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_rsa
|
|
|
|
# Set appropriate permissions for the SSH key
|
|
|
|
chmod 600 ~/.ssh/id_rsa
|
|
|
|
# Add the remote host's key to the known_hosts file to avoid authenticity confirmation
|
|
|
|
ssh-keyscan -H $HOST >> ~/.ssh/known_hosts
|
|
|
|
# SCP files to the remote host
|
|
|
|
rsync -avz --delete public/ ${USERNAME}@${HOST}:${TARGETDIR}
|
2024-06-22 19:47:23 +00:00
|
|
|
|
|
|
|
|