An open API service indexing awesome lists of open source software.

https://github.com/clarketm/pj

Command line tool for working with ProwJobs (PJ)
https://github.com/clarketm/pj

cli kubernetes prow prowjob

Last synced: about 1 month ago
JSON representation

Command line tool for working with ProwJobs (PJ)

Awesome Lists containing this project

README

          

# pj

pj is a command line tool for managing ProwJobs (PJs).

## Installing

Install using [gobin](https://github.com/myitcv/gobin):

```shell
gobin github.com/clarketm/pj
```

## Usage

```shell
pj --help
```

```console
ProwJob job manager

Usage:
pj [flags]
pj [command]

Available Commands:
create Create ProwJob yaml configuration
help Help about any command

Flags:
--config string Config file (default is $HOME/.pj.yaml).
-h, --help help for pj
-v, --verbose Enable verbose output.
--version Version number.

Use "pj [command] --help" for more information about a command.
```

### Commands

#### `create`

Create ProwJob yaml configuration.

##### `-g, --global `

Global configuration files containing *default* values inherited by all jobs.

```yaml
# All valid `metav1.ObjectMeta`, `corev1.Container`, and `corev1.PodSpec` fields are accepted.
labels: {app.kubernetes.io/part-of: prow}
namespace: test-pods
resources: {requests: {cpu: 1}, limits: {cpu: 3}}
aliases: {istio: istio.io}
clusterName: default

# Requirements are a `map[string]Job` that a job can `require` as part of its definition.
requirements:
gcp:
labels:
preset-service-account: "true"
root:
securityContext:
privileged: true
```

##### `-i, --input `

Job configuration files with *optional* file-level *defaults*.

```yaml
# Local defaults inherited by all the below jobs.
repo: istio/istio
nodeSelector: {testing: test-pool}
clone_tmpl: "https://github.com/{{.Org}}/{{.Repo}}.git"
output_tmpl: "{{.Org}}/{{.Repo}}/{{.Org}}.{{.Repo}}.gen"

jobs:
- name: job_1
types: [presubmit]
require: [gcp] # a corresponding `requirements` item must exist.
labels: {app.kubernetes.io/version: 1.0.0}
branches: [master]
image: alpine:latest
command: [echo, test1]
extra_repos: [istio/test-infra@master]
```

##### `-o, --ouput `

Output directory to write jobs to. Subdirectory structure is determined by the `output_tmpl` field.