Beginning with Heroku. Problem with authetication - node.js

I'm noob in git/heroku etc. I work according to the tutorial https://devcenter.heroku.com/articles/getting-started-with-nodejs#deploy-the-app .
I run commands in cmd:
heroku login
cd node-js-getting-started
heroku create (runned in past)
heroku auth:token
git push heroku master
After last command possibly window show where I put username "" and password heroku token that I get.
But after, this is displayed:
C:\Users\Administrátor\node-js-getting-started>git push heroku master
git: 'credential-managerd' is not a git command. See 'git --help'.
The most similar command is
credential-manager
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://git.heroku.com/afternoon-fjord-61446.git/'
I'm really don't know what I should do now.

I finally solved it.
I changed my .gitconfig file from default
[credential]
helper = managerd
to
[credential]
helper = manager
and I used username "blank" instead "" (empty string) and its working.

Related

Change "View merge request for $branch" post push message in Gitlab

Using a self hosted gitlab instance, how can I modify this message that I get after pushing to the repository, on my git client side ?
git push
[...]
remote:
remote: View merge request for MYBRANCH:
remote: https://GITLAB_MR.URL
remote:
I tried checking the server side hooks of my omnibus installation in
/var/opt/gitlab/git-data/repositories/#hashed/MY_REPO_HASH
But I cant find any hook with this message there using grep -Hrn "View merge request"
Is this message not from a git hook ? How to configure it ?
If I cannot change it without modifying Gitlab's code, how can I add text there for pushers to read ?
As pointed out, this can only be done by modifying Gitlab's code and not by user configuration as of today.
I found the source of the message here : https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/internal_post_receive/response.rb
Of course most users wouldn't find this solution pratical.

How to deploy Git LFS on Heroku?

I have completed a project on Node.js which has already pushed into GitHub, this project has a video which larger than 100MB which required Git LFS. Git LFS successfully pushed into the GitHub no issue at all.
The second phase of this project is to host in Heroku, this is where I got stuck. I tried both:
heroku buildpacks:add https://github.com/BureauxLocaux/heroku-buildpack-git-lfs.git
and
heroku buildpacks:add (name of the app given by heroku)/heroku-buildpack-git-lfs
When it's pushed using
git push heroku master --no-verify
I get the following error:
remote: -----> Git LFS app detected
remote: Env var BL_BUILDPACK_GIT_LFS_REPO is not set
remote: ! Push rejected, failed to compile Git LFS app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to intense-journey-80070.
remote:
To https://git.heroku.com/intense-journey-89070.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/intense-journey-89070.git'
How can I make this work?
You say
heroku buildpacks:add (name of the app given by heroku)/heroku-buildpack-git-lfs
but you shouldn't use your app name here. I guess you want to use this buildpack? In that case, you should literally do
heroku buildpacks:add https://github.com/BureauxLocaux/heroku-buildpack-git-lfs.git
You also have an error message saying
Env var BL_BUILDPACK_GIT_LFS_REPO is not set
There is some additional configuration required for the buildpack, as outlined in its buildpack page on Heroku, which you appear not to have done:
Set the following environment variable for your app:
BL_BUILDPACK_GIT_LFS_REPO to the clone URL of the repository from which to download Git LFS assets. This should include any username, password, or personal access token which is necessary to clone noninteractively. See here for details on the syntax. It must be something like git#github.com:BureauxLocaux/my-repo
BL_BUILDPACK_GIT_LFS_SSH_PRIVATE_KEY: your private key encoded in base64 with base64 -w 0. You can use heroku config:set --app preprod-bureauxlocaux "BL_BUILDPACK_GIT_LFS_SSH_PRIVATE_KEY=$(cat ~/.ssh/heroku_deploy_lfs | base64 -w 0)" to set it.
Private SSH keys should be protected bordering on paranoia, so make sure to use a dedicated SSH key that is only used for deployment of this repository. Give that deploy key the lowest level of permission that you can.
The files that are linked to Large File System (LFS) are not supported in Heroku.
So you need to move to settings on heroku to add configs vars as key “HEROKU_BUILDPACK_GIT_LFS_REPO” to value “https://#github.com//repository.git” token is a unique personal Access token.
You need to register for that in your GitHub > settings> Developer Settings for Heroku to access your LFS files and also link in buildpacks to install LFS “https://github.com/raxod502/heroku-buildpack-git-lfs.git”.
Lastly, hit the deploy button in the deploy section and you are done with your project and available for people accessing over the internet.
Unfortunately Heroku doesn’t support git LFS at the moment.
Heroku doesn’t support git lfs. Using this method can cause pushes to fail.
https://devcenter.heroku.com/articles/git#deploy-from-a-branch-besides-main
Basically you can simply follow the instruction in this post. What I need to say is that when you register GitHub app, the URL you need to fill in "Webhook URL" and "Homepage URL" is both the URL you created using heroku (Example format: https://<app-name>.herokuapp.com).

VSTS Pipelines, how to answer to a cmd prompt?

I wanted to login to Heroku cli using Visual Studio Team Services release pipelines, the cmd line to login to Heroku is:
heroku login
Executing that command, Heroku cli will prompt this:
Email:
Password:
I don't know how to automate the inputs for that prompt, I would like to write a command or bash to login every time the task is executing.
EDITED
If it was from another platform, for example Github, then how do I automate a cmd prompt?
Screenshots:
My pipeline
Results from Heroku Cli
The best way it's to provide the credentials inline, for example, if you want to clone a Git repo from GitHub:
git clone https://username:password#github.com/username/repository.git
In Heroku case is impossible because they don't support this way. you can accomplish the accomplish heroku login by edit the ~/.netrc file - find the way in the above-provided answer.
But - you can try to answer the prompt automatically in this way:
(
echo "EMAIL"
echo "PASSWORD"
) | heroku login

Not able to push code in Git from Travis CI cloud for node

I have already gone through the previous post related to my problem and I checked every steps described there. But till my problem does not get the solution.
1)I am trying to use Travis CI cloud (not any CLI client as I have to only work with cloud)with Github login for public repository for end to end integration for node project.
2) After test with Travis I use the Istanbul for code coverage and push back to Git the coverage report which will be further use by Sonar cloud.
3) The link for my project and travis.yml : https://github.com/arpitajava/ZynlaNew
4) I have created the personal token in Git Hub for Travis and set as GH_TOKN as env variable in Travis page as well as .travis.yml
5) Every steps in the .travis.yml file is executing fine expect the last step git push.
$ git commit -m "Travis build" Travis build
16 files changed, 1951 insertions(+), 1 deletion(-) It is showing that
it committed 17 files after git commit execution.
$ git push origin
master remote: Invalid username or password. fatal: Authentication
failed for 'https://github.com/arpitajava/ZynlaNew.git/' Done. Your
build exited with 0.

Deploying to heroku from git sub directory

I'm trying to deploy to heroku from a particular directory in my project:
I've tried this command:
git subtree push --prefix output heroku master
and I get the response:
error: failed to push some refs to 'git#heroku.com:intquest.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
Is there a way to --force this command? Or what exactly am I doing wrong?
If you are sure to replace the remote heroku master history with a new one, you can try something similar to this answer:
git push heroku `git subtree split --prefix output master`:master --force

Resources