4

I've been trying to deploy my GitLab application to Heroku, but unfortunatelt I keep getting this error when I try to run heroku login -i

Run `heroku login` to update your credentials, then retry the git command.

I've looked at solutions from the web for this, but none seem to help. Am I going about this wrong?

Here's my YML file

before_script:
  - echo "Running job..."

build_job_1:
  script:
    - heroku login -i
    - blank
    - XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX # Account token
    - git remote add heroku https://heroku:XXXXX@git.heroku.com/redditchatbot.git 
    - git push heroku HEAD:master

Thanks for the help!

EDIT: I've included the full log below

Running with gitlab-runner 11.9.0-rc2 (227934c0)
  on docker-auto-scale 0277ea0f
Using Docker executor with image ruby:2.5 ...
Pulling docker image ruby:2.5 ...
Using docker image sha256:e86557c9a8ab97ec7e9ba705f3e3411428b50d19d38643a0f52cb49faf735d3d for ruby:2.5 ...
Running on runner-0277ea0f-project-11711672-concurrent-0 via runner-0277ea0f-srm-1554580242-7d379f26...
Initialized empty Git repository in /builds/WillWam/reddump/.git/
Fetching changes...
Created fresh repository.
From https://gitlab.com/WillWam/reddump
 * [new branch]      master     -> origin/master
Checking out f2d6762d as master...

Skipping Git submodules setup
$ echo "Running job..."
Running job...
$ git remote add heroku https://heroku:XXXXX@git.heroku.com/redditchatbot.git
$ git push heroku HEAD:master
remote: !   WARNING:
remote: !   Do not authenticate with username and password using git.
remote: !   Run `heroku login` to update your credentials, then retry the git command.
remote: !   See documentation for details: https://devcenter.heroku.com/articles/git#http-git-authentication
fatal: Authentication failed for 'https://heroku:XXXX@git.heroku.com/redditchatbot.git/'
ERROR: Job failed: exit code 1
Widdles
  • 153
  • 3
  • 12

1 Answers1

1

Do not authenticate with username and password using git

That means: don't use heroku:XXXXX in your URL: the heroku login should cache your credentials, which implies you don't need said credentials in the URL.

If the issue persists, then check one of the solutions to "'git push heroku master' is still asking for authentication"

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250