Skip to content

cloudbees-io/kubernetes-create-resource

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

CloudBees action: Create or update a Kubernetes resource file

Use this action to create or update a Kubernetes resource file, which groups multiple resources for your application into a single YAML file.

Inputs

Table 1. Input details
Input name Data type Required? Description

file-path

String

Yes

The path of the Kubernetes resource file to be created/updated.

environment-variables

JSON string

Required only if environment-variables-path is not specified.

Kubernetes environment variables, formatted as JSON data in key/value pairs.

environment-variables-path

String

Required only if environment-variables is not specified.

The path of the file containing the environment variables.

namespace

String

No

The namespace where the created/updated Kubernetes resource file is located.

Usage example

In your YAML file, add:

      - name: Create or update a Kubernetes resource
        uses: cloudbees-io/kubernetes-create-resource@v1
        with:
          file-path: ${{ cloudbees.workspace }}/input.yml
          environment-variables: '{"IMAGE_NAME":"nginx:latest","CUSTOM_VALUE":"alpine:latest","port":"80"}'
          environment-variables-path: ${{ cloudbees.workspace }}/sample.json
          namespace: my-namespace

License

This code is made available under the MIT license.

References