17

I want to do this action: enter image description here

using Heroku CLI.

If I have the remote git on my computer I can do git push my-heroku-remote master

But because my heroku app is already connected to the git project, I find this approach redundant.

Any ideas?

2 Answers 2

2

I prefer the GitHub auto-deployment over the git push heroku master because it works great with a GitHub Flow (Pull Requests to master). But if you would rather do manual deployments to Heroku from your dev machine you can fetch and push:

git fetch origin master:master
git push heroku master:master

(Assuming the GitHub remote is named origin and the Heroku remote is named heroku.)

Sign up to request clarification or add additional context in comments.

8 Comments

Thanks, but this solves only part of the problem - the machine I'm running this on should be aware of the git project - whereas Heroku is already aware of it. So it's double configuration
@YardenST Can you provide more details? I'm unclear on what you are looking for / trying to avoid.
Yes. We need to assume that the Heroku project has access to the git project. Therefore in theory - I should be able to run only heroku ... command that will build the app from the master branch. In your example, however - You are using the git command, which is I wish could be redundant as for my explanation. Because I'd like to have a build process that has not access directly to the git project.
yes something like heroku deploy:master -a myapp
As far as I know, heroku CLI tool cannot do this, but the slack integration can. devcenter.heroku.com/articles/chatops#deploying-code-to-an-app
|
0

Taken from here:

This can be done with the builds-create Platform API endpoint.

There is a Builds CLI plugin that makes this easier:

heroku builds:create --source-url https://user:[email protected]/repos/<username>/<repo name>/tarball/master/ --app <app-name>

Where user is your Github username and token is a Github personal access token (reference)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.