From cb966cbd32c522e7bc8624af5528f0c9efe79f6c Mon Sep 17 00:00:00 2001 From: Amol Ghatol Date: Wed, 20 Dec 2017 12:16:50 +0530 Subject: [PATCH] Issue #24 chore:Sunbird auth package build --- .../{vars/build.yml => defaults/main.yml} | 0 .../pipelines/keycloak-build/Jenkinsfile.dev | 50 +------------------ 2 files changed, 1 insertion(+), 49 deletions(-) rename keycloak/scripts/ansible/roles/keycloak/{vars/build.yml => defaults/main.yml} (100%) diff --git a/keycloak/scripts/ansible/roles/keycloak/vars/build.yml b/keycloak/scripts/ansible/roles/keycloak/defaults/main.yml similarity index 100% rename from keycloak/scripts/ansible/roles/keycloak/vars/build.yml rename to keycloak/scripts/ansible/roles/keycloak/defaults/main.yml diff --git a/keycloak/scripts/pipelines/keycloak-build/Jenkinsfile.dev b/keycloak/scripts/pipelines/keycloak-build/Jenkinsfile.dev index da1702bc..59bfef1c 100644 --- a/keycloak/scripts/pipelines/keycloak-build/Jenkinsfile.dev +++ b/keycloak/scripts/pipelines/keycloak-build/Jenkinsfile.dev @@ -6,56 +6,8 @@ node('build-slave') { try { - stage('Cleanup'){ - sh('rm -rf sunbird-auth') - sh('rm -rf project-sunbird-devops') - sh('rm -rf keycloak-3.2.0.Final.tar.gz') - sh('rm -rf keycloak_build/login.tar.gz') - sh('rm -rf ansible/artifacts/sunbird/login.tar.gz') - sh('rm -rf keycloak_build') - } - - stage('Checkout'){ - checkout scm - sh('git clone https://github.com/project-sunbird/sunbird-auth.git') - - // @Todo Update the URL - // sh('git clone https://github.com/ahghatol/sunbird-devops-1.git project-sunbird-devops') - - sh('git clone https://github.com/project-sunbird/sunbird-devops project-sunbird-devops') - - // Download keycloak package and driver - sh('wget https://downloads.jboss.org/keycloak/3.2.0.Final/keycloak-3.2.0.Final.tar.gz') - sh('wget https://jdbc.postgresql.org/download/postgresql-9.4.1212.jar') - } - stage('Build'){ - sh('mkdir -p sunbird-auth-0.1v'); - - // Login theme build - sh('cd ansible/artifacts/sunbird && tar -zcvf login.tar.gz *') - - // Sms plugin build - sh('cd sunbird-auth/keycloak/sms-provider && mvn package') - - - sh('cp keycloak-3.2.0.Final.tar.gz keycloak_build') - sh('cp postgresql-9.4.1212.jar keycloak_build') - - // Copy file to keycloak_build directory - sh('cp sunbird-auth/keycloak/sms-provider/target/keycloak-email-phone-autthenticator-1.0-SNAPSHOT.jar keycloak_build') - - // Create zip and Copy file to keycloak_build directory - sh('cd sunbird-auth/keycloak/sms-provider/templates && tar -zcvf templates.tar.gz *') - sh('cp sunbird-auth/keycloak/sms-provider/templates/templates.tar.gz keycloak_build') - - // Copy ansible template for Provider config and keycloak configuration - sh('mkdir -p keycloak_build/ansible-templates'); - - sh('cp project-sunbird-devops/ansible/roles/keycloak/templates/* keycloak_build/ansible-templates') - - sh('cp ansible/artifacts/sunbird/login.tar.gz keycloak_build') - sh('tar -zcvf keycloak_build.tar.gz keycloak_build') + sh('cd sunbird-devops/ansible && ansible-playbook -i ../../ansible/inventories/dev keycloak.yml --tags deploy --vault-password-file /run/secrets/vault-pass ') } stage('Archive'){