https://pulumi.com logo
#general
Title
# general
n

narrow-area-11460

06/13/2019, 9:50 PM
@chilly-photographer-60932 20 stacks in each environment? or distributed across environments?
c

chilly-photographer-60932

06/13/2019, 9:50 PM
Distributed across.
n

narrow-area-11460

06/13/2019, 9:54 PM
I tried to this on EKS with Gitlab based on inputs from @early-musician-41645 and @big-article-88775 -- here is an example of how we did it with @incalculable-sundown-82514 https://blog.pulumi.com/continuous-delivery-with-gitlab-and-pulumi-on-amazon-eks?hs_preview=SkXhaYiT-9743102699
restricting to this thread so not to spam others.
c

chilly-photographer-60932

06/13/2019, 9:55 PM
I read the blog post. How do you just deploy
dev
if there is a config change just for
dev
? The CI should skip deploying to other
env
n

narrow-area-11460

06/13/2019, 9:56 PM
the CD tool needs to have a project defined with build triggers in the
dev
environment
what is your CD tool?
Github? Gitlab?
you need to define a Gitlab pipeline for Dev, Stage and Prod
In each pipeline aka dev: you have stacks (say 7)
stage: has 7 stacks
prod: has 7 stacks
GitLab pipeline for dev is configured using
.gitlab-ci.yml
files in the root of each repository that has your related files
say your repository project is called
sample-iam
then your
.gitlab-ci.yml
file will look like this
Copy code
image:
  name: pulumi/pulumi:v0.17.10
  entrypoint:
    - '/usr/bin/env'
    - 'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'

stages:
  - preview
  - update
  - downstream

Pulumi Preview:
  stage: preview
  script:
    - npm ci
    - pulumi stack select pulumi/sample-iam/$DEPLOY_ENVIRONMENT
    - pulumi preview

Pulumi Update:
  stage: update
  script:
    - npm ci
    - pulumi stack select pulumi/sample-iam/$DEPLOY_ENVIRONMENT
    - pulumi update --skip-preview

Update EKS:
  stage: downstream
  trigger: pulumi-gitlab/sample-eks
you define the stage "update" -- implies when there is an update as defined in this file, trigger stage "downstream" which is essentially the next project called
sample-eks
in environment:dev
so you can have 7 stacks in dev organized as separate projects -- each stack update, trigger a downstream stack in that
environment: dev
I am not sure if you can trigger all 7 stacks simultaneously within 1 project as I have never tried that approach
taking a break -- but please read and let me know what other qs you have -- will come back and respond!