Skip to content

Commit

Permalink
Ansible-playbook
Browse files Browse the repository at this point in the history
  • Loading branch information
ragupathi09 committed Jan 23, 2022
1 parent 53fedd8 commit 2f64ee6
Show file tree
Hide file tree
Showing 114 changed files with 3,514 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Ansible/Play-Books/asset-service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
- hosts: all
become: True
ignore_errors: True
tasks:

- name: Make sure a service unit is stop
service:
name: cloudblm-asset-service
state: stopped

- name: Make sure a service unit is restart
service:
name: cloudblm-asset-service
state: restarted
16 changes: 16 additions & 0 deletions Ansible/Play-Books/clash-management.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
- hosts: localhost
become: True
ignore_errors: True
tasks:

- name: Make sure a service unit is stop
service:
name: cloudblm-clashs-servie
state: stopped


- name: Make sure a service unit is restart
service:
name: cloudblm-clashs-servie
state: restarted
16 changes: 16 additions & 0 deletions Ansible/Play-Books/clash-service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
- hosts: localhost
become: True
ignore_errors: True
tasks:


- name: Make sure a service unit is stop
service:
name: cloudblm-clash-service
state: stopped

- name: Make sure a service unit is restart
service:
name: cloudblm-clash-service
state: restarted
15 changes: 15 additions & 0 deletions Ansible/Play-Books/email-notify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
- hosts: localhost
become: True
ignore_errors: True
tasks:

- name: Make sure a service unit is stop
service:
name: cloudblm-emailnotify-service
state: stopped

- name: Make sure a service unit is restart
service:
name: cloudblm-emailnotify-service
state: restarted
15 changes: 15 additions & 0 deletions Ansible/Play-Books/gateway-service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
- hosts: localhost
become: True
tasks:

- name: Make sure a service unit is stop
service:
name: GatewayService
state: stopped


- name: Make sure a service unit is restart
service:
name: GatewayServicecd publish
state: restarted
14 changes: 14 additions & 0 deletions Ansible/Play-Books/global-asset.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
- hosts: localhost
become: True
tasks:

- name: Make sure a service unit is stop
service:
name: cloudblm-globalasset-service
state: stopped

- name: Make sure a service unit is restart
service:
name: cloudblm-globalasset-service
state: restarted
Empty file.
14 changes: 14 additions & 0 deletions Ansible/Play-Books/permission-service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
- hosts: localhost
become: True
tasks:

- name: Make sure a service unit is stop
service:
name: cloudblm-permission-service
state: stopped

- name: Make sure a service unit is restart
service:
name: cloudblm-permission-service
state: restarted
16 changes: 16 additions & 0 deletions Ansible/Play-Books/role-service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
- hosts: localhost
become: True
tasks:



- name: Make sure a service unit is stop
service:
name: cloudblm-roles-service
state: stopped

- name: Make sure a service unit is restart
service:
name: cloudblm-roles-service
state: restarted
15 changes: 15 additions & 0 deletions Ansible/Play-Books/user-service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
- hosts: localhost
become: True
tasks:

- name: Make sure a service unit is stop
service:
name: cloudblm-user-service
state: stopped


- name: Make sure a service unit is restart
service:
name: cloudblm-user-service
state: restarted
36 changes: 36 additions & 0 deletions Jenkins-Files/UAT/UAT-dotnet/AssetManagement.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
node('master') {
try {
def dotnet = '/usr/bin/dotnet'
stage('Checkout') {
cleanWs()
checkout([$class: 'SubversionSCM', additionalCredentials: [], excludedCommitMessages: '', excludedRegions: '', excludedRevprop: '', excludedUsers: '', filterChangelog: false, ignoreDirPropChanges: false, includedRegions: '', locations: [[cancelProcessOnExternalsFail: true, credentialsId: '585fa701-720a-4602-abe6-b977c8773a4c', depthOption: 'infinity', ignoreExternalsOption: true, local: '.', remote: 'https://192.168.1.200/svn/api/Products/Cloud BLM/Application/branches/Experimental branch/BackEnd Services- Unified Database/CloudBLM-AssetManagementService']], quietOperation: true, workspaceUpdater: [$class: 'UpdateUpdater']])
}
stage('Remove obj') {
sh 'rm -rf */obj'
}
stage('Clean') {
sh 'dotnet clean'
}
stage('Build') {
sh 'dotnet build --configuration Release'
}
stage('Stop Service') {
sh 'sudo systemctl stop cloudblm-asset-service.service'
}
stage('Publish') {
sh 'sudo dotnet publish -c Release --output /opt/apps/AssetManagementService'
}
stage('Start Service') {
sh 'sudo systemctl start cloudblm-asset-service.service'
deleteDir()
}
currentBuild.result = 'SUCCESS'
} catch (Exception err) {
currentBuild.result = 'FAILURE'
}
stage('Notify') {
if(currentBuild.result == 'FAILURE') {
mail bcc: '', body: "Hi,\n Jenkins have some issues in ${JOB_NAME} build #${BUILD_NUMBER} \n\n Build URL = ${BUILD_URL} \n\n Job URL = ${JOB_URL}", cc: '', from: '[email protected]', replyTo: '', subject: "Problem in ${JOB_NAME} build #${BUILD_NUMBER}", to: '[email protected]'
}
}
}
33 changes: 33 additions & 0 deletions Jenkins-Files/UAT/UAT-dotnet/ClashManagement.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
node('master') {
try {
def dotnet = '/usr/bin/dotnet'
stage('Checkout') {
cleanWs()
checkout([$class: 'SubversionSCM', additionalCredentials: [], excludedCommitMessages: '', excludedRegions: '', excludedRevprop: '', excludedUsers: '', filterChangelog: false, ignoreDirPropChanges: false, includedRegions: '', locations: [[cancelProcessOnExternalsFail: true, credentialsId: '585fa701-720a-4602-abe6-b977c8773a4c', depthOption: 'infinity', ignoreExternalsOption: true, local: '.', remote: 'https://192.168.1.200/svn/api/Products/Cloud BLM/Application/branches/Experimental branch/BackEnd Services- Unified Database/CloudBLM-ClashManagement']], quietOperation: true, workspaceUpdater: [$class: 'UpdateUpdater']])
}
stage('Clean') {
sh 'dotnet clean'
}
stage('Build') {
sh 'dotnet build --configuration Release'
}
stage('Stop Service') {
sh 'sudo systemctl stop cloudblm-clash-service.service'
}
stage('Publish') {
sh 'sudo dotnet publish -c Release --output /opt/apps/ClashManagementService'
}
stage('Start Service') {
sh 'sudo systemctl start cloudblm-clash-service.service'
deleteDir()
}
currentBuild.result = 'SUCCESS'
} catch (Exception err) {
currentBuild.result = 'FAILURE'
}
stage('Notify') {
if(currentBuild.result == 'FAILURE') {
mail bcc: '', body: "Hi,\n Jenkins have some issues in ${JOB_NAME} build #${BUILD_NUMBER} \n\n Build URL = ${BUILD_URL} \n\n Job URL = ${JOB_URL}", cc: '', from: '[email protected]', replyTo: '', subject: "Problem in ${JOB_NAME} build #${BUILD_NUMBER}", to: '[email protected]'
}
}
}
36 changes: 36 additions & 0 deletions Jenkins-Files/UAT/UAT-dotnet/EmailService.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
node('master') {
try {
def dotnet = '/usr/bin/dotnet'
stage('Checkout') {
cleanWs()
checkout([$class: 'SubversionSCM', additionalCredentials: [], excludedCommitMessages: '', excludedRegions: '', excludedRevprop: '', excludedUsers: '', filterChangelog: false, ignoreDirPropChanges: false, includedRegions: '', locations: [[cancelProcessOnExternalsFail: true, credentialsId: '585fa701-720a-4602-abe6-b977c8773a4c', depthOption: 'infinity', ignoreExternalsOption: true, local: '.', remote: 'https://192.168.1.200/svn/API/Products/Cloud BLM/Application/branches/Experimental branch/BackEnd Services- Unified Database/CloudBLM-EmailNotification']], quietOperation: true, workspaceUpdater: [$class: 'UpdateUpdater']])
}
stage('Remove obj') {
sh 'rm -rf */obj'
}
stage('Clean') {
sh 'dotnet clean'
}
stage('Build') {
sh 'dotnet build --configuration Release'
}
stage('Stop Service') {
sh 'sudo systemctl stop cloudblm-emailnotify-service.service'
}
stage('Publish') {
sh 'sudo dotnet publish -c Release --output /opt/apps/EmailNotification'
}
stage('Start Service') {
sh 'sudo systemctl start cloudblm-emailnotify-service.service'
deleteDir()
}
currentBuild.result = 'SUCCESS'
} catch (Exception err) {
currentBuild.result = 'FAILURE'
}
stage('Notify') {
if(currentBuild.result == 'FAILURE') {
mail bcc: '', body: "Hi,\n Jenkins have some issues in ${JOB_NAME} build #${BUILD_NUMBER} \n\n Build URL = ${BUILD_URL} \n\n Job URL = ${JOB_URL}", cc: '', from: '[email protected]', replyTo: '', subject: "Problem in ${JOB_NAME} build #${BUILD_NUMBER}", to: '[email protected]'
}
}
}
33 changes: 33 additions & 0 deletions Jenkins-Files/UAT/UAT-dotnet/Gateway.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
node('master') {
try {
def dotnet = '/usr/bin/dotnet'
stage('Checkout') {
cleanWs()
checkout([$class: 'SubversionSCM', additionalCredentials: [], excludedCommitMessages: '', excludedRegions: '', excludedRevprop: '', excludedUsers: '', filterChangelog: false, ignoreDirPropChanges: false, includedRegions: '', locations: [[cancelProcessOnExternalsFail: true, credentialsId: '585fa701-720a-4602-abe6-b977c8773a4c', depthOption: 'infinity', ignoreExternalsOption: true, local: '.', remote: 'https://192.168.1.200/svn/api/Products/Cloud BLM/Application/branches/Experimental branch/BackEnd Services- Unified Database/CloudBLM-GatewayService']], quietOperation: true, workspaceUpdater: [$class: 'UpdateUpdater']])
}
stage('Clean') {
sh 'dotnet clean'
}
stage('Build') {
sh 'dotnet build --configuration Release'
}
stage('Stop Service') {
sh 'sudo systemctl stop cloudblm-gateway-service.service'
}
stage('Publish') {
sh 'sudo dotnet publish -c Release --output /opt/apps/GatewayService'
}
stage('Start Service') {
sh 'sudo systemctl start cloudblm-gateway-service.service'
deleteDir()
}
currentBuild.result = 'SUCCESS'
} catch (Exception err) {
currentBuild.result = 'FAILURE'
}
stage('Notify') {
if(currentBuild.result == 'FAILURE') {
mail bcc: '', body: "Hi,\n Jenkins have some issues in ${JOB_NAME} build #${BUILD_NUMBER} \n\n Build URL = ${BUILD_URL} \n\n Job URL = ${JOB_URL}", cc: '', from: '[email protected]', replyTo: '', subject: "Problem in ${JOB_NAME} build #${BUILD_NUMBER}", to: '[email protected]'
}
}
}
36 changes: 36 additions & 0 deletions Jenkins-Files/UAT/UAT-dotnet/GlobalAssetManagement.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
node('master') {
try {
def dotnet = '/usr/bin/dotnet'
stage('Checkout') {
cleanWs()
checkout([$class: 'SubversionSCM', additionalCredentials: [], excludedCommitMessages: '', excludedRegions: '', excludedRevprop: '', excludedUsers: '', filterChangelog: false, ignoreDirPropChanges: false, includedRegions: '', locations: [[cancelProcessOnExternalsFail: true, credentialsId: '585fa701-720a-4602-abe6-b977c8773a4c', depthOption: 'infinity', ignoreExternalsOption: true, local: '.', remote: 'https://192.168.1.200/svn/api/Products/Cloud BLM/Application/branches/Experimental branch/BackEnd Services- Unified Database/CloudBLM-Global']], quietOperation: true, workspaceUpdater: [$class: 'UpdateUpdater']])
}
stage('Remove obj') {
sh 'rm -rf */obj'
}
stage('Clean') {
sh 'dotnet clean'
}
stage('Build') {
sh 'dotnet build --configuration Release'
}
stage('Stop Service') {
sh 'sudo systemctl stop cloudblm-globalasset-service.service'
}
stage('Publish') {
sh 'sudo dotnet publish -c Release --output /opt/apps/GlobalAssetManagementService'
}
stage('Start Service') {
sh 'sudo systemctl start cloudblm-globalasset-service.service'
deleteDir()
}
currentBuild.result = 'SUCCESS'
} catch (Exception err) {
currentBuild.result = 'FAILURE'
}
stage('Notify') {
if(currentBuild.result == 'FAILURE') {
mail bcc: '', body: "Hi,\n Jenkins have some issues in ${JOB_NAME} build #${BUILD_NUMBER} \n\n Build URL = ${BUILD_URL} \n\n Job URL = ${JOB_URL}", cc: '', from: '[email protected]', replyTo: '', subject: "Problem in ${JOB_NAME} build #${BUILD_NUMBER}", to: '[email protected]'
}
}
}
Loading

0 comments on commit 2f64ee6

Please sign in to comment.