Commit d44b9d81 authored by Etienne Baqué's avatar Etienne Baqué

Moved provisioning to own template

parent 5bede99d
......@@ -14,7 +14,7 @@ class CiPlatformMetric < ApplicationRecord
numericality: { only_integer: true, greater_than: 0 }
CI_VARIABLE_KEY = 'AUTO_DEVOPS_PLATFORM_TARGET'
ALLOWED_TARGETS = %w[ECS FARGATE].freeze
ALLOWED_TARGETS = %w[ECS FARGATE EC2].freeze
def self.insert_auto_devops_platform_targets!
recorded_at = Time.zone.now
......
stages:
- provision
- review
- production
......@@ -6,4 +7,5 @@ variables:
AUTO_DEVOPS_PLATFORM_TARGET: EC2
include:
- template: Jobs/CF-Provision.gitlab-ci.yml
- template: Jobs/Deploy/EC2.gitlab-ci.yml
stages:
- provision
cloud_formation:
image: 'registry.gitlab.com/gitlab-org/cloud-deploy/aws-cloudformation:latest'
stage: provision
script:
- gl-cloudformation create-stack
rules:
- if: '($AUTO_DEVOPS_PLATFORM_TARGET != "EC2") || ($AUTO_DEVOPS_PLATFORM_TARGET != "ECS")'
when: never
- if: '$CI_KUBERNETES_ACTIVE'
when: never
- if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH'
......@@ -3,9 +3,8 @@ stages:
- production
.push-and-deploy:
image: 'registry.gitlab.com/ebaque/cloud-deploy/aws:latest'
image: 'registry.gitlab.com/gitlab-org/cloud-deploy/aws-ec2:latest'
script:
- gl-cloudformation create-stack
- gl-ec2 push-to-s3
- gl-ec2 deploy-to-ec2
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment