sh Configuraçõesparao Jenkins de alguns projetos。
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh Configuraçõesparao Jenkins de alguns projetos。相关的知识,希望对你有一定的参考价值。
# instalar as dependências do composer para o build
composer install
# rodar os testes com phpunit
./vendor/bin/phpunit
rsync -Cravzphe "ssh -o StrictHostKeyChecking=no -p 2222" \
--exclude vendor/ \
--exclude .env \
--exclude .git \
--exclude .gitignore \
--exclude .gitattributes \
. vigorearq@108.179.192.219:/home/vigorearq/laravel-site
ssh vigorearq@108.179.192.219 -p 2222 <<EOF
cd /home/vigorearq/laravel-site
rsync -a public/ ../public_html/
rm -rf public/
if [ -d vendor ]; then
/opt/php70/bin/php ~/bin/composer update --no-scripts --prefer-dist
/opt/php70/bin/php ~/bin/composer run-script post-update-cmd-production
else
/opt/php70/bin/php ~/bin/composer install --no-scripts --prefer-dist
if [ -f composer.lock ]; then
/opt/php70/bin/php ~/bin/composer run-script post-install-cmd-production
else
/opt/php70/bin/php ~/bin/composer run-script post-update-cmd-production
fi
fi
EOF
# instalar as dependências do composer para o build
composer install
# rodar os testes com phpunit
./vendor/bin/phpunit
rsync -Cravzphe "ssh -o StrictHostKeyChecking=no -p 2222" \
--exclude vendor/ \
--exclude .env \
--exclude .git \
--exclude .gitignore \
--exclude .gitattributes \
. kasulodhcom@108.179.192.218:/home/kasulodhcom/laravel-site
ssh kasulodhcom@108.179.192.218 -p 2222 <<EOF
cd /home/kasulodhcom/laravel-site
rsync -a public/ ../public_html/ilcc/
rm -rf public/
if [ -d vendor ]; then
/opt/php70/bin/php ~/bin/composer update --no-scripts --prefer-dist
/opt/php70/bin/php ~/bin/composer run-script post-update-cmd-production
else
/opt/php70/bin/php ~/bin/composer install --no-scripts --prefer-dist
if [ -f composer.lock ]; then
/opt/php70/bin/php ~/bin/composer run-script post-install-cmd-production
else
/opt/php70/bin/php ~/bin/composer run-script post-update-cmd-production
fi
fi
EOF
# instalar as dependências do composer para o build
composer install
# rodar os testes com phpunit
./vendor/bin/phpunit
rsync -Cravzphe "ssh -o StrictHostKeyChecking=no -p 2222" \
--exclude vendor/ \
--exclude .env \
--exclude .git \
--exclude .gitignore \
--exclude .gitattributes \
. herosdellavegaco@108.179.192.219:/home/herosdellavegaco/laravel-site
ssh herosdellavegaco@108.179.192.219 -p 2222 <<EOF
cd /home/herosdellavegaco/laravel-site
rsync -a public/ ../public_html/site/
rm -rf public/
if [ -d vendor ]; then
/opt/php70/bin/php ~/bin/composer update --no-scripts --prefer-dist
/opt/php70/bin/php ~/bin/composer run-script post-update-cmd-production
else
/opt/php70/bin/php ~/bin/composer install --no-scripts --prefer-dist
if [ -f composer.lock ]; then
/opt/php70/bin/php ~/bin/composer run-script post-install-cmd-production
else
/opt/php70/bin/php ~/bin/composer run-script post-update-cmd-production
fi
fi
EOF
#!/bin/bash
TZ=America/Sao_Paulo date
folder="last_backup"
datebkp=$(date +"%Y%m%d%H%M%S")
backup_date=$(date +"%d/%m/%Y")
backup_hour=$(date +"%H:%M:%S")
user="herosdellavegaco"
server="108.179.192.219"
port="2222"
path_server="/home/herosdellavegaco/"
db_database="herosdel_site"
db_username="herosdel_01"
db_password="dw2ZvbKE7JtZ"
db_dump_file="dump-herosdel_site.sql"
if [ ! -d "$folder" ]; then
mkdir $folder
fi
if [ ! -d releases ]; then
mkdir releases
fi
cd $folder
ssh $user@$server -p $port <<EOF
mysqldump -u $db_username -p$db_password $db_database > $db_dump_file
EOF
rsync -Cravzp \
-e "ssh -o StrictHostKeyChecking=no -p $port" \
--include $db_dump_file \
--include "public_html" \
--include "public_html/**" \
--include "laravel-site" \
--include "laravel-site/**" \
--exclude "*" \
--delete \
$user@$server:$path_server .
ssh $user@$server -p $port <<EOF
cd $path_server
rm -f $db_dump_file
EOF
cd ..
zip -r "releases/$datebkp.zip" $folder
curl -X POST --data-urlencode 'payload={"username": "Backup Heros Dellavega", "text": "Backup realizado em '$backup_date' às '$backup_hour'", "icon_emoji": ":inbox_tray:"}' https://hooks.slack.com/services/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
# instalar as dependências do composer para o build
composer install
# rodar os testes com phpunit
./vendor/bin/phpunit
rsync -Cravzphe "ssh -o StrictHostKeyChecking=no -p 2222" \
--exclude vendor/ \
--exclude .env \
--exclude .git \
--exclude .gitignore \
--exclude .gitattributes \
. charlandoespanol@108.179.192.218:/home/charlandoespanol/laravel-site
ssh charlandoespanol@108.179.192.218 -p 2222 <<EOF
cd /home/charlandoespanol/laravel-site
rsync -a public/ ../public_html/
rm -rf public/
if [ -d vendor ]; then
/opt/php70/bin/php ~/bin/composer update --no-scripts --prefer-dist
/opt/php70/bin/php ~/bin/composer run-script post-update-cmd-production
else
/opt/php70/bin/php ~/bin/composer install --no-scripts --prefer-dist
if [ -f composer.lock ]; then
/opt/php70/bin/php ~/bin/composer run-script post-install-cmd-production
else
/opt/php70/bin/php ~/bin/composer run-script post-update-cmd-production
fi
fi
EOF
以上是关于sh Configuraçõesparao Jenkins de alguns projetos。的主要内容,如果未能解决你的问题,请参考以下文章
sh Configuraçãodabridge docker0 e VPN CI&T