Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Saiida1 patch 13 6 #4

Open
wants to merge 100 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
2fbd98e
Create jenkinsfile
saida-sghaier Feb 19, 2018
de72ef1
Update jenkinsfile
saida-sghaier Feb 19, 2018
5ca79fb
Create Jenkinsfile
saida-sghaier Feb 19, 2018
37602a7
Delete jenkinsfile
saida-sghaier Feb 19, 2018
de9b3c0
Delete Jenkinsfile
saida-sghaier Feb 19, 2018
8dbeddb
Create Jenkinsfile
saida-sghaier Feb 19, 2018
2ad4896
Update Jenkinsfile
saida-sghaier Feb 19, 2018
3d9636b
Update Jenkinsfile
saida-sghaier Feb 19, 2018
f9dbacf
Update Jenkinsfile
saida-sghaier Feb 19, 2018
eb9803c
Update Jenkinsfile
saida-sghaier Feb 19, 2018
6c5ab31
Update Jenkinsfile
saida-sghaier Feb 19, 2018
742648c
Update Jenkinsfile
saida-sghaier Feb 19, 2018
d387e97
Update Jenkinsfile
saida-sghaier Feb 19, 2018
0a1f9b8
Update Jenkinsfile
saida-sghaier Feb 19, 2018
74aec9e
Update Jenkinsfile
saida-sghaier Feb 19, 2018
5d21038
Update Jenkinsfile
saida-sghaier Feb 19, 2018
7199050
Update Jenkinsfile
saida-sghaier Feb 19, 2018
f5d8404
Update Jenkinsfile
saida-sghaier Feb 19, 2018
7beff81
Update Jenkinsfile
saida-sghaier Feb 20, 2018
89dc6fe
Update Jenkinsfile
saida-sghaier Feb 20, 2018
7d68a78
Update Jenkinsfile
saida-sghaier Feb 20, 2018
197feba
Update Jenkinsfile
saida-sghaier Feb 20, 2018
9bbd9e7
Update Jenkinsfile
saida-sghaier Feb 20, 2018
a924bc5
Update Jenkinsfile
saida-sghaier Feb 20, 2018
9312a84
Update Jenkinsfile
saida-sghaier Feb 20, 2018
546fd76
Update Jenkinsfile
saida-sghaier Feb 20, 2018
9b119be
Update Jenkinsfile
saida-sghaier Feb 20, 2018
136ad0b
Update Jenkinsfile
saida-sghaier Feb 20, 2018
90b6a21
Update Jenkinsfile
saida-sghaier Feb 20, 2018
9454657
Update Jenkinsfile
saida-sghaier Feb 20, 2018
ab2100e
Update Jenkinsfile
saida-sghaier Feb 20, 2018
7ad6cdf
Update Jenkinsfile
saida-sghaier Feb 20, 2018
809e236
Update Jenkinsfile
saida-sghaier Feb 20, 2018
e29cb71
Update Jenkinsfile
saida-sghaier Feb 20, 2018
dac27b3
Update Jenkinsfile
saida-sghaier Feb 20, 2018
7aacec5
Update Jenkinsfile
saida-sghaier Feb 20, 2018
787d908
Update Jenkinsfile
saida-sghaier Feb 20, 2018
6919ff0
Update Jenkinsfile
saida-sghaier Feb 20, 2018
f481e1d
Update Jenkinsfile
saida-sghaier Feb 20, 2018
a573b66
Update Jenkinsfile
saida-sghaier Feb 21, 2018
3082101
Update Jenkinsfile
saida-sghaier Feb 21, 2018
3ccc18c
Update Jenkinsfile
saida-sghaier Feb 21, 2018
e4c7720
Update Jenkinsfile
saida-sghaier Feb 21, 2018
7ece1eb
Update Jenkinsfile
saida-sghaier Feb 21, 2018
f751e0f
Update Jenkinsfile
saida-sghaier Feb 21, 2018
e793c4c
Update Jenkinsfile
saida-sghaier Feb 21, 2018
78d4ebe
Update Jenkinsfile
saida-sghaier Feb 21, 2018
b383ffa
Update Jenkinsfile
saida-sghaier Feb 21, 2018
65bd636
Update Jenkinsfile
saida-sghaier Feb 23, 2018
ced37d4
Create script.sh
saida-sghaier Feb 25, 2018
d0ec203
Create script.sh
saida-sghaier Feb 25, 2018
1672340
Update Jenkinsfile
saida-sghaier Feb 25, 2018
edfbad8
Update Jenkinsfile
saida-sghaier Feb 25, 2018
9a06869
Update Jenkinsfile
saida-sghaier Feb 25, 2018
06122a1
Update Jenkinsfile
saida-sghaier Feb 25, 2018
bcf4d81
Update Jenkinsfile
saida-sghaier Feb 25, 2018
b487f0e
Update Jenkinsfile
saida-sghaier Feb 25, 2018
2d32f52
Update Jenkinsfile
saida-sghaier Feb 25, 2018
4778d86
Update Jenkinsfile
saida-sghaier Feb 25, 2018
4a2f8a6
Update script.sh
saida-sghaier Feb 25, 2018
75c5e65
Update script.sh
saida-sghaier Feb 25, 2018
7f94014
Update Jenkinsfile
saida-sghaier Feb 25, 2018
e8953a8
Create scrip.sh
saida-sghaier Feb 25, 2018
3bc899f
Create scrip.sh
saida-sghaier Feb 25, 2018
bceb06f
Update Jenkinsfile
saida-sghaier Feb 25, 2018
faeb8d8
Update scrip.sh
saida-sghaier Feb 25, 2018
41aedb7
Update Jenkinsfile
saida-sghaier Feb 25, 2018
25683a8
Update Jenkinsfile
saida-sghaier Feb 25, 2018
c197ce9
Update Jenkinsfile
saida-sghaier Feb 25, 2018
4fabecd
Update Jenkinsfile
saida-sghaier Feb 25, 2018
5d7ba3d
Update Jenkinsfile
saida-sghaier Feb 25, 2018
062844e
Update Jenkinsfile
saida-sghaier Feb 25, 2018
d6fe7b9
Update Jenkinsfile
saida-sghaier Feb 25, 2018
0b05402
Update Jenkinsfile
saida-sghaier Feb 25, 2018
2568bea
Update Jenkinsfile
saida-sghaier Feb 25, 2018
9398386
Update Jenkinsfile
saida-sghaier Feb 25, 2018
0d6da0d
Update Jenkinsfile
saida-sghaier Feb 25, 2018
250e068
Update Jenkinsfile
saida-sghaier Feb 25, 2018
36de573
Update Jenkinsfile
saida-sghaier Feb 26, 2018
1251cd1
Update Jenkinsfile
saida-sghaier Feb 28, 2018
b2f46f3
Merge pull request #28 from saiida1/saiida1-patch-6
saida-sghaier Feb 28, 2018
bda0d8c
Update Jenkinsfile
saida-sghaier Feb 28, 2018
ce10fcd
Merge pull request #29 from saiida1/saiida1-patch-7
saida-sghaier Feb 28, 2018
8aab488
Update Jenkinsfile
saida-sghaier Feb 28, 2018
7859f1d
Merge pull request #30 from saiida1/saiida1-patch-8
saida-sghaier Feb 28, 2018
95c1932
Update Jenkinsfile
saida-sghaier Feb 28, 2018
7e0f5b0
Merge pull request #31 from saiida1/saiida1-patch-9-1
saida-sghaier Feb 28, 2018
c194017
Update Jenkinsfile
saida-sghaier Apr 26, 2018
6334ec5
Create docker-compose.yml
saida-sghaier Apr 26, 2018
bc1b946
Update Jenkinsfile
saida-sghaier Apr 26, 2018
1c40a49
Update Jenkinsfile
saida-sghaier Apr 26, 2018
b738e43
Create rancher-compose.yml
saida-sghaier Apr 26, 2018
c846d76
Update rancher-compose.yml
saida-sghaier Apr 26, 2018
4cd7e34
Update Jenkinsfile
saida-sghaier Apr 26, 2018
a1dba7c
Update Jenkinsfile
saida-sghaier Apr 26, 2018
018a393
update
saida-sghaier Apr 26, 2018
110963e
update2
saida-sghaier Apr 26, 2018
945a9e1
Update Jenkinsfile
saida-sghaier Apr 26, 2018
c2ac63f
Update Jenkinsfile
saida-sghaier Apr 26, 2018
3cc9d61
Merge pull request #69 from saiida1/saiida1-patch-15
saida-sghaier Apr 26, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 120 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
#!/usr/bin/env groovy
def isAccountChanged = true
def isCustomerChanged = true
def isDiscoveryChanged = false
def isGatewayChanged = false
node {
stage('checkout')
{
checkout scm
}
stage('Check for CHANGELOG update') {
sshagent(['Credential Name']) {
// sh "git config --add remote.origin.fetch +refs/heads/master:refs/remotes/origin/master"
//sh "git fetch --no-tags"
List<String> sourceChanged = sh(returnStdout: true, script: "git diff --name-only HEAD^ origin/${env.BRANCH_NAME}").split()
for (int i = 0; i < sourceChanged.size(); i++) {
echo "** Here ***"
if (sourceChanged[i].contains("account")) {
isAccountChanged = true
}
if (sourceChanged[i].contains("customer")) {
isCustomerChanged = true
}
if (sourceChanged[i].contains("discovery")) {
isDiscoveryChanged = true
}
if (sourceChanged[i].contains("gateway")) {
isGatewayChanged = true
}
}

}
}
}
def micro() {
stage('checkout') {

sh "pwd ;chmod +x script.sh"
sh "pwd ; ./script.sh "

}
stage('scrip') {

sh "pwd ;chmod +x scrip.sh"
sh "pwd ; ./scrip.sh "

}
stage('checkout2') {

sh "pwd ; chmod +x script.sh"
sh "./script.sh "

}
stage('scrip2') {

sh "pwd ; chmod +x scrip.sh"
sh "pwd ; ./scrip.sh "

}
}

stage('Test') {
if (isAccountChanged == true) {

node{

dir('account-service'){
micro()
}
}

}

if (isCustomerChanged == true) {

node{

dir('customer-service'){

micro()

}

}

}

}
node {
stage('deploy staging') {
if (env.BRANCH_NAME == 'master'){
try {
// remove the old rancher stack in case it exists, if not ignore all errors
sh 'cd stack-master && rancher-compose --url http://192.168.56.101:8080/v1/projects/1a5 --access-key B9D9EDC9AF35290AF178 --secret-key DRYbZZ96uM4mNTWWMooqrQVPXDcLm95sEGjMqBNd down'
sh 'cd stack-master && rancher-compose --url http://192.168.56.101:8080/v1/projects/1a5 --access-key B9D9EDC9AF35290AF178 --secret-key DRYbZZ96uM4mNTWWMooqrQVPXDcLm95sEGjMqBNd rm'
sleep(20)
} catch (any) {}

// now deploy the new stack
sh 'cd stack-master && rancher-compose --url http://192.168.56.101:8080/v1/projects/1a5 --access-key B9D9EDC9AF35290AF178 --secret-key DRYbZZ96uM4mNTWWMooqrQVPXDcLm95sEGjMqBNd up -d'
}

else {
try {
// remove the old rancher stack in case it exists, if not ignore all errors
sh 'cd stack-trunk && rancher-compose --url http://192.168.56.101:8080/v1/projects/1a5 --access-key B9D9EDC9AF35290AF178 --secret-key DRYbZZ96uM4mNTWWMooqrQVPXDcLm95sEGjMqBNd down'
sh 'cd stack-trunk && rancher-compose --url http://192.168.56.101:8080/v1/projects/1a5 --access-key B9D9EDC9AF35290AF178 --secret-key DRYbZZ96uM4mNTWWMooqrQVPXDcLm95sEGjMqBNd rm'
sleep(20)
} catch (any) {}


// now deploy the new stack
sh 'cd stack-trunk && rancher-compose --url http://192.168.56.101:8080/v1/projects/1a5 --access-key B9D9EDC9AF35290AF178 --secret-key DRYbZZ96uM4mNTWWMooqrQVPXDcLm95sEGjMqBNd up -d'
}
}

}



3 changes: 1 addition & 2 deletions account-service/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,4 @@ node {
}

}

}
}
2 changes: 2 additions & 0 deletions account-service/scrip.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
echo " yess yess account-service 2"
2 changes: 2 additions & 0 deletions account-service/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
echo " yess yess account-service"
3 changes: 3 additions & 0 deletions customer-service/scrip.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

#!/bin/sh
echo " yess yess customer-service 2 "
2 changes: 2 additions & 0 deletions customer-service/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
echo " yessy yess customer-service"
39 changes: 39 additions & 0 deletions stack-master/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
version: 2
services:
Goauth:
image: usman/go-auth:1.8
command:
- "-l"
- "debug"
- "run"
- "--db-host"
- "db"
- "-p"
- "9000"
labels:

io.rancher.scheduler.affinity:host_label: branch=master
io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name}
io.rancher.container.hostname_override: container_name
db:
image: mysql
environment:
MYSQL_ROOT_PASSWORD: rootpass
MYSQL_DATABASE: messenger
MYSQL_USER: messenger
MYSQL_PASSWORD: messenger
labels:
io.rancher.scheduler.affinity:host_label: branch=master
io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name}
io.rancher.container.hostname_override: container_name

auth-lb:
image: rancher/lb-service-haproxy:v0.6.2
ports:
- 9000:9000/tcp
labels:
io.rancher.container.agent.role: environmentAdmin
io.rancher.container.create_agent: 'true'
io.rancher.scheduler.affinity:host_label: branch=master
io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name}
io.rancher.container.hostname_override: container_name
18 changes: 18 additions & 0 deletions stack-master/rancher-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: '2'
services:
Goauth:
scale: 2
start_on_create: true
auth-lb:
scale: 1
start_on_create: true
lb_config:
port_rules:
- priority: 1
protocol: http
service: Goauth
source_port: 9000
target_port: 9000
db:
scale: 1
start_on_create: true
39 changes: 39 additions & 0 deletions stack-trunk/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
version: 2
services:
Goauth:
image: usman/go-auth:1.8
command:
- "-l"
- "debug"
- "run"
- "--db-host"
- "db"
- "-p"
- "9000"
labels:

io.rancher.scheduler.affinity:host_label: branch=trunk
io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name}
io.rancher.container.hostname_override: container_name
db:
image: mysql
environment:
MYSQL_ROOT_PASSWORD: rootpass
MYSQL_DATABASE: messenger
MYSQL_USER: messenger
MYSQL_PASSWORD: messenger
labels:
io.rancher.scheduler.affinity:host_label: branch=trunk
io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name}
io.rancher.container.hostname_override: container_name

auth-lb:
image: rancher/lb-service-haproxy:v0.6.2
ports:
- 9000:9000/tcp
labels:
io.rancher.container.agent.role: environmentAdmin
io.rancher.container.create_agent: 'true'
io.rancher.scheduler.affinity:host_label: branch=trunk
io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name}
io.rancher.container.hostname_override: container_name
18 changes: 18 additions & 0 deletions stack-trunk/rancher-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: '2'
services:
Goauth:
scale: 2
start_on_create: true
auth-lb:
scale: 1
start_on_create: true
lb_config:
port_rules:
- priority: 1
protocol: http
service: Goauth
source_port: 9000
target_port: 9000
db:
scale: 1
start_on_create: true