This message was deleted.
s
This message was deleted.
a
I’m getting error: no stack selected; please use
pulumi stack select
or
pulumi stack init
to choose one when running
pulumi preview
A
pulumi ls
shows me an empty table + pulumi stack ls NAME LAST UPDATE RESOURCE COUNT URL
but when I ls the dir, I see the stack files
Copy code
+ ls -la
total 64
drwxrwxrwx 5 root root 4096 Oct 15 21:45 .
drwxrwxrwx 4 root root 4096 Oct 15 10:17 ..
drwxrwxrwx 6 root root 4096 Oct 15 21:44 .git
-rw-rw-rw- 1 root root 4071 Oct 15 10:17 .gitignore
-rw-rw-rw- 1 root root  864 Oct 15 21:20 .gitlab-ci.yml
-rwxrwxrwx 1 root root  171 Oct 15 10:17 Pulumi.prod.yaml
-rwxrwxrwx 1 root root  118 Oct 15 10:17 Pulumi.yaml
I’m running a local gitlab-runner with the docker executor
and I couldn’t see any reference to which image to use, so I’m just using the
pulumi/pulumi-base
image
l
Are you mounting the correct host directory or volume?
You can use a language-specific one, I use pulumi/pulumi-nodejs
a
okay, good to know
I can see the files if I
ls
- so I assume gitlab runner is doing the correct thing
l
Have you used
pulumi login
?
a
yep, that works fine
Copy code
+ pulumi login
Logging in using access token from PULUMI_ACCESS_TOKEN
Logged in to <http://pulumi.com|pulumi.com> as limx0 (<https://app.pulumi.com/limx0>)
I noticed the setup script installs pulumi - but if I am using the docker image, I assume I can skip this step
maybe that’s whats messing it up
l
It works from pulumi/pulumi-nodejs. I'll see what's in pulumi/pulumi-base...
a
okay - I’m using the python sdk, let me change images
l
You need to install the SDK yourself, according to the image docs: https://hub.docker.com/r/pulumi/pulumi-base
So you might be better off switching to pulumi/pulumi-python
a
okay good pick up
and then assuming I’m running this image, can I confirm I should need any of the nodejs/npm/yarn libraries?
would you expect something like this to just work?
Copy code
# pulumi-preview.sh
pulumi login
pulumi preview
l
No, you need to add
pulumi stack select prod
in the middle.
Unless you're using an organization, in which case,
pulumi stack select yourorg/prod
a
okay no problem
Thanks for the help @little-cartoon-10569
hmm still not seeing it
l
About the npm dependencies from python: does requirements.txt resolve this?
a
I’m not sure - but it seems to be running as expected
l
Have you got it workign using the docker image, but locally instead of from GitLab-CI?
a
nope, so my issue is basically, pulumi in a docker image doesnt recognise the files I’m mounting
in the current dir
l
I use the docker image locally. I need 3 mounts to get docker to see the right stuff:
~/.pulumi:~/.pulumi
,
~/.aws:~/.aws
, and
.:/pulumi/projects
.
a
ahhhh okay
so something in .pulumi is probably missing
is there a way to somehow generate that from an existing project via a token/Pulumi.yaml files ?
can I do a
pulumi stack init
or something? That way I wouldnt have to build a totally sepaarete docker image for my CI
l
I think it mightn't be needed from a pipeline because you're logging in each time. Env vars are used, there's no continuity expected from run to run.
But if you're running from docker locally, and expecting it to work as if it was running on your host machine, you need these things.
a
thats what I would have thought
I’m also logging in locally via env variable
l
So you might try getting it working locally in Docker, to see if you can reproduce the issue, just in case it's not environmental: maybe your yaml files are broken...?
a
(basically exactly what gitlab would be doing)
okay I’ll keep trying, thanks very much for your help
l
Good luck. Hopefully someone else with GitLabCI-specific knowledge will pop in to the thread soon 🙂
a
okay - the solution was just to call
- pulumi stack init prod || true
again
(it fails as the files already exist, but thats enough to allow pulumi cli to see it)
which is probably creating the
~/.pulumi
dirs
l
Ah. Clever.