We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 516a601 commit 2cb7139Copy full SHA for 2cb7139
1 file changed
Jenkinsfile-deployment
@@ -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