BoostingMy / vsts-heroku-tasks

Release tasks for interacting with heroku on Visual Studio Team Services.
MIT License
1 stars 7 forks source link

How to pass PushRoot? #1

Closed ahmed-abdulmoniem closed 7 years ago

ahmed-abdulmoniem commented 8 years ago

I don't understand property PushRoot!

How to pass it?

I have added . and / ... both failed!

And the dialog of the path which appears when I click on the three dots button, only allows me to select a file under my repository but not the repository its self?!

ahmed-abdulmoniem commented 8 years ago

@FernandoMorais?

ahmed-abdulmoniem commented 8 years ago

Any hint please @FernandoMorais ?

FernandoMorais commented 8 years ago

Hi @ahmed-abdulmoniem!

How did you setup your release workflow? You should select the root folder you want to publish on Heroku.

In my workflow I setup a build that runs Gulp and copy all files (except node_modules) to an output dir, after that it runs a release workflow that push to Heroku from that dir.

Give me more information on how you'd setup your workflow.

Regards, Fernando

ahmed-abdulmoniem commented 8 years ago

Hi @FernandoMorais

I am using your task in the Build tasks of TFS.

I am pushing the whole repository to heroku so I don't create any folders?

FernandoMorais commented 8 years ago

Is it a Node.js project? Please, attach a screenshot from "select path" dialog to help me see how your folders are.

ahmed-abdulmoniem commented 8 years ago

Yes, it is.

image

ahmed-abdulmoniem commented 8 years ago

@FernandoMorais?

FernandoMorais commented 8 years ago

Great! Could yout post your Procfile content?

ahmed-abdulmoniem commented 8 years ago

@FernandoMorais

web: slc run

BTW .. when I select the path from the path dialog to be my repository name (the root) it is not selected and still the path is empty

FernandoMorais commented 8 years ago

As a best practice I recommend you to create a "Copy and Publish Build Artifacts" or "Gulp" task that generates a "dist" folder, and then use that "dist" folder on Push Root.

I recommend you to use Push To Heroku task on Release workflows, in that way you can push the same build output to different Heroku apps (which could be "stage" and "production" environments).

Just in case... If you want do push all your repository (something I would not recommend) you can set your Push Root to $(angent.builddirectory). Please, let me know if this solution worked. :)

Regards, Fernando

ahmed-abdulmoniem commented 8 years ago

Thank you. I am trying it ..

In some cases you can't do dist folder like in case of strongloop project which has specific folder structure and it must be sent as it is.

ahmed-abdulmoniem commented 8 years ago

@FernandoMorais Still error

Copying files from 'C:\a\1\s\$(angent.builddirectory)'
Cannot find path 'C:\a\1\s\$(angent.builddirectory)' because it does not exist.
Files copied
Writing .gitignore file
Could not find a part of the path 'C:\a\1\s\$(angent.builddirectory)\.gitignore'.
.gitignore written
Initializing git config
git config --local user.name ""
git config --local user.email "vsts@[MY_APPLICATION_NAME].git.heroku.com"
Git config initialized
Adding files
git add .
[git] fatal: Not a git repository (or any of the parent directories): .git
******************************************************************************
Finishing task: PushToHeroku
******************************************************************************
Task PushToHeroku failed. This caused the job to fail. Look at the logs for the task for more details.
******************************************************************************

image

FernandoMorais commented 8 years ago

Please, set the "system.debug" variable to "true", that will let us to see a verbose log for the task. It will help us to find exactly where is the problem.

FernandoMorais commented 8 years ago

@ahmed-abdulmoniem I've tested on Build workflow and the task will not work because of lack of some environment variables used during the execution. You must use a Release workflow instead.

Use a "Copy and Publish Build Artifacts" to create a "drop" folder: image

And then on Release workflow configure the Push to Heroku task as follows: image

ahmed-abdulmoniem commented 8 years ago

@FernandoMorais You mean I must use the Release management component not TFS build?

FernandoMorais commented 8 years ago

Yes! By design, the task depends on Release environment variables, that are not present on Build workflows.

BTW, it is a best practice since you could target multiple Heroku Apps with the same build output, creating stage and production environment/apps. :)

ahmed-abdulmoniem commented 8 years ago

OK thank you. I will try the new release management component.

FernandoMorais commented 8 years ago

OK! Let me know if it works!

ahmed-abdulmoniem commented 8 years ago

Sure

FernandoMorais commented 8 years ago

Hi @ahmed-abdulmoniem!

Just to follow up, did it work ok?

ahmed-abdulmoniem commented 8 years ago

Still didn't setup the release management component @FernandoMorais

FernandoMorais commented 8 years ago

Hi @ahmed-abdulmoniem! Did you try using release management?

ahmed-abdulmoniem commented 7 years ago

I have been able to make it working using release management

But ... I am facing the same as this: https://github.com/BoostingMy/vsts-heroku-tasks/issues/2

ahmed-abdulmoniem commented 7 years ago

@FernandoMorais ?

FernandoMorais commented 7 years ago

Hi @ahmed-abdulmoniem, I'll close this issue and solve the new problem described at #2!