How to build a custom Oracle Container Pipeline ( Wercker ) step to deploy Helm Charts on Kubernetes

Vamsi Ramakrishnan
jsonlovesyaml
Published in
2 min readOct 5, 2018

If you cannot find a pre-defined step in the Wercker Step store that satisfies your requirement, and if you want these steps defined as custom-code to be consistent and be executed in the same order every single time, you can write your own step.

-----------
History
-----------
* Oracle completed the acquisition of Wercker in 2017 and added it to their rich CI/CD offerings.

* In this article you may find Oracle Container Pipelines being used interchangeably with Wercker!!

If you are new to Wercker, here is some suggested reading

This article relies on the example step for helm that I published on Wercker. Improvements and Contributions welcome!!

Address of Repo

How to

  1. Writing a step on Wercker is no different from using them as a part of your pipeline.
--------
Concepts
--------
A custom Wercker step is a sequence of Wercker steps
A custom Wercker step is a container published into the Step Store

2. You will need the following


1. A Step Manifest File
2. A Wercker.yml File
3. A run.sh File

Step manifest

The step manifest contains the following information

----------------------------
Anatomy of the Step manifest
----------------------------

1. Name of your step
2. Version of your step
3. Summary
4. Configurable Parameters

How does the step manifest file look ?

----
GIST
----
1) Has Kubeconfig parameters
2) Has Helm parameters

Wercker.yml File

1. Define your step build like any other build
2. Add a Publish Step in the end.

How does a Publish Step Look ?

The run.sh file

The run.sh file is the container-entrypoint of the step when it is invoked. Once wercker executes the code in the run.sh file , it moves on to the next step.

How does a Run.Sh Look

-----------
Pseudo-Code
-----------
#!/bin/sh
# Use the Packages defined in Wercker.yml
# Do Something using Property Variables defined in Step Manifest
# Echo Something for the user's benefit
# End of Script

Code:

Import it into Wercker

Building Step== Building Application

* in Wercker :)

---------
Workflow
---------
1) Create New Application
2) Connect it with your SCM in Oracle Developer Cloud Service/ Github/Gitlab
3) Select the repository
4) Add the defined Wercker.yml from repo
5) Define Pipelines as written in the wercker.yml
6) Trigger Build , by updating

Go to the Steps store

Voila!! use it!!

--

--

Vamsi Ramakrishnan
jsonlovesyaml

I work for Google. All views expressed in this publication are my own. Google Cloud | ex-Oracle | https://goo.gl/aykaPB