Lighthouse-ci: Setting env vars for postgres use

Created on 29 Nov 2019  Â·  6Comments  Â·  Source: GoogleChrome/lighthouse-ci

I can't find the correct env var to set to tell the lhci server to use postgres for storage. Tried :

  • LHCI_POSTGRES_DB_URL
  • LHCI_SQLDIALECT
  • LHCI_SERVER__STORAGE__SQLDIALECT

Did I miss something ? Thanks for your help

question

Most helpful comment

There's a 1:1 mapping from env vars to CLI flags that follows yargs.

So LHCI_PROPERTY_NAME__SUBPROPERTY_NAME is equivalent to --propertyName.subpropertyName.

In this case...

export LHCI_STORAGE__SQL_DIALECT="postgres"
export LHCI_STORAGE__SQL_CONNECTION_URL="postgres://user@localhost/lighthouse_ci_db"

should work

All 6 comments

Hi @Djiit I haven't use that option yet but based on the cli args it looks like you need to set them when you run the command:

lhci server --storage.sqlDialect=postgres --storage.sqlConnectionUrl="postgres://user@localhost/lighthouse_ci_db"

or in the lighthouserc.json file.

https://github.com/GoogleChrome/lighthouse-ci/blob/master/docs/cli.md#server

Hey, thanks for your answer. I was looking to a env-var only solution to
use the already available image from the docker hub : I need to provide the
pgsql db url at runtime (when the container start, I tell it where its db
is).

I guess I'll go with my own image if I have to.

Thanks again anyway, I appreciate your help !

--
Julien

Le ven. 29 nov. 2019 à 20:33, Johnny Zabala notifications@github.com a
écrit :

Hi @Djiit https://github.com/Djiit I haven't use that option yet but
based on the cli args it looks like you need to set them when you run the
command:

lhci server --storage.sqlDialect=postgres
--storage.sqlConnectionUrl="postgres://user@localhost/lighthouse_ci_db"

or in the lighthouserc.json.

https://github.com/GoogleChrome/lighthouse-ci/blob/master/docs/cli.md#server

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/GoogleChrome/lighthouse-ci/issues/121?email_source=notifications&email_token=AAI5TNFPZ7UOBKMJ5O7MK2DQWFVBDA5CNFSM4JTAKVC2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFPO4DY#issuecomment-559869455,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAI5TNEEDFD55W7M3GDCWQDQWFVBDANCNFSM4JTAKVCQ
.

Hey, thanks for your answer. I was looking to a env-var only solution to use the already available image from the docker hub : I need to provide the pgsql db url at runtime (when the container start, I tell it where its db is). I guess I'll go with my own image if I have to. Thanks again anyway, I appreciate your help !

Ok, I get it. Sorry that my answer didn't solve your issue. Well if you end up creating your own image please share in case it can help someone else 🙂.

Good luck.

There's a 1:1 mapping from env vars to CLI flags that follows yargs.

So LHCI_PROPERTY_NAME__SUBPROPERTY_NAME is equivalent to --propertyName.subpropertyName.

In this case...

export LHCI_STORAGE__SQL_DIALECT="postgres"
export LHCI_STORAGE__SQL_CONNECTION_URL="postgres://user@localhost/lighthouse_ci_db"

should work

It does work !

Thanks!

Just pushed this to add your usefull comment in the docs : https://github.com/GoogleChrome/lighthouse-ci/pull/123

Was this page helpful?
0 / 5 - 0 ratings

Related issues

idbartosz picture idbartosz  Â·  3Comments

Hongbo-Miao picture Hongbo-Miao  Â·  3Comments

mauriciabad picture mauriciabad  Â·  4Comments

mathiasbynens picture mathiasbynens  Â·  4Comments

manoj-mass picture manoj-mass  Â·  3Comments