This article is about Codeship Pro.

Managing Multiple Environments For a Service

You will need about one minute to read this article.

For services that have multiple environments (e.g., production, staging, development) and require these contexts to be present within the CodeShip Pro build, our recommendation is to create a service for every environmental variant, reference the same Dockerfile in each service and provide the custom environment variables as needed:

# codeship-services.yml

app-prod:
  build:
    dockerfile: Dockerfile.app
  encrypted_env_file: prod_env_vars.encrypted

app-staging:
  build:
    dockerfile: Dockerfile.app
  encrypted_env_file: staging_env_vars.encrypted

app-dev:
  build:
    dockerfile: Dockerfile.app
  encrypted_env_file: dev_env_vars.encrypted


Need more help?

Contact our support team or post on Stack Overflow using the tag #codeship. Did you check the status page and changelog?

There are also several code examples and sample projects available for you to get started with.

Article not helpful?

Does this article need improvement? If so, please send feedback or submit a pull request!