Skip to content
This repository has been archived by the owner on Apr 20, 2022. It is now read-only.

Automate project customization #55

Open
4 tasks done
marcingrzejszczak opened this issue Jun 7, 2017 · 4 comments
Open
4 tasks done

Automate project customization #55

marcingrzejszczak opened this issue Jun 7, 2017 · 4 comments

Comments

@marcingrzejszczak
Copy link
Contributor

marcingrzejszczak commented Jun 7, 2017

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

  • I don't want to use CF (Does the pipeline only supports PCF instance for now? #61)
  • Remove all the stage / prod Eureka / MySQL / Rabbit installations - move them to a script that should be executed before running the pipeline
  • Add customization of settings.xml / gradle.properties
  • Create a CLI to remove unnecessary parts of code
@malston
Copy link
Contributor

malston commented Aug 24, 2017

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

  • Custom docker image -- needed to add an SSL cert to access Artifactory over HTTPS
  • Maven and Gradle settings were customized for publishing to Artifactory using secure token
  • Opt out of certain jobs/tasks (like api compatibility or test-rollback)
  • Clone using git ssh, not https (Jenkins only)
  • Use Gitlab instead of Github
  • Retrieve version from Maven/Gradle and use that snapshot version instead of the generated PIPELINE_VERSION.
  • Add an optional step to promote a snapshot versioned artifact to a release using the Artifactory API
  • Deploy artifact as a WAR versus a JAR (Used when app isn't a microservice)
  • Account for a Git branching strategy that supports topic and release branches
  • More flexible PCF org/space setup (Not just pcfdev)
  • Be able to bind to user-provided services

@marcingrzejszczak
Copy link
Contributor Author

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 (9c34462)

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

Moved to #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
Copy link
Contributor Author

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="[email protected]"
// 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
Copy link
Contributor Author

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

@marcingrzejszczak marcingrzejszczak modified the milestones: 1.0.0.RELEASE, 1.0.0.M7 Sep 27, 2017
@marcingrzejszczak marcingrzejszczak modified the milestones: 1.0.0.M7, 1.0.0.RELEASE Oct 31, 2017
@marcingrzejszczak marcingrzejszczak removed this from the 1.0.0.RELEASE milestone Nov 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants