Hi, I'm building the CI/CD pipeline for the app I'...
# google-cloud
b
Hi, I'm building the CI/CD pipeline for the app I'm working on running in Google Cloud Run (GCR), where the CI/CD pipeline is managed by Google Cloud Build (GCB). GCB is set up with a trigger to the Github repo. All the IaC is build with Pulumi, and thus I want to integrate my Pulumi setup in the CD steps through the
cloudbuild.yaml
file. I have tried to follow the guide her: https://www.pulumi.com/docs/guides/continuous-delivery/google-cloud-build/
Copy code
#!/bin/bash

# Download and install required tools.
# pulumi
curl -L <https://get.pulumi.com/> | bash
export PATH=$PATH:$HOME/.pulumi/bin

#Login to starlab project
pulumi login <gs://folder>

#Choose stack
pulumi stack select <stack-name>

#update pulumi
pulumi preview
pulumi login
works properly, however it cannot see the stack in the repo. It just throws the error:
Copy code
error: no stack named 'starlab-iac' found
Another problem I have, is that I dont understand how to set my
PULUMI_CONFIG_PASSPHRASE
such that it is possible to run pulumi commands in
cloudbuild.yaml
such as
pulumi up
. Any help with my problem would be greatly appreciated. Best Regards Elias
s
Hey Elias! Couple questions for you: 1. are you in the right directory? if you’re not in your project directory and you have a self-hosted backend then
pulumi stack
commands won’t work. 2. can you set your
PULUMI_CONFIG_PASSPHRASE
as an environment variable in Github and then pass it to cloudbuild as an
env
?
b
Hej Vic, yes I am in the right directory - I have checked it by
ls -la
before
pulumi stack select <stack-name>
, and the
Pulumi.<stack-name>.yaml
is present. I have also tried the command
pulumi stack ls
and the command works however no stacks are listed. Just the name line:
NAME LAST UPDATE RESOURCE COUNT
I will look into add env vars from Github to Cloudbuild