Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure DevOps - Heroku #121

Open
renerlemes opened this issue Oct 1, 2022 · 4 comments
Open

Azure DevOps - Heroku #121

renerlemes opened this issue Oct 1, 2022 · 4 comments

Comments

@renerlemes
Copy link

Question
Could someone provide an example of how to use it with integration with Azure DevOps and Heroku?

@calebcartwright
Copy link
Member

Fundamentally this task operates at the git level, and all that's really needed is the set of remotes and any associated authentication. I know Heroku supports git pushes as a means of deployment, but I'm not familiar with what the auth story looks like when using git directly with Heroku.

However, I'd be curious to understand more about your use case because at first blush it doesn't seem like a typical one for this extension. I'd view Heroku as some form of a deployment target as opposed to a general purpose git repo host/remote, and one where you'd want to focus on pushing changes for a specific branch to Heroku as part of an intentional deployment, as opposed to performing a git mirror operation to get all refs from one repo source to another

@renerlemes
Copy link
Author

Heroku works with buildpacks, depending on the language of the project that the repository is in. But generally speaking, when a push is received on Heroku's master/main branch, it automatically deploys it to its environment and makes the application available.
I tried using the extension as follows:

image
image

The commands I did manually and it worked were these:

git clone --branch main https://$(System.AccessToken)@$(azure.gitUrl)
cd [folder]
git remote rm origin
git remote add --mirror=fetch origin https://heroku:$(heroku.apiToken)@git.heroku.com/$(heroku.appName).git
git fetch https://$(azure.pat)@$(azure.gitUrl)
git push origin --all -f

But I couldn't use the extension

@calebcartwright
Copy link
Member

I've used Heroku a bit in the past for various projects so have some familiarity, but I still feel like you didn't address the question from my prior comment. Specifically, I'd like to understand why you'd want to use a git mirroring task for deploying to Heroku as opposed to say, the Heroku cli or the Azure DevOps Extensions for Heroku.

Either way, there's not really enough information here for us to assist you, and it's not something we will try to pursue in parallel given the semi-recent Heroku/Salesforce announcement about dropping free tiers.

The only thing I could suggest you review is the value of the $(HerokuGitUrl) variable in your pipeline as shown in your screenshot of the usage of this task. It should be https://git.heroku.com/$(heroku.appName).git

@renerlemes
Copy link
Author

The two extensions available on the Marketplace for Azure DevOps Server don't work, both don't show your tasks to be used.
As for using Heroku Cli, I haven't tried using Azure Pipeline yet.
So the only way I found to work was doing everything with git commands.

Actually the variable was wrong in the Destination Git Repository field and also in the Destination Repository - Personal Access Token field.
But unfortunately your suggestion didn't work either.

Now at least the variables are all with the correct values as the repositories are accessed.

The current error I'm having would be the one below:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants