Skip to content

A Sample Laravel Application that Integrates with Codeship's CI service

Notifications You must be signed in to change notification settings

hiimtaylorjones/codeship-laravel

Repository files navigation

Codeship Pro PHP Laravel Example

Codeship Status for hiimtaylorjones/codeship-laravel

Overview

The following repository is a todo API example developed with PHP and the Laravel framework.

This repo serves two main goals:

  1. Example application using Codeship Basic
  2. A Todo Backend community project.

The following README is a guide to build and deploy with Codeship Pro You will also be able to run this project locally, and use it as a starter app for PHP-Laravel Docker projects.

Be sure to star/watch this repo to stay up-to-date with any changes. If you have any questions or suggestions regarding this example , please submit an issue here.

Getting Started

There are a few resources to make sure you have available during this guide.

  1. A local instance of Docker Community Edition
  2. A Codeship. Account
  3. A Laravel Forge Account - requires subscription
  4. A DigitalOcean or Amazon Web Services Account
  5. Some sort of source control hosting code account ( GitHub , Bitbucket , GitLab )
  6. A local download of our application found here
  7. A hosted (forked) instance of this application on the source control hosting account of your choice.

Continuous Integration with Codeship

Continuous Integration requires developers to integrate code to a repository that is then verified by an automated build.

This project uses PHPunit integration testing of the todo api. Every commit into the shared repo will be tested to verify the code is working correctly before allowing it to be merged.

In this section, you will set up your repository, create a Codeship project, and test the build locally using Jet CLI.

Fork repo

Using the account you set up in the Getting Started section, you will now create your own repository to connect to Codeship.

Since this repository is on Github, you can fork this repo and move on to the next step. If you are using Bitbucket/Gitlab, you will need to perform a few additional steps.

  1. Create a new repository
  2. Bitbucket
  3. Gitlab
  4. Download this repo's source zip file
  5. Extract the zip, and navigate to the source code folder.
  6. Use the following terminal commands (assuming you are using Git)
git init
git remote add origin REPOSITORY_CLONE_URL
git add .
git commit
git push -u origin master

Make sure to copy the 'Repository Clone URL' link for the next step, you will use it to set up the project in Codeship.

You now should have a remote repository that is publicly accessible in your account.

Create project in Codeship

Now that your repository is setup, the next step is to create the project in Codeship, so when you push to the remote, tests will run automatically, making continuous integration easy.

  1. Login to Codeship (if not already)
  2. Navigate to Projects screen, then click the New Project button
  • You should now be in the project setup screen
  1. Connect Your SCM: Select the source code management (SCM) tool you set up in the previous step.
  • if you originally signed up with an SCM different than above, we will connect to the service during this step
  1. Choose Your Repository: Copy/Paste the Repository Clone URL link from previous step
  2. Click the Connect button
  3. Configure Project: Click the Select Basic Project button
  • The setup instructions displayed can be ignored for now, but will be here to remind you in the future

Your project is set up at this time, and any code commited and pushed to the repository will now run builds automatically, based on our current setup.

Note: The current setup will attempt to deploy on master, which will fail until we set these up. We will test the build locally without the deployment first.

If you run into trouble at any point, please submit an issue here.

About

A Sample Laravel Application that Integrates with Codeship's CI service

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages