spring-attic / spring-cloud-pipelines

[DEPRECATED] Codebase containing Concourse and Jenkins opinionated pipelines. Moved to https://github.com/CloudPipelines/
https://github.com/CloudPipelines/
Apache License 2.0
235 stars 175 forks source link

Automate project customization #55

Open marcingrzejszczak opened 7 years ago

marcingrzejszczak commented 7 years ago

Under this issue please comment on what you had to manually customize in the project so that it suit the needs for your company.

malston commented 7 years ago

Here are some things I've had to change in spring-cloud-pipelines to use it at other companies:

marcingrzejszczak commented 7 years ago

Custom docker image -- needed to add an SSL cert to access Artifactory over HTTPS

What did you have to do exactly to solve this?

Maven and Gradle settings were customized for publishing to Artifactory using secure token

Nothing really that we can customize out of the box I guess

Clone using git ssh, not https (Jenkins only) Use Gitlab instead of Github

It's enough to pass the REPO env var and provide whatever git url you need

Opt out of certain jobs/tasks (like api compatibility or test-rollback)

Rollback , deploy to stage can be easily removed from Concourse by removing sections of YAML and binding them back together. In Jenkins it's a switch for the Jenkins JOB Dsl, and for Declarative Pipeline you have to remove part of the code. I guess it makes more sense to manually tweak that. WDYT?

Add an optional step to promote a snapshot versioned artifact to a release using the Artifactory API

That's tricky... and I think very custom.

Deploy artifact as a WAR versus as a JAR

Now it's enough to pass the BINARY_EXTENSION env var to change a JAR to a WAR (https://github.com/spring-cloud/spring-cloud-pipelines/commit/9c344627f22fe0530c55bc62a293ced8da60863e)

Account for a Git branching strategy that supports topic and release branches

Moved to https://github.com/spring-cloud/spring-cloud-pipelines/issues/94

Retrieve version from Maven/Gradle and use that snapshot version instead of the generated PIPELINE_VERSION.

With the change that you've added with custom scripts you can easily override the default behaviour. For Jenkins it's enough to pass the PIPELINE_VERSION env var.

Be able to bind to user-provided service

Where is the PR? :P Can you at least point me to the code?

marcingrzejszczak commented 7 years ago

Customization of settings.xml & gradle.properties can be easily done either by a Groovy script that we present in the K8S part of the docs or just by changing the provided settings.xml file. I repaste the script here

// insert your DockerHub username
String username="dockeruser"
// insert your DockerHub password
String password="dockerpass"
// insert your DockerHub email
String email="docker@email.com"
// modify these if you want to connect to some other instance
String artifactoryId="artifactory-local"
String artifactoryUser="admin"
String artifactoryPass="password"
new File("/root/.m2/settings.xml").text = """
<?xml version="1.0" encoding="UTF-8"?>
<settings>
    <servers>
        <server>
            <id>${artifactoryId}</id>
            <username>${artifactoryUser}</username>
            <password>${artifactoryPass}</password>
        </server>
        <server>
            <id>docker-repo</id>
            <username>${username}</username>
            <password>${password}</password>
            <configuration>
                 <email>${email}</email>
            </configuration>
        </server>
    </servers>
</settings>
"""
new File("/root/.gradle/gradle.properties").text="""
M2_SETTINGS_REPO_USERNAME=${artifactoryUser}
M2_SETTINGS_REPO_PASSWORD=${artifactoryPass}
DOCKER_USERNAME=${username}
DOCKER_PASSWORD=${password}
DOCKER_EMAIL=${email}
"""
println "Done!"
marcingrzejszczak commented 7 years ago

Added the CLI to do some initial customization (http://cloud.spring.io/spring-cloud-pipelines/multi/multi__customizing_the_project.html)