vito/app/SSH/Git/scripts/clone.sh
Richard Anderson c1ae58772c
Isolate Users (#431)
* WIP to isolate users

* Resolved issue with SSH AsUser

Updated Isolated User Script to use Server User for Team Access
Updated Path creation script to simplify for running as the isolated user

* Included the server user

* PHPMyAdmin script updated

Wordpress Script Updated
Updated Execute Script to support executing as isolated users

* Issue Resolution & Resolved Failing Unit Tests

* Fix for isolated_username vs user

* Run the deploy as the isolated user

* queue updates for isolated user

* Support isolated users in cronjobs

* script tests for isolated users

* Queue tests for isolated users

* Cronjob tests for isolated user

* Removed default queue command for laravel apps

* add default user to factory

* laravel pint fixes

* ensure echos are consistent

* removed unneeded parameter

* update

* fix queues for isolated users

* revert addslashes

---------

Co-authored-by: Saeed Vaziry <mr.saeedvaziry@gmail.com>
2025-01-18 01:17:48 +01:00

30 lines
668 B
Bash
Executable File

echo "Host __host__-__key__
Hostname __host__
IdentityFile=~/.ssh/__key__" >> ~/.ssh/config
chmod 600 ~/.ssh/config
ssh-keyscan -H __host__ >> ~/.ssh/known_hosts
rm -rf __path__
if ! git config --global core.fileMode false; then
echo 'VITO_SSH_ERROR' && exit 1
fi
if ! git clone -b __branch__ __repo__ __path__; then
echo 'VITO_SSH_ERROR' && exit 1
fi
if ! find __path__ -type d -exec chmod 755 {} \;; then
echo 'VITO_SSH_ERROR' && exit 1
fi
if ! find __path__ -type f -exec chmod 644 {} \;; then
echo 'VITO_SSH_ERROR' && exit 1
fi
if ! cd __path__ && git config core.fileMode false; then
echo 'VITO_SSH_ERROR' && exit 1
fi