I want to deploy a laravel API application that is using nova as a backend on digitalocean app platform. So I have added all environment variables as App-Level Environment Variables
in app settings including NOVA_USERNAME
set to my nova emaill and NOVA_PASSSWRD
set to my nova license key. During the app creation, I am getting the error below
[2022-07-21 11:43:25] Warning from nova.laravel.com:
[2022-07-21 11:43:25]
[2022-07-21 11:43:25] ***************************************************
[2022-07-21 11:43:25] Unable to find user with the given email address: .
[2022-07-21 11:43:25] ***************************************************
[2022-07-21 11:43:25] Failed to download laravel/nova from dist: The 'https://nova.laravel.com/dist/laravel/nova/laravel-nova-f33003b1991491165e8822680e9a827f33c279c5-zip-383f38.zip' URL could not be accessed (HTTP 403): HTTP/2 403
[2022-07-21 11:43:25] Now trying to download from source
[2022-07-21 11:43:25] - Syncing laravel/nova (4.2.1) into cache
[2022-07-21 11:43:27]
[2022-07-21 11:43:27] In Git.php line 484:
[2022-07-21 11:43:27]
[2022-07-21 11:43:27] Failed to execute git clone --mirror -- '[email protected]:laravel/nova.git' '
[2022-07-21 11:43:27] /layers/heroku_php/shim/php/.composer/cache/vcs/git-github.com-laravel-nova
[2022-07-21 11:43:27] .git/'
[2022-07-21 11:43:27]
[2022-07-21 11:43:27] Cloning into bare repository '/layers/heroku_php/shim/php/.composer/cache/v
[2022-07-21 11:43:27] cs/git-github.com-laravel-nova.git'...
[2022-07-21 11:43:27] Warning: Permanently added the ECDSA host key for IP address '140.82.121.4'
[2022-07-21 11:43:27] to the list of known hosts.
[2022-07-21 11:43:27] [email protected]: Permission denied (publickey).
[2022-07-21 11:43:27] fatal: Could not read from remote repository.
[2022-07-21 11:43:27]
[2022-07-21 11:43:27] Please make sure you have the correct access rights
[2022-07-21 11:43:27] and the repository exists.
[2022-07-21 11:43:27]
[2022-07-21 11:43:27]
[2022-07-21 11:43:27] install [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--no-progress] [--no-install] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--] [<packages>...]
[2022-07-21 11:43:27]
[2022-07-21 11:43:27]
[2022-07-21 11:43:27] ! ERROR: Dependency installation failed!
[2022-07-21 11:43:27] !
[2022-07-21 11:43:27] ! The 'composer install' process failed with an error. The cause
[2022-07-21 11:43:27] ! may be the download or installation of packages, or a pre- or
[2022-07-21 11:43:27] ! post-install hook (e.g. a 'post-install-cmd' item in 'scripts')
[2022-07-21 11:43:27] ! in your 'composer.json'.
[2022-07-21 11:43:27] !
[2022-07-21 11:43:27] ! Typical error cases are out-of-date or missing parts of code,
[2022-07-21 11:43:27] ! timeouts when making external connections, or memory limits.
[2022-07-21 11:43:27] !
[2022-07-21 11:43:27] ! Check the above error output closely to determine the cause of
[2022-07-21 11:43:27] ! the problem, ensure the code you're pushing is functioning
[2022-07-21 11:43:27] ! properly, and that all local changes are committed correctly.
[2022-07-21 11:43:27] !
[2022-07-21 11:43:27] ! For more information on builds for PHP on Heroku, refer to
[2022-07-21 11:43:27] ! https://devcenter.heroku.com/articles/php-support
[2022-07-21 11:43:27]
[2022-07-21 11:43:27] ERROR: failed to build: exit status 1
What is the right way to handle the deployment?
CodePudding user response:
You have to tell composer to use the env variables:
composer config http-basic.nova.laravel.com ${NOVA_USERNAME} ${NOVA_PASSWORD}
Source: https://laracasts.com/discuss/channels/nova/how-to-deployment-laravel-nova
Update for heroku:
Add a COMPOSER_AUTH
env variable with the following value (replace credentials)
{
"http-basic": {
"nova.laravel.com": {
"username": "foo",
"password": "bar"
}
}
}