Giter VIP home page Giter VIP logo

build-scripts's Introduction

Jenkins DSL

The repository contains job definitions using Jenkins Job Dsl plugin.

How to build it

./gradlew clean build

Warning
The ran test only checks if your scripts compile.

How to use it in Jenkins?

Check out the tutorial. Provide the link to this repository in your Jenkins installation.

The seed job for Spring Cloud should scan the jobs/springcloud/*.groovy files.

Remember to add src/main/groovy and src/main/resources for processing

Warning
Remember that views can be overridden that’s why the suggestion is to contain in one script all the logic needed to build a view for a single project (check out that spring_cloud_views.groovy is building all the spring-cloud views).

I want to add a new job

If your job is a standard Spring Cloud job that:

  • can be built via ./mvnw clean install and deployed with ./mvnw clean deploy

  • has docs under docs and those docs can be built via ./mvnw clean install -Pdocs

  • is using spring-cloud-build thanks to which boot version is parametrized

  • the job resides under the spring-cloud organization

you can just go to io.springframework.cloud.common.AllCloudJobs and add the name of the repo to ALL_JOBS list. That way the default CI jobs and views will be created for the master branch.

If your job needs to be building other branches except for master just add your proper entries to the JOBS_WITH_BRANCHES map in io.springframework.cloud.common.AllCloudJobs.

If you have some custom builds just add the entry to ALL_JOBS and CUSTOM_BUILD_JOBS. Next you should just create your own implementation (check io.springframework.cloud.ci.ConsulSpringCloudDeployBuildMaker for an example). Remember also to call it from the seed job (e.g. springcloud/spring_cloud.groovy:29 for Consul).

The views are automatically generated for you. They base on the name convention so check out springcloud/spring_cloud_views.groovy - it’s pretty straightforward.

Running Jenkins

Just run

docker-compose up -d

and your jenkins with plugins present in plugins.txt will be ready at port 8080.

In order to download the latest plugins:

1) Open in your browser
http://$JENKINS_HOST/pluginManager/api/xml?depth=1&xpath=/*/*/shortName|/*/*/version&wrapper=plugins"
2) Store the XML to a file
3) Pipe the contents of the file to this command:
perl -pe 's/.*?<shortName>([\w-]+).*?<version>([^<]+)()(<\/\w+>)+/\1 \2\n/g'|sed 's/ /:/'
4) Store it as plugins.txt

Wait patiently for Jenkins to start - the job will be added automatically for you.

Configuring Jenkins for Spring Cloud

You have to provide the following values/plugin configuration for your Jenkins to make everything work:

Table 1. Table Things to do
Property Name/Plugin name Description

CF_USERNAME

The name of the Cloud Foundry user that access the Spring Cloud e2e space

CF_PASSWORD

The password for the Cloud Foundry user that access the Spring Cloud e2e space

CF_SPACE

The name of the space in Cloud Foundry that has e2e tests

Git plugin

You have to provide the username and email for the user that access artifactory

Global Slack Notifier

Provide team / integration token values to notify Slack

Cloud plugin

Provide values for Cloud so that jobs labeled for aws execution would work

Cloud plugin

The instances have to have proper values for JDK / JAVA_HOME

Artifactory.DEFAULT_ARTIFACTORY_NAME

The id of the Artifactory Repo is hardcoded in io.springframework.common.Artifactory.DEFAULT_ARTIFACTORY_NAME. Most likely after a new installation it will change and the code will need to get updated.

Maven Trait

The trait io.springframework.common.Maven contains references to Maven installations. You have to have your Jenkins Maven installations correspond to those entries.

Also it’s required to have Maven settings allowing you to push to artifactory.

build-scripts's People

Contributors

marcingrzejszczak avatar markpollack avatar mbogoevici avatar mp911de avatar ryanjbaxter avatar snicoll avatar sobychacko avatar spencergibb avatar wybczu avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.