https://pulumi.com logo
Title
c

clever-egg-2543

01/29/2020, 4:23 AM
What’s the best image to use for a GitLab pipeline? Does anyone have an example pipeline for previewing and deploying via Pulumi that could be shared?
c

clever-sunset-76585

01/29/2020, 4:39 AM
c

clever-egg-2543

01/29/2020, 4:50 AM
@clever-sunset-76585 Thanks, just what I was looking for.
πŸ™‚ 1
b

boundless-airport-99052

01/29/2020, 5:53 PM
I suggest a smaller docker image in this issue : https://github.com/pulumi/pulumi/issues/1986#issuecomment-544866074
But you have to build it
Here is the
.gitlabci
i use:
stages:
  - deploy

variables:
  PULUMI_HOME: "$CI_PROJECT_DIR/.pulumi"
  
cache:
  key: "cache-${CI_COMMIT_REF_SLUG}"
  paths:
    - node_modules/
    - .pulumi/plugins

before_script:
  - npm install
  - export PULUMI_ACCESS_TOKEN="..."


deploy_auto:
  stage: deploy
  image: 
    name: pulumi/pulumi:v1.6.1
    entrypoint: [""]
  script:
    - pulumi up --stack ${CI_COMMIT_REF_NAME} --non-interactive
  environment:
    name: ${CI_COMMIT_REF_NAME}
    on_stop: stop_env
  only: 
  - master


stop_env:
  stage: deploy
  image: 
    name: pulumi/pulumi:v1.6.1
    entrypoint: [""]
  variables:
    GIT_STRATEGY: none
  script:
    - |
      echo "name: PROJECT_NAME" > Pulumi.yaml
    - |
      echo "runtime: nodejs" >> Pulumi.yaml
    - pulumi destroy --stack ${CI_COMMIT_REF_NAME} --non-interactive
  environment:
    name: ${CI_COMMIT_REF_NAME}
    action: stop
  only: 
    - master
  when: manual
@white-balloon-205, this could interest the pulumi team 🧐 😁
c

clever-egg-2543

01/29/2020, 8:39 PM
@boundless-airport-99052 Thanks!
πŸ˜‰ 1
b

best-summer-38252

02/09/2020, 2:28 AM
@boundless-airport-99052 are you able to
stack rm org/name --non-interactive
? for me I still get the interactive prompt.
b

boundless-airport-99052

02/09/2020, 11:06 AM
Yes I am. Add
--yes
.
pulumi stack rm --stack ${CI_COMMIT_REF_SLUG} --non-interactive --yes
b

best-summer-38252

02/10/2020, 5:21 PM
ahh, i was missing the
--yes
. thank you.
πŸ‘ 1