This repository shows one way you can successfully setup Salesforce DX (Pilot) with Travis CI. I'm going to make a few assumptions in this README:
- You are currently a part of the Salesforce DX Pilot. If you're not, you can join the waitlist.
- You know how to get your Github repository setup with Travis CI. (Here's their Getting Started guide.)
- You've installed the Travis CLI.
- You have properly setup JWT-Based Authorization Flow (i.e. headless). I recommend using these steps for generating your Self-Signed SSL Certificate.
If any any of these assumptions aren't true, the following steps won't work.
-
Make sure you have the Salesforce DX CLI installed. Check by running
sfdx force --help
and confirm you see the command output. -
Confirm you can perform a JWT-based auth:
sfdx force:auth:jwt:grant --clientid <your_consumer_key> --jwtkeyfile server.key --username <your_username> --setdefaultdevhubusername
-
Create a Github repo called
sfdx-travisci
. -
Create a new SFDX workspace:
sfdx force:workspace:create -n sfdx-travisci
-
In the newly created directory, initialize git:
git init
-
Add your Github repo as a remote:
git remote add origin git@github.com:wadewegner/sfdx-travisci.git
-
Set your
Consumer Key
andUsername
using the Travis CLI.travis env set CONSUMERKEY <your_consumer_key> travis env set USERNAME <your_username>
-
Create a folder called
assets
and add yourserver.key
to the folder. -
Encrypt your
server.key
value:travis encrypt-file assets/server.key assets/server.key.enc
-
Remove your
server.key
:rm assets/server.key
-
Create a
.travis.yml
file:touch .travis.yml
-
Update the
.travis.yml
similar to the one in this repo, replacing with your own values.
And you should be ready to go! Now when you commit and push a change, your change will kick off a Travis CI build.
Enjoy!
If you find any issues or opportunities for improving this respository, fix them! Feel free to contribute to this project by forking this repository and make changes to the content. Once you've made your changes, share them back with the community by sending a pull request. Please see How to send pull requests for more information about contributing to Github projects.
If you find any issues with this demo that you can't fix, feel free to report them in the issues section of this repository.