Skip to main content
Jump to: navigation, search

TCK:GF API integration pipeline

#!/usr/bin/env groovy

node {
    // THE glassfish the new API to be integrated there
    env.GF_URL = ""
    // Job that created the API artifact
    def API_BUILD_JOB = "jenkins://./jsonb-ee4j-build"
    stage ("Download API artifact from the build job") {
        dir ("download") {
            copyRemoteArtifacts(from: "${API_BUILD_JOB}")
            //flatten - could be done by copyRemoteArtifacts but mapper arg expects java class
            sh "find . -mindepth 2 -type f -print -exec mv {} . \\;"
    stage("Grab and unzip Glassfish") {
        sh '''#!/bin/bash -ex
            cd download
            wget -q ${GF_URL} -O
            unzip -q -d ${WORKSPACE}
            cd ${WORKSPACE}/glassfish5/glassfish/modules

    stage ("Replace API in GF") {
        sh '''#!/bin/bash -ex
            cd glassfish5/glassfish/modules      
            #strip the api name of RC, SNAPSHOT, and version.
            for jarfile in ${WORKSPACE}/download/*.jar; do 
               echo $(basename $jarfile) | sed -e 's/-RC[0-9][0-9]*//' | sed -e 's/-SNAPSHOT//' | sed -e 's/\\.[0-9][0-9]*//' | sed -e 's/\\.[0-9][0-9]*//' | sed -e 's/-[0-9][0-9]*//' | while IFS= read -r gfnamejar ; do if [ -f $gfnamejar ]; then rm -v $gfnamejar; cp -v $jarfile $gfnamejar; fi; done;
    stage("Archive the GF") {
          sh '''#!/bin/bash -ex
            cd ${WORKSPACE}
            zip -r glassfish5            
           archiveArtifacts ''

Back to the top