Last active
March 19, 2018 08:49
-
-
Save mandrius/2e3ebe909615ed1c7fcd3b4e894f843c to your computer and use it in GitHub Desktop.
GitLab CI/CD auto deploy (Drupal 8).
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 | |
dev-deployment: | |
stage: deploy | |
script: | |
- ssh HOST 'bash -s' < dev-deployment.sh | |
only: | |
- develop | |
prd-deployment: | |
stage: deploy | |
script: | |
- ssh HOST 'bash -s' < prd-deployment.sh | |
only: | |
- master |
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
#!/bin/bash | |
set -e # We want to fail at each command, to stop execution. | |
cd /home/dev/web | |
# Make database dump. | |
#dump_file_name="HOST-develop-`date +%Y-%m-%d-%H%M`.sql.gz" | |
#drush sql-dump --gzip > ../../db/$dump_file_name | |
cd .. | |
git pull | |
# Commit database dump. | |
#git add db/$dump_file_name | |
#git commit -m "Database backup $dump_file_name" | |
#git push | |
# Run composer and import configs. | |
composer install | |
cd web | |
drush updb -y | |
drush cim -y | |
drush cr |
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
#!/bin/bash | |
set -e # We want to fail at each command, to stop execution. | |
cd /home/master/web | |
# Make database dump. | |
dump_file_name="HOST-master-`date +%Y-%m-%d-%H%M`.sql.gz" | |
drush sql-dump --gzip > ../../db/$dump_file_name | |
cd .. | |
git pull | |
# Commit database dump. | |
#git add db/$dump_file_name | |
#git commit -m "Database backup $dump_file_name" | |
#git push | |
# Run composer and import configs. | |
composer install | |
cd web | |
drush updb -y | |
drush cim -y | |
drush cr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment