Skip to content

yakirlevi/jenkins-colony

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CloudShell Colony blueprint repository for Jenkins deployment

This blueprint repository allows you to easily deploy Jenkins and connect it to your Cloudshell Colony account. After deployment, this Jenkins instance can be immediately used to launch your pipelines against environments provided by Colony. It comes with a sample pipeline, so that you will have an entry point from which you can start modeling your CI/CD flows using Jenkins and Colony.

This repo contains two blueprints:

Jenkins

This blueprint deploys a Sandbox using Jenkins. Its flow comprises the following steps:

  1. Deploy Jenkins
  2. Install Colony's Jenkins plugin and dependencies
  3. Configure a connection between Colony and Jenkins
  4. Create a sample demo pipeline

Promotions Manager

A demo blueprint used by the predefined pipeline in Jenkins. Deploys a sandbox with a sample app consisting of back end, front end, and database components.

Usage

Prerequisites

  • Only AWS cloud provider is currently supported
  • Before using this solution, you need to have an S3 bucket to store artifacts built by the sample Jenkins job
  • You also need to create an IAM role (for EC2 service) that has write permissions for your S3 bucket, and configure it with write permissions to your S3 bucket

Colony setup

Link your AWS account and S3 bucket to Colony

Go to Settings > Cloud Accounts and link your AWS account. Then, in the Integrations tab, set your S3 bucket as the artifacts repository.

Connect blueprint repo to your Colony space

In your space, go to Settings > Blueprint Repositories and connect this repo as the Blueprint Repository for Sandbox Environments. If you want to experiment with the code and make some changes, fork it and connect your own repository.

Activate blueprints

Go to Blueprints and publish both Jenkins and Promotions Manager blueprints in the Space Blueprints list.

You may now start working with the Jenkins blueprint.

Jenkins Blueprint Usage

Now you are ready to launch a sandbox with Jenkins on the Sandbox Environment page.

Jenkins Blueprint has the following list of input parameters:

  • AWS_INSTANCE_TYPE - specify the AWS instance type according to the required size (default is m5.large).

  • JENKINS_ADMIN_PASS - set the password you will use when logging in to Jenkins with the admin user. Default is admin.

  • CS_COLONY_TOKEN - token that Jenkins will use to communicate with Colony. You can generate it on the Settings > Integrations page.

  • IAM_ROLE - IAM role instance profile name you previously created.

  • SPACE_NAME - the name of the space in which Jenkins will run sandboxes. For our purposes, specify the name of your current space.

    Note: In the future, you might want to create your personal blueprints and configure Jenkins pipelines to use them. These blueprints will probably live in other spaces.

  • BUCKET_NAME - name of the S3 bucket connected to the space you created for artifacts.

params

Demo pipeline

After sandbox deployment, you can log into Jenkins using Quick Link.

quick_link

n Jenkins, you should see a predefined pipeline configured to run a Promotions Manager blueprint in your Colony space.

jenkins

Pipeline steps

The default pipeline loaded with this Jenkins instance will automatically run the following steps:​

  1. Retrieve latest code of the promotion app from Git​
  2. Build artifact package (latest build)​
  3. Upload build to S3 repository​
  4. Deploy the promotions manager application to AWS in a Colony Sandbox​
  5. Run tests​
  6. Terminate the promotions manager application

About

Blueprint repository for Jenkins deployment

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%