Deploy To multiple production servers

1.6k views Asked by At

We have a main repository based on Gitlab CD/CI. Now with our grows, we had a hard time to update each of our customer's apps using auto deploy with Git.

Now we're looking for a solution when production stage success and tests passed then all of our customers get the latest deployment and pull updates automatically. (Continues Delivery)

There is a deploy to production in Gitlab but it goes for single production we want to duplicate this steps for each mirror.

2

There are 2 answers

1
Farhad Farahi On

Gitlab-CI deploy stage can have multiple environments, which you can set each to automatic/manual deployment.

Example: just change the staging to customer1, production to customer2 and add as many as you need.

stages:
  - test
  - build
  - deploy

test:
  stage: test
  script: echo "Running tests"

build:
  stage: build
  script: echo "Building the app"

deploy_staging:
  stage: deploy
  script:
    - echo "Deploy to staging server"
  environment:
    name: staging
    url: https://staging.example.com
  only:
  - master

deploy_prod:
  stage: deploy
  script:
    - echo "Deploy to production server"
  environment:
    name: production
    url: https://example.com
  when: manual
  only:
  - master

Another solution would be in application automatic updates if you dont have access to your customers environments.

Also checkout Spinnaker which seems to be designed for CD specifically.

1
robertlyall On

You may want to check out DeployHQ. It supports deploying to unlimited servers at the same time.