do you guys know of a way to cache these resources...
# golang
p
do you guys know of a way to cache these resources in CI so they won't be downloaded all the time when running pulumi?
q
p
I don't want to vendor them, just cached them
also even if I vendor the go modules, Pulumi is still going to download the Pulumi modules: [resource plugin cloudflare-3.6.0] installing
[resource plugin aws-4.38.1] installing
[resource plugin aws-5.38.0] installing
q
ok, i see.
l
@polite-sandwich-68547 is this on Github Actions?
p
gitlab-ci @limited-rainbow-51650
testing a solution now
l
You can use
PULUMI_HOME
to configure where these plugin binaries are downloaded on your CI runners. (https://www.pulumi.com/docs/reference/cli/environment-variables/) If you combine this with the caching behaviour your CI system might offer, you can improve the speed of subsequent runs. For Gitlab, I think this is the page to look at in their docs: https://docs.gitlab.com/ee/ci/caching/
p
Copy code
deploy:
  interruptible: true
  needs:
    - build
  stage: deploy
  image: pulumi/pulumi-go
  before_script:
    - mkdir -p ${CI_PROJECT_DIR}/.cache
    - export GOPATH=${CI_PROJECT_DIR}/.cache
    - apt update && apt install -y make && apt clean
  cache:
    policy: pull-push
    when: on_success
    key: build
    paths:
      - .cache
      - /root/.pulumi/plugins
  script:
    - make deploy
thank you @limited-rainbow-51650 I'll try that
Copy code
- mkdir -p ${CI_PROJECT_DIR}/.pulumi
    - export PULUMI_HOME=${CI_PROJECT_DIR}/.pulumi
then I'll cache it
Copy code
cache:
    policy: pull-push
    when: on_success
    key: build
    paths:
      - .cache
      - .pulumi/plugins
Copy code
Saving cache for successful job
Creating cache build-protected...
.cache: found 14914 matching artifact files and directories 
.pulumi/plugins: found 19 matching artifact files and directories
works guys!
thank you for the help