Skip to content

Commit

Permalink
Merge pull request #18 from kramos/master
Browse files Browse the repository at this point in the history
Arbitrary cartridge location (and two more cartridges for the default list)
  • Loading branch information
SachinKSingh28 authored Aug 24, 2016
2 parents f04fd61 + 83ae76b commit cbb5ecd
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 10 deletions.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
git-repos-vol
elk-data-vol
nexus-data-vol
gerrit-site-vol
volumes/elasticsearch-data-vol/elasticsearch/
volumes/jenkins-home-vol
*~
*.swp
*.swo
platform.secrets.sh*
2 changes: 2 additions & 0 deletions cartridges.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
https://github.com/Accenture/adop-cartridge-java.git
https://github.com/Accenture/adop-cartridge-cartridge-dev.git
https://github.com/Accenture/adop-cartridge-chef.git
https://github.com/Accenture/adop-cartridge-docker.git
https://github.com/kramos/adop-cartridge-aspnet-linux.git
https://github.com/kramos/adop-cartridge-flyway.git
25 changes: 15 additions & 10 deletions projects/jobs/jobs.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ export GIT_SSH="${WORKSPACE}/custom_ssh"
# Clone Cartridge
git clone ${CARTRIDGE_CLONE_URL} cartridge
# Find the cartridge
export CART_HOME=$(dirname $(find -name metadata.cartridge | head -1))
# Check if the user has enabled Gerrit Code reviewing
if [ "$ENABLE_CODE_REVIEW" == true ]; then
permissions_repo="${PROJECT_NAME}/permissions-with-review"
Expand Down Expand Up @@ -114,25 +117,25 @@ while read repo_url; do
fi
cd -
fi
done < ${WORKSPACE}/cartridge/src/urls.txt
done < ${WORKSPACE}/${CART_HOME}/src/urls.txt
# Provision one-time infrastructure
if [ -d ${WORKSPACE}/cartridge/infra ]; then
cd ${WORKSPACE}/cartridge/infra
if [ -d ${WORKSPACE}/${CART_HOME}/infra ]; then
cd ${WORKSPACE}/${CART_HOME}/infra
if [ -f provision.sh ]; then
source provision.sh
else
echo "INFO: cartridge/infra/provision.sh not found"
echo "INFO: ${CART_HOME}/infra/provision.sh not found"
fi
fi
# Generate Jenkins Jobs
if [ -d ${WORKSPACE}/cartridge/jenkins/jobs ]; then
cd ${WORKSPACE}/cartridge/jenkins/jobs
if [ -d ${WORKSPACE}/${CART_HOME}/jenkins/jobs ]; then
cd ${WORKSPACE}/${CART_HOME}/jenkins/jobs
if [ -f generate.sh ]; then
source generate.sh
else
echo "INFO: cartridge/jenkins/jobs/generate.sh not found"
echo "INFO: ${CART_HOME}/jenkins/jobs/generate.sh not found"
fi
fi
''')
Expand All @@ -142,7 +145,9 @@ import groovy.io.FileType
def jenkinsInstace = Jenkins.instance
def projectName = build.getEnvironment(listener).get('PROJECT_NAME')
def xmlDir = new File(build.getWorkspace().toString() + "/cartridge/jenkins/jobs/xml")
def mcfile = new FileNameFinder().getFileNames(build.getWorkspace().toString(), '**/metadata.cartridge')
def xmlDir = new File(mcfile[0].substring(0, mcfile[0].lastIndexOf(File.separator)) + "/jenkins/jobs/xml")
def fileList = []
xmlDir.eachFileRecurse (FileType.FILES) { file ->
Expand Down Expand Up @@ -205,7 +210,7 @@ def cartridgeFolder = folder(cartridgeFolderName) {
}
}
dsl {
external("cartridge/jenkins/jobs/dsl/*.groovy")
external("cartridge/**/jenkins/jobs/dsl/*.groovy")
}

}
Expand Down Expand Up @@ -279,4 +284,4 @@ loadCartridgeCollectionJob.with{
sandbox()
}
}
}
}

0 comments on commit cbb5ecd

Please sign in to comment.