How do I add a custom step?
To add a new custom step to your
jenkins-x.yml file see how to use the jx create step
How do Jenkins X Pipelines compare to Jenkins pipelines?
How do I get IDE completion editing
What environment variables are available by default inside a pipeline?
Is there a reference for the syntax?
How do I mount a Secret or ConfigMap?
Each step in a Jenkins X Pipeline in the
jenkins-x.yml file is basically a Container from kubernetes so you can specify the image, resource limitts, environment variables and mount them from a
If you are inside a shell script you can also use the jx step credential
Can I mount a Persistent Volume in my pipeline?
Tekton already mounts a separate Persistent Volume for each build pod at
/workspace so the build results are kept around for a while until they are garbage collected.
On most kubernetes clusters you cannot easily share a single Persistent Volume across multiple pods; so having a shared PV across builds isn’t generally easy or compatible. You can however add a step to populate your PV on startup from a cloud bucket and at the end of a pipeline copy data into a bucket to speed up caching.
You can also do things like use Nexus as a network cache for fetching maven dependencies (which happens OOTB with Maven builds in Jenkins X) or add the Athens proxy for Go.
Hopefully the Tekton community will figure out some even better caching solutions to speed up builds.
How do I define an environment variable inside a step for other steps to use?
Files are the easiest approach as the
/workspace directory is shared with all steps. So write in one step and use the value from other steps etc.
The other option is mounting a
ConfigMap as environment variables into each step and modifying that on one step; but files are easier really.
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.