From e3240da4dcdb865e12ce6a722a312e174584cd5e Mon Sep 17 00:00:00 2001 From: Wade Wegner Date: Mon, 19 Mar 2018 20:02:44 -0700 Subject: [PATCH] Updated for buildpack move to github.com/heroku --- README.md | 2 +- app.json | 4 ++-- destroy1521514727.sh | 5 +++++ setup.sh | 25 +++++++++++++++---------- 4 files changed, 23 insertions(+), 13 deletions(-) create mode 100755 destroy1521514727.sh diff --git a/README.md b/README.md index 5ee3e09..1913ee6 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ This sample uses unlocked second generation packages (2GPs) to deploy project updates. If you're looking to perform metadata deploys instead, please use [https://github.com/wadewegner/salesforce-dx-pipeline-mdapi-sample](https://github.com/wadewegner/salesforce-dx-pipeline-mdapi-sample). -Using this sample app and the resources in this repo, you can setup a Heroku Pipeline to drive CI / CD for Salesforce DX. This sample uses the [salesforce-dx-buildpack](https://github.com/wadewegner/salesforce-dx-buildpack) and the [salesforce-cli-buildpack](https://github.com/wadewegner/salesforce-cli-buildpack). +Using this sample app and the resources in this repo, you can setup a Heroku Pipeline to drive CI / CD for Salesforce DX. This sample uses the [salesforce-dx-buildpack](https://github.com/heroku/salesforce-buildpack) and the [salesforce-cli-buildpack](https://github.com/heroku/salesforce-cli-buildpack). ![image](https://user-images.githubusercontent.com/746259/36068129-5c8a19b2-0e82-11e8-96b5-a9fed295a33d.png) diff --git a/app.json b/app.json index ceaa244..1852172 100644 --- a/app.json +++ b/app.json @@ -14,10 +14,10 @@ "devDependencies": {}, "buildpacks": [ { - "url": "https://github.com/wadewegner/salesforce-cli-buildpack" + "url": "https://github.com/heroku/salesforce-cli-buildpack" }, { - "url": "https://github.com/wadewegner/salesforce-dx-buildpack#develop" + "url": "https://github.com/heroku/salesforce-buildpack#develop" } ], "env": { diff --git a/destroy1521514727.sh b/destroy1521514727.sh new file mode 100755 index 0000000..179fd93 --- /dev/null +++ b/destroy1521514727.sh @@ -0,0 +1,5 @@ +heroku pipelines:destroy pipeline1521514727 +heroku apps:destroy -a dev1521514727 -c dev1521514727 +heroku apps:destroy -a staging1521514727 -c staging1521514727 +heroku apps:destroy -a prod1521514727 -c prod1521514727 +rm -- "destroy1521514727.sh" diff --git a/setup.sh b/setup.sh index dc17381..61748a2 100755 --- a/setup.sh +++ b/setup.sh @@ -51,12 +51,15 @@ fi echo "heroku pipelines:destroy $HEROKU_PIPELINE_NAME heroku apps:destroy -a $HEROKU_DEV_APP_NAME -c $HEROKU_DEV_APP_NAME heroku apps:destroy -a $HEROKU_STAGING_APP_NAME -c $HEROKU_STAGING_APP_NAME -heroku apps:destroy -a $HEROKU_PROD_APP_NAME -c $HEROKU_PROD_APP_NAME" > destroy.sh +heroku apps:destroy -a $HEROKU_PROD_APP_NAME -c $HEROKU_PROD_APP_NAME +rm -- \"destroy$TICKS.sh\"" > destroy$TICKS.sh echo "" -echo "Run ./destroy.sh to remove resources" +echo "Run ./destroy$TICKS.sh to remove resources" echo "" +chmod +x "destroy$TICKS.sh" + # Create three Heroku apps to map to orgs heroku apps:create $HEROKU_DEV_APP_NAME $HEROKU_TEAM_FLAG heroku apps:create $HEROKU_STAGING_APP_NAME $HEROKU_TEAM_FLAG @@ -101,21 +104,23 @@ stagingSfdxAuthUrl=$(sfdx force:org:display --verbose -u $PROD_USERNAME --json | heroku config:set SFDX_AUTH_URL=$stagingSfdxAuthUrl -a $HEROKU_PROD_APP_NAME # Add buildpacks to apps -heroku buildpacks:add -i 1 https://github.com/wadewegner/salesforce-cli-buildpack -a $HEROKU_DEV_APP_NAME -heroku buildpacks:add -i 1 https://github.com/wadewegner/salesforce-cli-buildpack -a $HEROKU_STAGING_APP_NAME -heroku buildpacks:add -i 1 https://github.com/wadewegner/salesforce-cli-buildpack -a $HEROKU_PROD_APP_NAME +heroku buildpacks:add -i 1 https://github.com/heroku/salesforce-cli-buildpack -a $HEROKU_DEV_APP_NAME +heroku buildpacks:add -i 1 https://github.com/heroku/salesforce-cli-buildpack -a $HEROKU_STAGING_APP_NAME +heroku buildpacks:add -i 1 https://github.com/heroku/salesforce-cli-buildpack -a $HEROKU_PROD_APP_NAME -heroku buildpacks:add -i 2 https://github.com/wadewegner/salesforce-dx-buildpack#develop -a $HEROKU_DEV_APP_NAME -heroku buildpacks:add -i 2 https://github.com/wadewegner/salesforce-dx-buildpack#develop -a $HEROKU_STAGING_APP_NAME -heroku buildpacks:add -i 2 https://github.com/wadewegner/salesforce-dx-buildpack#develop -a $HEROKU_PROD_APP_NAME +heroku buildpacks:add -i 2 https://github.com/heroku/salesforce-buildpack -a $HEROKU_DEV_APP_NAME +heroku buildpacks:add -i 2 https://github.com/heroku/salesforce-buildpack -a $HEROKU_STAGING_APP_NAME +heroku buildpacks:add -i 2 https://github.com/heroku/salesforce-buildpack -a $HEROKU_PROD_APP_NAME # Create Pipeline # Valid stages: "test", "review", "development", "staging", "production" heroku pipelines:create $HEROKU_PIPELINE_NAME -a $HEROKU_DEV_APP_NAME -s development $HEROKU_TEAM_FLAG heroku pipelines:add $HEROKU_PIPELINE_NAME -a $HEROKU_STAGING_APP_NAME -s staging heroku pipelines:add $HEROKU_PIPELINE_NAME -a $HEROKU_PROD_APP_NAME -s production -# bug: https://github.com/heroku/heroku-pipelines/issues/80 -# heroku pipelines:setup $HEROKU_PIPELINE_NAME $GITHUB_REPO -y $HEROKU_TEAM_FLAG + +# Setup your pipeline +heroku pipelines:connect $HEROKU_PIPELINE_NAME --repo $GITHUB_REPO +heroku reviewapps:enable -p $HEROKU_PIPELINE_NAME -a $HEROKU_DEV_APP_NAME --autodeploy --autodestroy heroku ci:config:set -p $HEROKU_PIPELINE_NAME SFDX_DEV_HUB_AUTH_URL=$devHubSfdxAuthUrl heroku ci:config:set -p $HEROKU_PIPELINE_NAME SFDX_AUTH_URL=$devSfdxAuthUrl