Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom steps / logic prior to publish #212

Open
eddiewebb opened this issue Jun 12, 2023 · 1 comment
Open

Allow custom steps / logic prior to publish #212

eddiewebb opened this issue Jun 12, 2023 · 1 comment
Assignees

Comments

@eddiewebb
Copy link
Contributor

Describe Request:

Customer is publishing single orb to many organizations and using matrix to call publish job.

They thought about using pre-steps to run some envsubt on the yaml before publishing, but since pre-steps run before workspace from prior job is attached, there is nothing to work on. Pre-step does not support special copmmands like attach_workspace so I am suggesting a parameter to publish job that is of steps type to run after checkout (#211 )/attach worksapce but before publish step.

- existing checkout or attach steps run
- custom steps parameter steps are executed
- existing publish is executed

Examples:

workflows:
  lint-pack:
    jobs:
      ...
      - orb-tools/publish:.
          matrix:
            parameters:
              org_name:
                - "org_1/resource_class"
                - "org_2/resource_class"
                - "org_3/resource_class"
              context:  [ orb-publishing ]
              pre_publish_steps:
                 - export ORG_NAME=<<matrix.org_name>>
                 - envsubst '$ORG_NAME' < ${ORB_DIR}/${ORB_FILE} > ${ORB_DIR}/${ORB_FILE}

Supporting Documentation Links:

@KyleTryon KyleTryon self-assigned this Jul 20, 2023
@Peter-Darton-i2
Copy link

https://circleci.com/developer/orbs/orb/circleci/orb-tools?version=12.0.0#jobs-publish onwards support a attach_workspace boolean parameter which would allow someone to set it false and then put their logic into a pre-steps block.
e.g. have a pre-steps block that does everything that the publish job normally does when attach_workspace is true and then carry out the customer-specific logic.

(Weirdly, the job also supports a checkout boolean that's declared and never used ... but that's already been reported in #211)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants