https://pulumi.com logo
#google-cloud
Title
# google-cloud
b

busy-lawyer-33856

05/11/2023, 11:21 AM
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

steep-lock-88842

05/11/2023, 2:51 PM
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

busy-lawyer-33856

05/15/2023, 11:10 AM
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
5 Views