-
-
Save ArielMejiaDev/ce09c2610125692b3954ed0ff58f8c2d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
before_script: | |
- echo 'Before script' | |
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' | |
- eval $(ssh-agent -s) | |
- mkdir -p ~/.ssh | |
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - | |
- chmod 700 ~/.ssh | |
- ssh-keyscan -H 'domain.com' >> ~/.ssh/known_hosts | |
- chmod 644 ~/.ssh/known_hosts | |
building: | |
stage: build | |
script: | |
- ssh root@domain.com "cd /var/www/main/ && | |
git checkout -f master && | |
git pull origin master && | |
cd /var/www/main/back/ && | |
composer install -no-dev && | |
php artisan key:generate && | |
php artisan migrate && | |
php artisan cache:clear && | |
php artisan config:clear && | |
php artisan storage:link -q && | |
sudo chown -R fixable:www-data /var/www/main/back && | |
sudo chmod 775 -R /var/www/main/back && | |
sudo chgrp -R www-data /var/www/main/back/storage /var/www/main/back/bootstrap/cache && | |
sudo chmod -R ug+rwx /var/www/main/back/storage /var/www/main/back/bootstrap/cache | |
" | |
only: | |
refs: | |
- pipeline | |
deploying: | |
stage: deploy | |
script: | |
- echo "Deployed" | |
only: | |
refs: | |
- pipeline |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment