Replies: 3 comments 2 replies
-
For an example of what this could eliminate from each build script...
https://github.com/trailheadapps/dreamhouse-lwc/blob/main/.github/workflows/packaging-pr.yml#L31-L48 |
Beta Was this translation helpful? Give feedback.
1 reply
-
cool! |
Beta Was this translation helpful? Give feedback.
0 replies
-
Any standards for scripts? Should I use TS or bash? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The SF CLI Docker image would be more immediately useful in CI/CD builds and devcontainers if it supported handling authentication to orgs via passed env vars.
Almost every example GitHub Actions build I've seen starts off by writing the sfdx auth url to a file, then calling sf to authenticate, then hopefully deleting that file. That's redundant logic in every build.
I've done something similar to what I'm proposing with the open source D2X Docker image I'm building on top of the SF CLI Docker image to include CumulusCI. Here's the script I include in that image to handle authenticating a
DEV_HUB
,PACKAGING_ORG
, andTARGET_ORG
via sfdx auth url or JWT (I'm not certain the JWT is functional):https://github.com/muselab-d2x/d2x/blob/cumulusci-next/devhub.sh
I'm not proposing raw inclusion of that script. I'd like to have a discussion to figure out what approach would be the best for the SF CLI docker image. The script was mostly a functional hack and could definitely use improvement or complete rewrite, potentially in TS?
I propose three org types that can be passed in:
DEV_HUB
: Set as the default devhub. Used for scratch org interactions. Ideally restricted only to scratch orgs and not packagingPACKAGING_ORG
: For packaging operations, either the 1GP packaging org or credentials with packaging permissions to the devhub. For 2GP promotion, credential must have promotion permissionsTARGET_ORG
: Any other org that is being targeted in the buildWith this setup, it's much easier to build more concise reusable workflows that focus on the pipeline's logic rather than plumbing. It's also completely optional, you just call the script from your build.
Here's an example GitHub Actions workflow using the script and passing the env vars:
I'm happy to work on this contribution. I'd love to get some guidance on the standards for such a script to be included in the Docker image.
Beta Was this translation helpful? Give feedback.
All reactions