{"id":33654,"date":"2017-12-28T11:08:32","date_gmt":"2017-12-28T17:08:32","guid":{"rendered":"https:\/\/wpengine.com\/?post_type=support&#038;p=33654"},"modified":"2025-07-28T11:05:22","modified_gmt":"2025-07-28T17:05:22","slug":"continuous-integration-codeship-wp-engine","status":"publish","type":"support","link":"https:\/\/wpengine.com\/support\/continuous-integration-codeship-wp-engine\/","title":{"rendered":"Continuous Integration with CodeShip"},"content":{"rendered":"\n<p><span style=\"font-weight: 400\">If you work with a team of developers, chances are you want to use Continuous Integration (CI) and\/or Continuous Deployment (CD) tools. These tools allow multiple developers to check out the code they wish to edit, make changes, merge it back into a common repository, and automate tests against the changes. Additionally, some CI\/CD tools also allow for automated deployments when tests are successful, or at predetermined intervals. In this article we explain how to set up a CI\/CD pipeline using CodeShip and WP Engine. In this scenario, developers deploy changes to GitHub, Bitbucket, or GitLab. CodeShip detects the change, runs any automated tests or build scripts, and deploys to WP Engine using <\/span><a href=\"https:\/\/wpengine.com\/git\/\"><span style=\"font-weight: 400\">git push<\/span><\/a><span style=\"font-weight: 400\">.<\/span><\/p>\n\n\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Getting Started<\/h2>\n\n\n\n<p><span style=\"font-weight: 400\">Before getting started with your CI\/CD pipeline on CodeShip, this guide assumes you have: an existing GitHub, GitLab, or Bitbucket account for your team, an existing WP Engine account and site, and a CodeShip account (either Basic or Pro will work). Once you&#8217;ve ensured you have these requirements, you can follow these steps to set up your pipeline:<\/span><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><span style=\"font-weight: 400\">Sign into <\/span><a href=\"http:\/\/codeship.com\/\" target=\"_blank\" rel=\"noreferrer noopener\"><span style=\"font-weight: 400\">codeship.com<\/span><\/a><\/li>\n\n\n\n<li><span style=\"font-weight: 400\">Add a new Project and select your <em><strong>SCM<\/strong><\/em>. This is your Git source (GitHub, GitLab, Bitbucket)<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400\">Authorize your SCM account to connect with CodeShip.<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400\">Select the repository you would like to use for this project from the list<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400\">Under Project Settings, copy your <\/span><a href=\"https:\/\/documentation.codeship.com\/general\/projects\/project-ssh-key\/\" target=\"_blank\" rel=\"noreferrer noopener\"><span style=\"font-weight: 400\">Project SSH Key<\/span><\/a><span style=\"font-weight: 400\"> and <\/span><a href=\"https:\/\/wpengine.com\/support\/git\/#Add_SSH_Key_to_User_Portal\" target=\"_blank\" rel=\"noreferrer noopener\"><span style=\"font-weight: 400\">add the key<\/span><\/a><span style=\"font-weight: 400\"> in your User Portal. Give it a name (<em><strong>Codeship-yourname<\/strong><\/em> for example) and click <em><strong>Add Developer<\/strong><\/em>.&nbsp;<img loading=\"lazy\" decoding=\"async\" width=\"407\" height=\"327\" class=\"alignnone  wp-image-33656\" src=\"https:\/\/wpengine.com\/wp-content\/uploads\/2017\/12\/git_push_user-1024x823.png\" alt=\"\"><\/span>\n<ul class=\"wp-block-list\">\n<li><b><i>Remember:<\/i><\/b><span style=\"font-weight: 400\"> Allow 10-15 minutes for your git key to be registered fully<\/span> <\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><span style=\"font-weight: 400\">Your project will have two branches which should each have a deployment pipeline: <strong><em>develop<\/em><\/strong> and <em><strong>main<\/strong><\/em>. In this setup, your staging remote can be used for the <em><strong>develop<\/strong><\/em> branch, and production for <em><strong>main<\/strong><\/em> if you choose. <\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400\">Last, add automation by adding in a Deployment pipeline for develop and main. Choose a <\/span><a href=\"https:\/\/documentation.codeship.com\/basic\/continuous-deployment\/deployment-with-custom-scripts\/\" target=\"_blank\" rel=\"noreferrer noopener\"><span style=\"font-weight: 400\">custom script<\/span><\/a><span style=\"font-weight: 400\">, and paste the following (change out the environment name on the main branch):<\/span><\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code line-numbers\"><code># deployment pipeline commands\ngit config --global user.name \"CodeShip deployment\"\ngit config --global user.email \"myemail@gmail.com\"\ngit remote add staging git@git.wpengine.com:<strong>mystagingenvironment<\/strong>.git\ngit push staging HEAD:main<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><span style=\"font-weight: 400\">Optionally, you can also add any automated tests or <\/span><a href=\"https:\/\/documentation.codeship.com\/basic\/languages-frameworks\/nodejs\/\" target=\"_blank\" rel=\"noreferrer noopener\"><span style=\"font-weight: 400\">build scripts<\/span><\/a><span style=\"font-weight: 400\"> to your CodeShip project. These scripts should be run on the CodeShip servers as a general best practice.<\/span><\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Test Setup<\/h2>\n\n\n\n<p><span style=\"font-weight: 400\">Once you have connected the pieces of your pipeline, you can test your setup. To test the automation, make a small change (a space or comment will work) in your local repository and push it to your connected Git source (SCM). From this point, the CodeShip automation should pick up the change and automatically deploy to WP Engine. You can check to see the file change using <\/span><a href=\"https:\/\/wpengine.com\/support\/sftp\/\"><span style=\"font-weight: 400\">SFTP<\/span><\/a><span style=\"font-weight: 400\"> if needed. <\/span><\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Caveats<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><span style=\"font-weight: 400\">If you have added or removed files on your site via SFTP and not through your SCM, these changes are not automatically synced to your remote repository. In cases where files need to be deleted, you should remove them via SFTP and then git push with the <em><strong>&#8211;force<\/strong><\/em> flag.<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400\">If you are versioning files which have to be built (processed and\/or compressed) such as CSS or JS, the <\/span><em><strong><a href=\"https:\/\/documentation.codeship.com\/basic\/languages-frameworks\/nodejs\/\" target=\"_blank\" rel=\"noreferrer noopener\">build process<\/a><\/strong><\/em><span style=\"font-weight: 400\"> should happen on CodeShip servers as a general best practice.<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400\">If your build scripts have specific <\/span><a href=\"https:\/\/documentation.codeship.com\/basic\/languages-frameworks\/nodejs\/\" target=\"_blank\" rel=\"noreferrer noopener\"><span style=\"font-weight: 400\">dependencies<\/span><\/a><span style=\"font-weight: 400\">, they should be ignored in the git push process using the <em><strong>.gitignore<\/strong><\/em> file.<\/span><\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Pushing Multiple Branches<\/h2>\n\n\n\n<p><span style=\"font-weight: 400\">The CI\/CD pipeline becomes more complex if you have multiple branches you manage within the same site (for example, a plugin branch and a theme branch). Because of this, our friends at <\/span><a href=\"https:\/\/linchpin.agency\/\" target=\"_blank\" rel=\"noreferrer noopener\"><span style=\"font-weight: 400\">Linchpin<\/span><\/a><span style=\"font-weight: 400\"> have created a <\/span><a href=\"https:\/\/github.com\/linchpin\/wpengine-codeship-continuous-deployment\" target=\"_blank\" rel=\"noreferrer noopener\"><span style=\"font-weight: 400\">custom script<\/span><\/a><span style=\"font-weight: 400\">&nbsp;for this scenario using Environment Variables. The setup process looks a little different when using this script to manage multiple branches:<\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><span style=\"font-weight: 400\">Sign into <\/span><a href=\"http:\/\/codeship.com\/\" target=\"_blank\" rel=\"noreferrer noopener\"><span style=\"font-weight: 400\">codeship.com<\/span><\/a><\/li>\n\n\n\n<li><span style=\"font-weight: 400\">Create a new project<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400\">Connect to your <em><strong>SCM<\/strong><\/em>&#8211;you will need to authorize access to your repository in this process. <\/span>\n<ul class=\"wp-block-list\">\n<li><span style=\"font-weight: 400\">Add the public key from your projects General settings page on CodeShip to a machine user on GitHub and provide this user with access to your repository.<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400\">Add the public key from your projects General settings page on CodeShip to WP Engine as a <\/span><a href=\"https:\/\/wpengine.com\/git\/\"><span style=\"font-weight: 400\">git user<\/span><\/a><span style=\"font-weight: 400\">.&nbsp;<\/span> <\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><span style=\"font-weight: 400\">Setup <\/span><a href=\"https:\/\/documentation.codeship.com\/basic\/builds-and-configuration\/set-environment-variables\/\" target=\"_blank\" rel=\"noreferrer noopener\"><span style=\"font-weight: 400\">environment variables<\/span><\/a><span style=\"font-weight: 400\"> on CodeShip&#8211;this gives the script the ability to pipe in multiple options without storing those variables in the script itself.<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400\">Add deployment pipelines for production and staging as <\/span><a href=\"https:\/\/documentation.codeship.com\/basic\/continuous-deployment\/deployment-with-custom-scripts\/\" target=\"_blank\" rel=\"noreferrer noopener\"><span style=\"font-weight: 400\">Custom Script deployments<\/span><\/a><span style=\"font-weight: 400\"> on CodeShip.<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400\">Perform a test push to confirm your workflow is working correctly<\/span><\/li>\n<\/ul>\n\n\n\n<p><span style=\"font-weight: 400\">Linchpin has put together a <\/span><em><strong><a href=\"https:\/\/linchpin.agency\/blog\/continuous-deployment-wp-engine-codeship\/\" target=\"_blank\" rel=\"noreferrer noopener\">fantastic guide<\/a><\/strong><\/em><span style=\"font-weight: 400\"> to these steps as well as the environment labels their script uses. We highly recommend checking out this especially relevant guide for an in-depth look at the way Linchpin integrates with GitHub, CodeShip, and WP Engine in this type of setup.<\/span><\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p><strong>NEXT STEP: <a href=\"https:\/\/wpengine.com\/support\/development-workflow-best-practices\/\">Best practices for developing while using version control<\/a><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This guide explains how to configure and test CodeShip as a CI\/CD pipeline to deploy to WP Engine using GitHub, GitLab, or Bitbucket and Git push.<\/p>\n","protected":false},"featured_media":126216,"template":"","support-categories":[3,6,21,77],"support-tag":[118,4],"class_list":["post-33654","support","type-support","status-publish","has-post-thumbnail","hentry","support-categories-development","support-categories-platform","support-categories-setup","support-categories-third-party","support-tag-continuous-integration","support-tag-git"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Continuous Integration with CodeShip - Support Center<\/title>\n<meta name=\"description\" content=\"This guide explains how to configure and test CodeShip as a CI\/CD pipeline to deploy to WP Engine using GitHub, GitLab, or Bitbucket and Git push.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/wpengine.com\/support\/continuous-integration-codeship-wp-engine\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Continuous Integration with CodeShip - Support Center\" \/>\n<meta property=\"og:description\" content=\"This guide explains how to configure and test CodeShip as a CI\/CD pipeline to deploy to WP Engine using GitHub, GitLab, or Bitbucket and Git push.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wpengine.com\/support\/continuous-integration-codeship-wp-engine\/\" \/>\n<meta property=\"og:site_name\" content=\"Support Center\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-28T17:05:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wpengine.com\/support\/wp-content\/uploads\/2019\/12\/wp-engine-featured-image.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/wpengine.com\/support\/continuous-integration-codeship-wp-engine\/\",\"url\":\"https:\/\/wpengine.com\/support\/continuous-integration-codeship-wp-engine\/\",\"name\":\"Continuous Integration with CodeShip - Support Center\",\"isPartOf\":{\"@id\":\"https:\/\/wpengine.com\/support\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/wpengine.com\/support\/continuous-integration-codeship-wp-engine\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/wpengine.com\/support\/continuous-integration-codeship-wp-engine\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/wpengine.com\/support\/wp-content\/uploads\/2019\/12\/wp-engine-featured-image.png\",\"datePublished\":\"2017-12-28T17:08:32+00:00\",\"dateModified\":\"2025-07-28T17:05:22+00:00\",\"description\":\"This guide explains how to configure and test CodeShip as a CI\/CD pipeline to deploy to WP Engine using GitHub, GitLab, or Bitbucket and Git push.\",\"breadcrumb\":{\"@id\":\"https:\/\/wpengine.com\/support\/continuous-integration-codeship-wp-engine\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/wpengine.com\/support\/continuous-integration-codeship-wp-engine\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/wpengine.com\/support\/continuous-integration-codeship-wp-engine\/#primaryimage\",\"url\":\"https:\/\/wpengine.com\/support\/wp-content\/uploads\/2019\/12\/wp-engine-featured-image.png\",\"contentUrl\":\"https:\/\/wpengine.com\/support\/wp-content\/uploads\/2019\/12\/wp-engine-featured-image.png\",\"width\":1200,\"height\":630,\"caption\":\"WP Engine\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/wpengine.com\/support\/continuous-integration-codeship-wp-engine\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/wpengine.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Support Posts\",\"item\":\"https:\/\/wpengine.com\/support\/support\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Continuous Integration with CodeShip\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/wpengine.com\/support\/#website\",\"url\":\"https:\/\/wpengine.com\/support\/\",\"name\":\"Support Center\",\"description\":\"WP Engine&#039;s Support Center\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/wpengine.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Continuous Integration with CodeShip - Support Center","description":"This guide explains how to configure and test CodeShip as a CI\/CD pipeline to deploy to WP Engine using GitHub, GitLab, or Bitbucket and Git push.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/wpengine.com\/support\/continuous-integration-codeship-wp-engine\/","og_locale":"en_US","og_type":"article","og_title":"Continuous Integration with CodeShip - Support Center","og_description":"This guide explains how to configure and test CodeShip as a CI\/CD pipeline to deploy to WP Engine using GitHub, GitLab, or Bitbucket and Git push.","og_url":"https:\/\/wpengine.com\/support\/continuous-integration-codeship-wp-engine\/","og_site_name":"Support Center","article_modified_time":"2025-07-28T17:05:22+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/wpengine.com\/support\/wp-content\/uploads\/2019\/12\/wp-engine-featured-image.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/wpengine.com\/support\/continuous-integration-codeship-wp-engine\/","url":"https:\/\/wpengine.com\/support\/continuous-integration-codeship-wp-engine\/","name":"Continuous Integration with CodeShip - Support Center","isPartOf":{"@id":"https:\/\/wpengine.com\/support\/#website"},"primaryImageOfPage":{"@id":"https:\/\/wpengine.com\/support\/continuous-integration-codeship-wp-engine\/#primaryimage"},"image":{"@id":"https:\/\/wpengine.com\/support\/continuous-integration-codeship-wp-engine\/#primaryimage"},"thumbnailUrl":"https:\/\/wpengine.com\/support\/wp-content\/uploads\/2019\/12\/wp-engine-featured-image.png","datePublished":"2017-12-28T17:08:32+00:00","dateModified":"2025-07-28T17:05:22+00:00","description":"This guide explains how to configure and test CodeShip as a CI\/CD pipeline to deploy to WP Engine using GitHub, GitLab, or Bitbucket and Git push.","breadcrumb":{"@id":"https:\/\/wpengine.com\/support\/continuous-integration-codeship-wp-engine\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wpengine.com\/support\/continuous-integration-codeship-wp-engine\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wpengine.com\/support\/continuous-integration-codeship-wp-engine\/#primaryimage","url":"https:\/\/wpengine.com\/support\/wp-content\/uploads\/2019\/12\/wp-engine-featured-image.png","contentUrl":"https:\/\/wpengine.com\/support\/wp-content\/uploads\/2019\/12\/wp-engine-featured-image.png","width":1200,"height":630,"caption":"WP Engine"},{"@type":"BreadcrumbList","@id":"https:\/\/wpengine.com\/support\/continuous-integration-codeship-wp-engine\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/wpengine.com\/support\/"},{"@type":"ListItem","position":2,"name":"Support Posts","item":"https:\/\/wpengine.com\/support\/support\/"},{"@type":"ListItem","position":3,"name":"Continuous Integration with CodeShip"}]},{"@type":"WebSite","@id":"https:\/\/wpengine.com\/support\/#website","url":"https:\/\/wpengine.com\/support\/","name":"Support Center","description":"WP Engine&#039;s Support Center","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wpengine.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/wpengine.com\/support\/wp-json\/wp\/v2\/support\/33654","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpengine.com\/support\/wp-json\/wp\/v2\/support"}],"about":[{"href":"https:\/\/wpengine.com\/support\/wp-json\/wp\/v2\/types\/support"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wpengine.com\/support\/wp-json\/wp\/v2\/media\/126216"}],"wp:attachment":[{"href":"https:\/\/wpengine.com\/support\/wp-json\/wp\/v2\/media?parent=33654"}],"wp:term":[{"taxonomy":"support-categories","embeddable":true,"href":"https:\/\/wpengine.com\/support\/wp-json\/wp\/v2\/support-categories?post=33654"},{"taxonomy":"support-tag","embeddable":true,"href":"https:\/\/wpengine.com\/support\/wp-json\/wp\/v2\/support-tag?post=33654"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}