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

Hidden "Getting source"-task runs too soon. #1015

Closed
januskh opened this issue Dec 27, 2015 · 6 comments
Closed

Hidden "Getting source"-task runs too soon. #1015

januskh opened this issue Dec 27, 2015 · 6 comments

Comments

@januskh
Copy link

januskh commented Dec 27, 2015

In my senario, I would like to make some final changes in the build process. I have written a powershell script that can increase the revision-version of the assemblyinfo, and also download and update dependencies from the dropzone. (Running local agent, not hosted).

But... when I start a build, the first thing that happens, is that the Agent runs a (hidden) task before everything else, where it gets the source. "Getting source".

I have a workspace on the local-buildserver, where I am changing the assemblyinfo and updating the dependencies there, and afterwards checking-in the changes. But these changes are not applied to the build (before next build), since the source is already downloaded to the build-agents workarea. (first thing by the agent).

Is there somehow I can trigger the event of getting the source (again)? Or would it be possible to merge the (hidden) "Getting source"-task to the build-task or maybe postpone it to run after my script?

I hope you understand my question.. thank you. (Keep up the good work!)

@ericsciple
Copy link
Contributor

@januskh if i understand the scenario correctly, the second build is already queued (same definition, same agent) before the first build finishes. Correct?

If that's the case, then the problem is that the second build has been queued against a particular changeset.

If you want to really get latest at the point in time when the build runs (not when it was queued), you could run a batch script as the first step of your build.

CD /d "%Build_SourcesDirectory%"
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\TF.exe" get * /r

Does that workaround your issue?

@januskh
Copy link
Author

januskh commented Dec 29, 2015

I think I have explain my problem better like this. I have in one build definition two tasks.

  1. Powershell script task -> To update version and dependencies.
  2. Visual studio build task - To build the solution.

But when I queue the build, it turns into three tasks.

  1. Getting Source (TfvcSourceProvider.PrepareRepositoryAsync)
  2. Powershell script task (Check out, changes, checkin in another workspace)
  3. Visual studio build task.

The step #1 "Getting Source"-task, is run before everything else. So if I make checkins in step #2, these are not included in the source that step #3 is building.
I hope this explains it a little better. :)
Can I maybe (somehow) -reinvoke that?

@ericsciple
Copy link
Contributor

@januskh I see. I think you can still use the workaround I suggested above (with small modification). That is, add a batch file task between your step 2 and step 3:

CD /d "%Build_SourcesDirectory%"
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\TF.exe" get * /r

Would that workaround your issue?

@januskh
Copy link
Author

januskh commented Dec 29, 2015

@ericsciple I will try and let you know...

@januskh
Copy link
Author

januskh commented Dec 29, 2015

@ericsciple Yep... got it working... thank you alot for the tip! Happy new year!

@januskh januskh closed this as completed Dec 29, 2015
@DileepTiwari
Copy link

hi @januskh
is there any option in TFS 2015 for
"Task allows the build being queued to use either 'latest sources' or a specific source version"
or this is implemented by Poweshell script.
If you have then provide me.

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

3 participants