These steps will guide you through creating a git repo hosted on IBM Cloud, creating a toolchain with tool integrations, and configuring a delivery pipeline to automatically build and deploy cloud foundry applications to IBM Cloud. Lastly, we will deploy changes to kick off the pipeline.
In this section we will create a new git repo for our project.
- Go to https://git.ng.bluemix.net
- Click on the green New Project button on the upper right corner of the page.
- Give the project a name and description
- Click Create Project
- Click on the gray Add readme button in the center of the new repo
- You don't have to type anything in, we just need the file created. Click Commit Changes.
- Click on the ssh dropdown and select https
- Copy the git repo address and save for later
- Click on the drop down at the very top right of page and select Settings
- Select Access Tokens on the left nav panel
- Give the token a name and select the api checkbox under the Scopes section.
- Click Create personal access token
- Copy and save your access token to a text document; we will need it later. Once you leave the page you can't retrieve it again.
In this section we will set up a dev ops toolchain which will allow us to integrate our git repo with different tools including a delivery pipeline.
- Go to https://console.bluemix.net and log in if necessary
- Click on the menu button at the top left and select DevOps
- Make sure the location drop down is the region closest to you. If unsure, select Dallas. Click on Create Toolchain on the upper right side of the page.
- Select Build your own toolchain at the bottom
- Give the toolchain a name and verify the region
- Click Create
- Once the toolchain is created, click Add tool
- Select Git Repos and Issue Tracking
- In the repository type dropdown, select existing
- Enter the git repo address that you saved earlier.
- Select the Track deployment of code changes checkbox
- Click Create Integration
- Click Add Tool again
- Select Delivery Pipeline
- Give the pipeline a name and click Create Integration
- Click Add Tool again
- Select Eclipse Orion Web IDE and click Create Integration
In this section we will configure an automated delivery pipeline that will detect changes pushed to the repo, build any dependencies, and deploy to IBM cloud.
- Click on the Delivery Pipeline integration
- Click Add Stage
- Ensure that Git repository is the input type and that the repo you created earlier is in the Git URL
- Select the Jobs tab
- Click Add Job and select Build
- Click Save
- Click Add Stage
- Ensure that build artifacts is the input type and that stage and job reference the build stage we just created.
- Select the Jobs tab
- Click Add Job and select Deploy
- We will need to create a new IBM Cloud API key in order for this stage to work. Click on Manage at the top of the page, hover over Security and right click to open Platform API Keys in a new browser tab.
- On the API key page click on the blue Create button
- Give the API key a name and click on Create
- Copy the API key
- Go back to the browser tab that has the pipeline and deploy stage.
- In the API Key dropdown, select Enter an existing API key and paste in the key we just made.
- Enter your application name in the Appliocation Name field
- Click Save
In this final section, we will test our delivery pipeline by pushing code changes. We will show how to push the code both locally through the git cli and through the browser through the Orion Web IDE.
- In your termainal, navigate to where you want to clone your project and enter the following command, replacing "token" and "giturl" with your actual access token and git url from the first section. Your git url should start with git.ng.bluemix.net/... and end in .git
git clone https://oauth2:token@giturl
- Make your code changes
- Add, commit, and push your code like you normally would using the git cli
- The pipeline should kick off automatically
- Go back to your toolchain page that shows the integrations you have selected.
- Click on the Eclipse Orion Web IDE integration
- In the file explorer, expand your project to see all the files
- Make your code changes
- When done making changes, click on the git icon that is under the pencil on the very left side of the page.
- Review the file changes and enter a commit message. Click Commit
- On the left side of the page under Outgoing changes click on Push
- The pipeline should kick off automatically.