Last active
October 20, 2020 04:44
-
-
Save dthphuong/67bdb8bf70f0cf809b02c43763dfc1bd to your computer and use it in GitHub Desktop.
CI/CD scripts
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
# Basic CodeIgniter 3.x project | |
stages: | |
- deploy | |
deploy: | |
stage: deploy | |
script: | |
- echo "Deploying . . ." | |
- whoami | |
- mkdir -p /var/www/homie/phuongduong/phuongmai-wedding | |
- cp -a ./* /var/www/homie/phuongduong/phuongmai-wedding | |
- cd /var/www/homie/phuongduong/phuongmai-wedding | |
- pwd | |
- ls | |
- echo "Completed !!!" |
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
stages: | |
- deploy | |
deploy: | |
stage: deploy | |
only: | |
- master | |
script: | |
- echo "Deploying . . ." | |
- whoami | |
- mkdir -p <laravel-path-on-server> | |
- cp -a ./* <laravel-path-on-server> | |
- cd <laravel-path-on-server> | |
- echo "--> Update folders / files permission . . . " | |
- sudo chown -R gitlab-runner:<www-data or apache or httpd> ./ | |
- sudo find ./ -type f -exec sudo chmod 664 {} \; | |
- sudo find ./ -type d -exec sudo chmod 775 {} \; | |
- sudo chgrp -R www-data storage bootstrap/cache | |
- sudo chmod -R ug+rwx storage bootstrap/cache | |
- echo "--> Install packages . . . " | |
- composer install --optimize-autoloader --no-dev | |
- php artisan config:cache | |
- php artisan route:cache | |
- php artisan view:cache | |
- pwd | |
- ls | |
- echo "Completed !!!" |
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
# Deploy NodeJS API | |
stages: | |
- deploy | |
deploy: | |
stage: deploy | |
only: | |
- master | |
script: | |
- echo "Deploying . . ." | |
- whoami | |
- mkdir -p <api-path-on-server> | |
- cd <api-path-on-server> | |
- sudo git pull | |
- sudo pm2 restart all | |
- echo "Completed !!!" |
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
stages: | |
- deploy | |
deploy: | |
stage: deploy | |
only: | |
- master | |
script: | |
- echo "Deploying . . ." | |
- whoami | |
- mkdir -p <vuejs-path-on-server> | |
- cp -a ./* <vuejs-path-on-server> | |
- cd <vuejs-path-on-server> | |
- npm install | |
- npm run build | |
- echo "--> Update folders / files permission . . . " | |
- sudo chown -R gitlab-runner:<www-data or apache or httpd> ./ | |
- sudo chmod -R 775 ./ | |
- pwd | |
- ls | |
- echo "Completed !!!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment