Whatโ€™s the best image to use for a GitLab pipeline...
# typescript
c
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
c
@clever-sunset-76585 Thanks, just what I was looking for.
๐Ÿ™‚ 1
b
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:
Copy code
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
@boundless-airport-99052 Thanks!
๐Ÿ˜‰ 1
b
@boundless-airport-99052 are you able to
stack rm org/name --non-interactive
? for me I still get the interactive prompt.
b
Yes I am. Add
--yes
.
Copy code
pulumi stack rm --stack ${CI_COMMIT_REF_SLUG} --non-interactive --yes
b
ahh, i was missing the
--yes
. thank you.
๐Ÿ‘ 1