Git Product home page Git Product logo

jx-promote's Introduction

jx-promote

Documentation Go Report Card Releases LICENSE Slack Status

jx promote is a binary plugin to promote applications to one or more Jenkins X environments

Getting Started

Download the jx-promote binary for your operating system and add it to your $PATH.

Commands

See the jx-promote command reference

Promoting via the command line

Just run the jx promote command line and follow the instructions as if it were jx promote.

Rules

jx promote supports a number of different rules for promoting new versions of applications for various kinds of deployment tools.

Helm

The helm rule uses a helm chart's requirements.yaml file to manage dependent applications. This is the default source layout of a Jenkins X Staging or Production repository; there is usually a helm chart in the env folder and jx-promote will create a Pull Request adding or updating the applications version in env/requirements.yaml.

jx promote will detect the env/requirements.yaml file automatically without any explict configuration.

You can explicitly configure the helm rule by specifying the helmRule property on the spec of the .jx/promote.yaml configuration file like this one:

apiVersion: promote.jenkins-x.io/v1alpha1
kind: Promote
spec:
  helmRule:
    path: env

Apps

The apps rule uses a jx-apps.yml file to describe the charts to deploy in your environments git repository.

jx promote will detect the jx-apps.yml file in the root directory automatically without any explicit configuration.

You can explicitly configure the apps rule by creating a .jx/promote.yaml configuration file and specifying the appsRule like in this one

apiVersion: promote.jenkins-x.io/v1alpha1
kind: Promote
spec:
  appsRule:
    path: jx-apps.yml

Helmfile

The helmfile rule uses a helmfile.yaml file from helmfile to configure the helm charts to deploy to your environment.

jx promote will detect the helmfile.yaml file in the root directory automatically without any explicit configuration.

You can explicitly configure the helmfile rule by creating a .jx/promote.yaml configuration file and specifying the helmfile rule like this one:

apiVersion: promote.jenkins-x.io/v1alpha1
kind: Promote
spec:
  helmfileRule:
    path: helmfile.yaml

File

The file rule can modify arbitrary files such as Makefile or shell scripts to include a promotion command using tools like helm or kpt

To enable the file mode you need to create a .jx/promote.yaml configuration file and specifying the file rule.

For example to promote into a Makefile using helm template you could create a file like this one:

apiVersion: promote.jenkins-x.io/v1alpha1
kind: Promote
spec:
  fileRule:
    path: Makefile
    linePrefix: "\t"
    insertAfter:
    - prefix: "helm template"
    - prefix: "fetch:"
    updateTemplate:
      regex: "helm template --namespace {{.Namespace}} --version .* {{.AppName}} .*"
    commandTemplate: "helm template --namespace {{.Namespace}} --version {{.Version}} {{.AppName}} dev/{{.AppName}}"

Or to use kpt to promote you could use this one:

apiVersion: promote.jenkins-x.io/v1alpha1
kind: Promote
spec:
  fileRule:
    path: Makefile
    linePrefix: "\t"
    insertAfter:
    - prefix: "kpt pkg get"
    - prefix: "fetch:"
    updateTemplate:
      prefix: "kpt pkg get {{.GitURL}}"
    commandTemplate: "kpt pkg get {{.GitURL}}/kubernetes@v{{.Version}} $(FETCH_DIR)/namespaces/jx"

if you are using a script to in your environment git repository you could use a configuration like this one:

apiVersion: promote.jenkins-x.io/v1alpha1
kind: Promote
spec:
  fileRule:
    path: myscript.sh
    insertAfter:
    - prefix: "kpt pkg get"
    - prefix: "# fetch resources"
    updateTemplate:
      prefix: "kpt pkg get {{.GitURL}}"
    commandTemplate: "kpt pkg get {{.GitURL}}/kubernetes@v{{.Version}} $(FETCH_DIR)/namespaces/jx"

Rule Configuration

jx promote can automatically detect common configurations as described above or you can explicilty configure the promotion rule in your environment git repository by creating a .jx/promote.yaml configuration file.

For example if you wish to configure the helm rule you may want to use a .jx/promote.yaml file like this one:

apiVersion: promote.jenkins-x.io/v1alpha1
kind: Promote
spec:
  helmRule:
    path: env

jx-promote's People

Contributors

jstrachan avatar jenkins-x-bot-test avatar pow-devops2020 avatar jenkins-x-bot avatar rawlingsj avatar msvticket avatar ankitm123 avatar tomhobson avatar cameronbraid avatar gazal-k avatar hrvolapeter avatar dependabot-preview[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.