Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node container can't get environment variables #18

Open
luispimentellopes opened this issue Sep 26, 2022 · 0 comments
Open

Node container can't get environment variables #18

luispimentellopes opened this issue Sep 26, 2022 · 0 comments

Comments

@luispimentellopes
Copy link

Hi,

I'm creating a dynamic build command on the lando file, so I want to use environment variables for the folders.

name: test
recipe: drupal9
config:
  webroot: src/web
  php: '7.4'
services:
  appserver:
    overrides:
      environment:
        DRUSH_OPTIONS_URI: "http://test.lndo.site"
  node:
    type: node:14
    build:
      - if [ -d $LANDO_WEBROOT/themes/custom/test/node_modules ]; then echo "Deleting node_modules folder" && rm -rf $LANDO_WEBROOT/themes/custom/test/node_modules; fi
      - echo "lando root" $LANDO_WEBROOT
      - echo "Running NPM install" && cd $LANDO_WEBROOT/themes/custom/test && npm install
      - echo "Creating NPM build" && cd $LANDO_WEBROOT/themes/custom/test && npm run gulp js && npm run gulp styles

This is the output of the build of node.

lando root
Running NPM install
/bin/sh: 1: cd: can't cd to /themes/custom/test
ERROR ==> /bin/sh: 1: cd: can't cd to /themes/custom/test 

It seems the node container doesn't have the environment variables set.

Thanks

@rtfm-47 rtfm-47 transferred this issue from lando/lando Sep 26, 2022
@rtfm-47 rtfm-47 added Needs Triage and removed node labels Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants