#75 Allow to define external git for role definition
Merged 4 years ago by mkovarik. Opened 4 years ago by mkovarik.
mkovarik/c3i-library external_definition_git  into  master

@@ -44,6 +44,9 @@ 

  # list of flags in semaphore to allow prod promotion

  c3i_semaphore_custom_flags: []

  

+ # Git repo with c3i_definition, can be empty then c3i_git_repo is used

+ c3i_definition_git:

+ c3i_definition_git_branch: master

  c3i_definition_dir: openshift/pipelines

  c3i_definition_update_script: ansible-playbook deploy.yml -e c3i_skip_service_accounts=true

  

@@ -4,7 +4,14 @@ 

  stage('Update pipeline jobs') {

    steps {

      script {

-       dir("{{ c3i_definition_dir }}") {

+       def git_dir = ""

+       if ("{{ c3i_definition_git }}" != "") {

+         git_dir = 'c3i-definition/'

+         dir(git_dir) {

+           c3i.clone(repo: "{{ c3i_definition_git }}", branch: "{{ c3i_definition_git_branch }}")

+         }

+       }

+       dir("${git_dir}{{ c3i_definition_dir }}") {

          sh '{{ c3i_definition_update_script }}'

        }

      } // script

file modified
+6
@@ -24,6 +24,12 @@ 

  PLUGINS=$(curl https://raw.githubusercontent.com/openshift/jenkins/master/2/contrib/openshift/base-plugins.txt | grep -v "#" |grep -v '^$' | sed 's/:.*/:latest/')

  PLUGINS=$(echo -e "$PLUGINS\n$(cat jenkins-plugins.txt)" | sort -u | tr '\n' ',')

  

+ # replace problematic plugins

+ PLUGINS=$(echo $PLUGINS | sed 's/docker-commons:latest/docker-commons:1.16/')

+ PLUGINS=$(echo $PLUGINS | sed 's/kubernetes:latest/kubernetes:1.19.3/')

+ PLUGINS=$(echo $PLUGINS | sed 's/antisamy-markup-formatter:latest/antisamy-markup-formatter:1.6/')

+ 

+ 

  oc create configmap openshift-jenkins-login-plugin-config --from-literal Overall-Administer=view

  

  oc new-app --file=jenkins-template.yml \

@@ -4,6 +4,5 @@ 

  antisamy-markup-formatter:latest

  update-sites-manager:latest

  jms-messaging:latest

- configuration-as-code:latest

  rebuild:latest

  gerrit-trigger:latest