Skip to main content

Calling a Private Orb from a Private Orb

Calling a Private Orb from another Private Orb

As long as the private orbs are under the same namespace and organization, then it is possible to call a private orb from a private orb. An example of this can be found below:

In our first Private Orb, we have the following:

version: 2.1
description: A greeting command orb
commands:
  greet:
    description: command from orb 1.
      steps:
        - run: echo "Hello, this is defined in orb 1"

In the second Private Orb, which we will use to call the first Private Orb, we have the following:

version: 2.1
orbs:
  private-orb-1: orgname/[email protected]
description: A greeting command orb 2
  commands:
    greet-2:
      description: runs greet command from private orb 1
      steps:
        - private-orb-1/greet

Now that we have the commands in our 2 Orbs established, we can now call greet-2 in our config file and see that it runs the command from our first orb, `private-orb-1`.

version: 2.1orbs:
  private-orb-2: orgname/[email protected]:
  build:
    docker:
      - image: cimg/base:stable
    steps:
      - private-orb-2/greet-2workflows:
  workflow1:
    jobs:
      - build

When we run the job, we can see that the command from the first Orb ran when we called the command of the second Orb:

Did this answer your question?