Alex Flint
Alex Flint

Reputation: 6748

trigger concourse job via CLI: "resource not found"

I am attempting to trigger a concourse job from the command line. My pipeline has one resource (a git repo) and one job, which uses that repo. I am seeing:

$ fly -t tutorial trigger-job -j my-pipeline/my-job -w
error: resource not found

However, when I go the web UI and manually trigger the job by pressing the "+" button in the top right, it works fine.

Here is the full pipeline:

resources:
- name: cruise-source
  type: git
  source:
    uri: [email protected]:my-org/cruise.git
    branch: develop

jobs:
- name: build-image
  public: true
  plan:
  - get: cruise-source
  - task: list-files
    config:
      platform: linux
      image_resource:
        type: docker-image
        source: {repository: alpine}
      inputs:
      - name: cruise-source
      run:
        path: ls
        args: [cruise-source]

How can I trigger this job from the CLI?

Upvotes: 0

Views: 2540

Answers (1)

marco.m
marco.m

Reputation: 4859

The "resource not found" you get has nothing to do with the git resource :-) it actually means that the pipeline or job name is wrong. Looking at your pipeline configuration, you should issue

fly -t tutorial trigger-job -j my-pipeline/build-image -w

or if your configuration is different from what you have posted, maybe you have a typo in the name of the pipeline or job.

Upvotes: 1

Related Questions