mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-03 15:02:34 +00:00
init
This commit is contained in:
23
system/commands/common/clone-repository.sh
Executable file
23
system/commands/common/clone-repository.sh
Executable file
@ -0,0 +1,23 @@
|
||||
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
|
7
system/commands/common/composer-install.sh
Executable file
7
system/commands/common/composer-install.sh
Executable file
@ -0,0 +1,7 @@
|
||||
if ! cd __path__; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
||||
|
||||
if ! composer install --no-interaction --prefer-dist --optimize-autoloader --no-dev; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
13
system/commands/common/create-custom-ssl.sh
Normal file
13
system/commands/common/create-custom-ssl.sh
Normal file
@ -0,0 +1,13 @@
|
||||
if ! sudo mkdir __path__; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
||||
|
||||
if ! echo __certificate__ | sudo tee __certificate_path__; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
||||
|
||||
if ! echo __pk__ | sudo tee __pk_path__; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
||||
|
||||
echo "Successfully received certificate."
|
3
system/commands/common/create-letsencrypt-ssl.sh
Normal file
3
system/commands/common/create-letsencrypt-ssl.sh
Normal file
@ -0,0 +1,3 @@
|
||||
if ! sudo certbot certonly --force-renewal --nginx --noninteractive --agree-tos --cert-name __domain__ -m __email__ -d __domain__ --verbose; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
21
system/commands/common/download-phpmyadmin.sh
Normal file
21
system/commands/common/download-phpmyadmin.sh
Normal file
@ -0,0 +1,21 @@
|
||||
sudo rm -rf phpmyadmin
|
||||
|
||||
if ! wget https://files.phpmyadmin.net/phpMyAdmin/5.1.2/phpMyAdmin-5.1.2-all-languages.zip; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
||||
|
||||
if ! unzip phpMyAdmin-5.1.2-all-languages.zip; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
||||
|
||||
if ! rm -rf phpMyAdmin-5.1.2-all-languages.zip; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
||||
|
||||
if ! mv phpMyAdmin-5.1.2-all-languages phpmyadmin; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
||||
|
||||
if ! mv phpmyadmin/config.sample.inc.php phpmyadmin/config.inc.php; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
3
system/commands/common/edit-file.sh
Normal file
3
system/commands/common/edit-file.sh
Normal file
@ -0,0 +1,3 @@
|
||||
if ! echo "__content__" | tee __path__; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
1
system/commands/common/get-public-key.sh
Executable file
1
system/commands/common/get-public-key.sh
Executable file
@ -0,0 +1 @@
|
||||
cat ~/.ssh/id_rsa.pub
|
7
system/commands/common/install-composer.sh
Executable file
7
system/commands/common/install-composer.sh
Executable file
@ -0,0 +1,7 @@
|
||||
cd ~
|
||||
|
||||
curl -sS https://getcomposer.org/installer -o composer-setup.php
|
||||
|
||||
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
|
||||
|
||||
composer
|
5
system/commands/common/run-script.sh
Normal file
5
system/commands/common/run-script.sh
Normal file
@ -0,0 +1,5 @@
|
||||
if ! cd __path__; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
||||
|
||||
__script__
|
4
system/commands/common/storage/download-from-dropbox.sh
Normal file
4
system/commands/common/storage/download-from-dropbox.sh
Normal file
@ -0,0 +1,4 @@
|
||||
curl -o __dest__ --location --request POST 'https://content.dropboxapi.com/2/files/download' \
|
||||
--header 'Accept: application/json' \
|
||||
--header 'Dropbox-API-Arg: {"path":"__src__"}' \
|
||||
--header 'Authorization: Bearer __token__'
|
6
system/commands/common/storage/upload-to-dropbox.sh
Normal file
6
system/commands/common/storage/upload-to-dropbox.sh
Normal file
@ -0,0 +1,6 @@
|
||||
curl --location --request POST 'https://content.dropboxapi.com/2/files/upload' \
|
||||
--header 'Accept: application/json' \
|
||||
--header 'Dropbox-API-Arg: {"path":"__dest__"}' \
|
||||
--header 'Content-Type: text/plain; charset=dropbox-cors-hack' \
|
||||
--header 'Authorization: Bearer __token__' \
|
||||
--data-binary '@__src__'
|
7
system/commands/common/update-branch.sh
Normal file
7
system/commands/common/update-branch.sh
Normal file
@ -0,0 +1,7 @@
|
||||
if ! cd __path__; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
||||
|
||||
if ! git checkout -f __branch__; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
7
system/commands/common/update-cron-jobs.sh
Executable file
7
system/commands/common/update-cron-jobs.sh
Executable file
@ -0,0 +1,7 @@
|
||||
if ! echo '__data__' | sudo -u __user__ crontab -; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
||||
|
||||
if ! sudo -u __user__ crontab -l; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
27
system/commands/common/wordpress/install.sh
Normal file
27
system/commands/common/wordpress/install.sh
Normal file
@ -0,0 +1,27 @@
|
||||
if ! curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
||||
|
||||
if ! chmod +x wp-cli.phar; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
||||
|
||||
if ! sudo mv wp-cli.phar /usr/local/bin/wp; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
||||
|
||||
rm -rf __path__
|
||||
|
||||
if ! wp --path=__path__ core download; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
||||
|
||||
if ! wp --path=__path__ core config --dbname='__db_name__' --dbuser='__db_user__' --dbpass='__db_pass__' --dbhost='__db_host__' --dbprefix='__db_prefix__'; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
||||
|
||||
if ! wp --path=__path__ core install --url='http://__domain__' --title="__title__" --admin_user='__username__' --admin_password="__password__" --admin_email='__email__'; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
||||
|
||||
print "Wordpress installed!"
|
Reference in New Issue
Block a user