Skip to content
This repository has been archived by the owner on Jan 28, 2024. It is now read-only.

Commit

Permalink
Merge pull request #38 from douglascayers/master
Browse files Browse the repository at this point in the history
Update packaging commands per CLI v43
wadewegner authored Mar 8, 2019
2 parents 59d6b76 + af90ea9 commit 0d395e7
Showing 2 changed files with 25 additions and 17 deletions.
6 changes: 3 additions & 3 deletions bin/compile
Original file line number Diff line number Diff line change
@@ -152,15 +152,15 @@ then
then

# get package id
CMD="sfdx force:package2:list --json | jq '.result[] | select((.Name) == \"$SFDX_PACKAGE_NAME\")' | jq -r .Id"
CMD="sfdx force:package:list --json | jq '.result[] | select((.Name) == \"$SFDX_PACKAGE_NAME\")' | jq -r .Id"
debug "CMD: $CMD"
SFDX_PACKAGE_ID=$(eval $CMD)
debug "SFDX_PACKAGE_ID: $SFDX_PACKAGE_ID"

log "Creating new package version (this may take awhile) ..."

# create package version
CMD="sfdx force:package2:version:create -i $SFDX_PACKAGE_ID --wait 100 --json | jq -r .result.SubscriberPackageVersionId"
CMD="sfdx force:package:version:create --package $SFDX_PACKAGE_ID --wait 100 --installationkeybypass --json | jq -r .result.SubscriberPackageVersionId"
SFDX_PACKAGE_VERSION_ID=$(eval $CMD)
debug "SFDX_PACKAGE_VERSION_ID: $SFDX_PACKAGE_VERSION_ID"

@@ -270,4 +270,4 @@ cp $BP_DIR/lib/stdlib.sh $BUILD_DIR/"$vendorDir"/
# stage so that the release phase is faster?

header "DONE! Completed in $(($SECONDS - $START_TIME))s"
exit 0
exit 0
36 changes: 22 additions & 14 deletions lib/release.sh
Original file line number Diff line number Diff line change
@@ -82,7 +82,7 @@ if [ "$STAGE" == "" ]; then
invokeCmd "sfdx force:source:push -u $TARGET_SCRATCH_ORG_ALIAS"

# Show scratch org URL
if [ "$show_scratch_org_url" == "true" ]; then
if [ "$show_scratch_org_url" == "true" ]; then
if [ ! "$open_path" == "" ]; then
invokeCmd "sfdx force:org:open -r -p $open_path"
else
@@ -99,7 +99,7 @@ if [ ! "$STAGE" == "" ]; then

auth "$vendorDir/sfdxurl" "$SFDX_AUTH_URL" s "$TARGET_SCRATCH_ORG_ALIAS"

if [ "$SFDX_INSTALL_PACKAGE_VERSION" == "true" ]
if [ "$SFDX_INSTALL_PACKAGE_VERSION" == "true" ]
then

# Auth to Dev Hub
@@ -109,25 +109,19 @@ if [ ! "$STAGE" == "" ]; then
# run package install
if [ ! -f "$pkgVersionInstallScript" ];
then

# if target stage is production, release the package version
if [ "$STAGE" == "PROD" ]; then

# get package version id (05i)
CMD="sfdx force:package2:version:list --json | jq '.result[] | select((.SubscriberPackageVersionId) == \"$SFDX_PACKAGE_VERSION_ID\")' | jq -r .Id"
debug "CMD: $CMD"
SFDX_PACKAGE_ID=$(eval $CMD)
debug "SFDX_PACKAGE_ID: $SFDX_PACKAGE_ID"


log "Set package version as released ..."

invokeCmd "sfdx force:package2:version:update -i \"$SFDX_PACKAGE_ID\" --noprompt --setasreleased"
invokeCmd "sfdx force:package:version:promote --package \"$SFDX_PACKAGE_VERSION_ID\" --noprompt"

fi

fi

log "Installing package version $SFDX_PACKAGE_NAME ..."

invokeCmd "sfdx force:package:install --noprompt -i \"$SFDX_PACKAGE_VERSION_ID\" -u \"$TARGET_SCRATCH_ORG_ALIAS\" --wait 1000 --publishwait 1000"
invokeCmd "sfdx force:package:install --noprompt --package \"$SFDX_PACKAGE_VERSION_ID\" -u \"$TARGET_SCRATCH_ORG_ALIAS\" --wait 1000 --publishwait 1000"

else

@@ -164,6 +158,20 @@ if [ ! "$STAGE" == "" ]; then

fi

if [ "$run_apex_tests" == "true" ];
then

log "Running apex tests (this may take awhile) ..."

CMD="sfdx force:apex:test:run --resultformat human --codecoverage -u $TARGET_SCRATCH_ORG_ALIAS --wait 1000 --json | jq -r .result.summary.testRunId"
debug "CMD: $CMD"
SFDX_TEST_RUN_ID=$(eval $CMD)
debug "SFDX_TEST_RUN_ID: $SFDX_TEST_RUN_ID"

invokeCmd "sfdx force:apex:test:report --testrunid $SFDX_TEST_RUN_ID --resultformat human --codecoverage -u $TARGET_SCRATCH_ORG_ALIAS --wait 1000 --verbose"

fi

fi

postSetupScript=bin/post-setup.sh

0 comments on commit 0d395e7

Please sign in to comment.