This file contains hidden or 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
pipeline { | |
agent 'any' | |
options { | |
skipStagesAfterUnstable() | |
} | |
stages { | |
// Build dev | |
stage('BuildDev') { | |
when { | |
branch 'dev' |
This file contains hidden or 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
pipeline { | |
agent 'any' | |
options { | |
skipStagesAfterUnstable() | |
} | |
stages { | |
// Build | |
stage('BuildMaster') { |
This file contains hidden or 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
pipeline { | |
agent 'any' | |
options { | |
skipStagesAfterUnstable() | |
} | |
environment { | |
exampleEnvType = 'dev' | |
//you can decalare more global env variable here as above, if not needed remove the environment block | |
} |
This file contains hidden or 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
sshpass -p 'Password' rsync -Prtgovze "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --no-perms --no-owner --no-group --delete-after --exclude config/database.php --exclude config/config.php --exclude config/constants.php --exclude config/routes.php --exclude helpers/encrypt_decrypt_helper.php --exclude cms/cms.php --exclude assets/spreadsheet/uploads/ /var/lib/jenkins/jenkins/workspace/repo-name/src/ destination-server-hostname@IP:/usr/share/nginx/html/directory-name/ |
This file contains hidden or 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
image: ubuntu:latest | |
pipelines: | |
branches: | |
master: | |
- step: | |
script: | |
- apt-get update -yqq | |
- 'which ssh-agent || ( apt-get install openssh-client -yqq )' | |
- 'which rsync || ( apt-get install rsync -yqq )' |
This file contains hidden or 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: | |
- mkdir -p ~/.ssh | |
- eval $(ssh-agent -s) | |
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' | |
- echo "$PRIVATEKEY" | tr -d '\r' | ssh-add - > /dev/null | |
stages: | |
- deploy_staging | |
- deploy_master |
This file contains hidden or 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: | |
- apt-get update -yqq | |
- 'which ssh-agent || ( apt-get install openssh-client -y )' | |
- mkdir -p ~/.ssh | |
- eval $(ssh-agent -s) | |
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' | |
stages: | |
- deploy_dev | |
- deploy_stage |
This file contains hidden or 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
<VirtualHost *:80> | |
ServerName example.com | |
ServerAlias www.example.com | |
DocumentRoot /home/user/example.com/public/ | |
<Directory /home/user/example.com/public/> | |
Options Indexes FollowSymLinks | |
AllowOverride All | |
Require all granted | |
</Directory> |