ohdearapp / ohdear-cli

The official Oh Dear CLI
https://ohdear.app
MIT License
134 stars 3 forks source link

Any idea how can I set the OHDEAR_API_TOKEN environment variable ? #54

Closed vincent-goossens closed 7 months ago

vincent-goossens commented 7 months ago

I am deploying via bitbucket pipeline and adding this package like this and:

Screenshot 2024-04-10 at 09 18 57

owenvoke commented 7 months ago

Looking at your script, it seems like $OHDEAR_API_TOKEN might already be defined, so you should be able to just run the command as ~/.composer/vendor/bin/ohdear maintenance-period:start 52135 60

vincent-goossens commented 7 months ago

I managed to add the env variable by doing: export OHDEAR_API_TOKEN=$OHDEAR_API_TOKEN

php src/composer.phar global require ohdearapp/ohdear-cli && export OHDEAR_API_TOKEN=$OHDEAR_API_TOKEN && ~/.composer/vendor/bin/ohdear maintenance-period:start $OHDEAR_SITE_ID 60 && php src/composer.phar global remove ohdearapp/ohdear-cli