WaelHamze / dyn365-ce-vsts-tasks

VSTS Extension for Dynamics 365 Customer Engagement
https://marketplace.visualstudio.com/items?itemName=WaelHamze.xrm-ci-framework-build-tasks
GNU General Public License v3.0
117 stars 56 forks source link

Extract Solution, how to push to repository #76

Closed jellevervloessem closed 5 years ago

jellevervloessem commented 5 years ago

Hi,

When I extract a solution via the SolutionPackager, the files are extracted to folder X. How can I submit these files to the repository?

Thanks! J.

WaelHamze commented 5 years ago

@jellevervloessem are you using Git?

jellevervloessem commented 5 years ago

@WaelHamze yes, we use Git repositories in DevOps. I probably need to add an extra task to commit?

Chris-Koenig commented 5 years ago

Any news on this request? i'm facing the same issue.

Thanks for posting your updates/infos here.

spr0ut commented 5 years ago

I was looking for a similar path, but I gave up as the only option seemed to be trying to deal with Git via command line and trying to make a commit from the unpackaged files. This route seemed a bit messy and for the sake of time I abandoned the approach. Interestingly, Microsoft documentation (https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/use-source-control-solution-files) suggests the following workflow:

When you are ready to check in, do the following.

  1. Export the unmanaged solution.
  2. Using the SolutionPackager tool, extract the solution into component files.
  3. From those extracted component files, add the necessary files to source control.
  4. Submit these changes to source control.
jellevervloessem commented 5 years ago

We used a cmd line step in our build.:

ECHO init new Repo
git init

ECHO set remote Repo
git remote add hudsonxrm https://<PAT-authorized-login>:PAT@cegekabs.visualstudio.com/<Path to repository>

ECHO set settings
git config user.name "Cedric"
git config user.email "cedric@mycompany.com"

ECHO pull existing
git pull <repository-name> master

ECHO add files
git add *

ECHO commit files
git commit -m "Update extracted solutions"

ECHO get status
git status

ECHO showref
git show-ref

ECHO push to repo
git push <repository-name> HEAD:master

ECHO get status
git status