Skip to content

Commit 2cb7139

Browse files
committed
Add deployment Jenkinsfile
1 parent 516a601 commit 2cb7139

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

Jenkinsfile-deployment

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
def config = [
2+
production: "katujemy.kacik.it",
3+
staging: "staging.katujemy.kacik.it"
4+
]
5+
6+
def target = env.BRANCH_NAME == 'master' ? "production" : "staging"
7+
def target_host = config[target]
8+
9+
pipeline{
10+
agent any
11+
stages{
12+
stage("Deploy to environment"){
13+
steps{
14+
echo "Deploying to ${target}"
15+
sh """
16+
rsync --delete -rzhe "ssh -o StrictHostKeyChecking=no" ./ root@${target_host}:/app/
17+
ssh -o StrictHostKeyChecking=no root@${target_host} 'cd /app/.deployment; dip provision'
18+
"""
19+
sh "timeout 120 wget --retry-connrefused --tries=120 --waitretry=1 -q http://${target_host}:80808888/instances -O /dev/null"
20+
}
21+
}
22+
}
23+
}

0 commit comments

Comments
 (0)