Adding your GitHub or Bitbucket project to Semaphore
Setting up continuous integration for a project hosted on GitHub or Bitbucket and running your first build on Semaphore is easy and takes only a few clicks.
If you don’t already have a Semaphore account, sign up and confirm your email address. The free account gives you unlimited CI service for open-source projects and up to 100 private builds per month.
After you have signed in on Semaphore for the first time, a welcome screen will prompt you to add your first project. Click on the “Build a New Project” button to get started. If you have already added some projects on Semaphore, use the “Add new project” link at the top of your dashboard.
The next step is to connect your Semaphore account with your GitHub and/or Bitbucket account. This will allow Semaphore to do things like present you a list of projects to choose from, fetch the chosen Git repositories, and update pull request status. Select your preferred Git host.
We will now assume that you chose GitHub. On the next screen, select whether you would like to give Semaphore access to your public (open-source) or private projects. Access to private projects also includes access to public projects.
If you are using Bitbucket, this step does not exist because Bitbucket only supports giving access to both private and public repositories. The rest of the procedure is the same as with GitHub.
At this point, Semaphore will redirect you to github.com or bitbucket.com, where you will be presented a screen to authorize Semaphore to access your account via OAuth. Click “Authorize application” to continue.
Once you have confirmed permission access, Semaphore will present you with a list of your repositories. If the list is very long, you can use the search box located at the top to narrow it down.
A note for Bitbucket users: in order to add a repository, a user has to either be its creator or belong to a Bitbucket group that has admin rights to it.
Select the branch you would like your first build to run from. Semaphore will automatically test every new branch you create, and remove the ones you delete in origin. Additional preexisting branches can be easily added from your project page later on.
Select the account which you would like to own this project. Besides your personal account, any organizations where you have admin or owner access will be listed here as well. For example, if you are adding a project that should be billed to your company, you can add that project to your company’s organization.
Next, Semaphore will perform a quick analysis of the source code and generate a set of working build commands depending on your project’s programming language.
In this case, we have a Ruby on Rails application for which we would like to run
bundle exec rake cucumber in a second, parallel job. That’s why we’ll add
a new parallel job and drag and drop
bundle exec rake cucumber command to
the new job.
If your project needs to run commands that are different from what Semaphore has suggested, just use the commands editor to customize them to your needs.
At this point, you’ll be ready to launch your first build. Click on “Build With These Settings” to do so. If all goes well, you should see your first successful build on Semaphore.
For more build customization options, please refer to our “Customizing your build” documentation section. Happy building!