TD Workflows can be used with version control tools like Git and continuous integration tools such as Travis CI. In this tutorial, we’ll go through how to set up a Continuous Deployment pipeline using GitHub and Travis CI.
This tutorial assumes that you’re already somewhat familiar with TD Workflows. If not, review the Workflows Introductory tutorial.
For this tutorial, you must have:
If you have not already done so, create a git repository on GitHub with your workflow project. For more information on how to use Git and GitHub, see the GitHub Bootcamp.
Configure Travis CI
Add a Travis CI configuration file to the project. The file should be named
.travis.yml, be in the top directory of the project, and have the following contents. Then commit and push to GitHub.
Note that the above configuration specifies that Travis CI should deploy changes on the
master branch only. This ensures that changes on other branches and pull requests are not deployed until they are merged to
For more information on Travis CI configuration, see the Travis CI documentation.
Connect Travis CI
Accept the Authorization of Travis CI. You’ll be redirected to GitHub.
Click the green Activate button, and select the repositories you want to use with Travis CI.
Configure TD Credentials.
For workflows to be pushed to Arm Treasure Data, you must configure a TD API Key for the project. You can read more about out how to set you TD API key in Travis CI here.
To define variables within your Travis CI project: From the Repository Settings, make sure you’re logged in, navigate to the repository in question, choose “Settings” from the cog menu, and click on “Add new variable” in the “Environment Variables” section.
- Open the Travis CI dashboard again and locate the workflow repository.
- Click the workflow project and then “Repository Settings” in the upper right corner. (You might need to click the downfacing arrow and select settings.
- Click “Environment Variables” under “Build Settings” on the left hand side.
TD_API_KEYinto the “Name” field and your TD api key in the “Value” field.
- Click “Save variables”.
- Open the Travis CI dashboard again and click the failed workflow project build.
TravisCI should now successfully push your workflow to Treasure Data and executes as a workflow every time you push a change to GitHub.