Skip to content

silborynirmata/jekins-example

Repository files navigation

Using Jenkins file

This repo contains an example of using Nirmata and nctl to deploy a simple tomcat app.

To use

  • Install or otherwise get access to Jenkins.
  • Create a API Key in Nirmata and create a secret text credentials called NIRMATA_TOKEN accessable by your Jenkins pipeline. (settings->profile)
  • Create a docker secret with your docker login called docker-credentials. Alternately pass this as a Jenkin credential*. "kubectl create secret docker-registry --docker-server= --docker-username= --docker-password= --docker-email= --dry-run -o yaml >docker-credentials.yaml" https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/#registry-secret-existing-credentials
  • Use the Jenkinsfile.kaniko or Jenkinsfile.imgto create the pipeline and adjust the varibles in the environment secition to match your apps, and Nirmata installation.

*To use a jenkins credential for docker repo access you will need to

  • Remove the volume and volume mount section from the pod template.
  • Define a Jenkins Cred for REGISTRY_PASSWORD, and define a variable REGISTRY_USER
  • For Kaniko create a file /kaniko/.docker/config.json with user and password for your docker repo using your docker repo creds. Example '''echo "{"auths":{"$REGISTRY":{"username":"${REGISTRY_USER}","password":"${REGISTRY_PASSWORD}"}}}" > /kaniko/.docker/config.json'''
  • For Img create /root/.docker/config.json as above or run "img login -u $REGISTRY_USER -p REGISTRY_PASSWORD $REGISTRY"

Example Scripts for nctl

  • update-app.sh Updates a running app.
  • update-catalog-app.sh Updates a catalog app.
  • create-app.sh Creates a running app.
  • create-catalog-app.sh Create a catalog app.

Sample Jenkinsfiles

Jenkins Setup From Nirmata

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published