Introduction
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.
Prerequisites
For this tutorial, you must have:
Tutorial
GitHub repository
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 master
.
For more information on Travis CI configuration, see the Travis CI documentation.
Connect Travis CI
-
Go to Travis-ci.com and Sign up with GitHub.
-
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.
- Enter
TD_API_KEY
into the “Name” field and your TD api key in the “Value” field. - Click “Save variables”.
Start Deploying
- 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.
Comments
0 comments
Please sign in to leave a comment.