The issue you're encountering seems to be related to environment variables not being correctly passed or recognized during the deployment process with Envoyer. Here are a few steps you can take to troubleshoot and resolve this issue:
-
Verify Envoyer Environment Variables: Ensure that the environment variables (
NOVA_USERNAME,NOVA_LICENSE_KEY,APP_NAME,APP_URL) are correctly set in the Envoyer project settings. Double-check for any typos or incorrect values. -
Use Envoyer's Environment Variables: Envoyer allows you to manage environment variables directly. Make sure these variables are set in the "Environment" section of your Envoyer project. This ensures they are available during deployment.
-
Check Deployment Hooks: Ensure that the deployment hook is set to run in the correct stage of the deployment process. For example, if you're using these variables during the "Install Composer Dependencies" stage, make sure the hook is set to run before this stage.
-
Use
exportCommand: Sometimes, explicitly exporting the variables can help. Modify your deployment hook to includeexport:cd {{ release }} export NOVA_USERNAME="${NOVA_USERNAME}" export NOVA_LICENSE_KEY="${NOVA_LICENSE_KEY}" composer config http-basic.nova.laravel.com "${NOVA_USERNAME}" "${NOVA_LICENSE_KEY}" echo "NOVA_USERNAME: ${NOVA_USERNAME}" echo "NOVA_LICENSE_KEY: ${NOVA_LICENSE_KEY}" echo "APP_NAME: ${APP_NAME}" echo "APP_URL: ${APP_URL}" -
Check User Permissions: The error regarding
/home/forge/.composersuggests a permissions issue or that the directory does not exist. Ensure that the user running the deployment has the necessary permissions and that the directory exists. You might need to create the directory manually or adjust permissions. -
Debugging: Add additional logging to see if the environment variables are being set at any point. You can also try running a simple script to output all environment variables to see if they are being set at all:
cd {{ release }} printenv -
Contact Envoyer Support: If none of the above steps resolve the issue, it might be worth reaching out to Envoyer support for further assistance, as there could be a specific issue with how Envoyer is handling environment variables in your setup.
By following these steps, you should be able to identify where the problem lies and take corrective action.