From 397c93bcc3243fe610f970846750cfeb0f484a8e Mon Sep 17 00:00:00 2001 From: Amol Ghatol Date: Fri, 29 Dec 2017 10:58:40 +0530 Subject: [PATCH] Issue #24 chore:Sunbird auth package build --- .../{build-conf.yml => build-config.yml} | 0 .../ansible/roles/keycloak/tasks/main.yml | 4 +++ .../keycloak-build/JenkinsfileConfig.dev | 29 +++++++++++++++++++ 3 files changed, 33 insertions(+) rename keycloak/scripts/ansible/roles/keycloak/tasks/{build-conf.yml => build-config.yml} (100%) create mode 100644 keycloak/scripts/pipelines/keycloak-build/JenkinsfileConfig.dev diff --git a/keycloak/scripts/ansible/roles/keycloak/tasks/build-conf.yml b/keycloak/scripts/ansible/roles/keycloak/tasks/build-config.yml similarity index 100% rename from keycloak/scripts/ansible/roles/keycloak/tasks/build-conf.yml rename to keycloak/scripts/ansible/roles/keycloak/tasks/build-config.yml diff --git a/keycloak/scripts/ansible/roles/keycloak/tasks/main.yml b/keycloak/scripts/ansible/roles/keycloak/tasks/main.yml index 4e8c2b59..8b7efe5d 100644 --- a/keycloak/scripts/ansible/roles/keycloak/tasks/main.yml +++ b/keycloak/scripts/ansible/roles/keycloak/tasks/main.yml @@ -6,6 +6,10 @@ tags: - deploy +- include: build-config.yml + tags: + - build-config + - include: deploy-conf.yml tags: - deploy-conf diff --git a/keycloak/scripts/pipelines/keycloak-build/JenkinsfileConfig.dev b/keycloak/scripts/pipelines/keycloak-build/JenkinsfileConfig.dev new file mode 100644 index 00000000..aa9cc331 --- /dev/null +++ b/keycloak/scripts/pipelines/keycloak-build/JenkinsfileConfig.dev @@ -0,0 +1,29 @@ +#!groovy + +node('build-slave') { + + currentBuild.result = "SUCCESS" + + try { + + stage('checkout') + { + sh('rm -rf sunbird-auth') + sh('git clone https://github.com/ahghatol/sunbird-auth.git') + } + + stage('Build'){ + sh('ls') + sh('cd sunbird-auth/keycloak/scripts/ansible && ansible-playbook -i inventories/dev keycloak.yml --limit localhost --tags build-conf --vault-password-file /home/ops/vault -vvv') + } + + stage('Archive'){ + sh('cp sunbird-auth/keycloak/scripts/ansible/sunbird_auth_1.0v.config.zip .') + archiveArtifacts 'sunbird_auth_1.0v.config.zip' + } + } + catch (err) { + currentBuild.result = "FAILURE" + throw err + } +}