Skip to content

Allow Unpack to both Managed and Unmanaged in the same execution #246

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

Open
namurdock opened this issue Jun 8, 2018 · 6 comments
Open

Allow Unpack to both Managed and Unmanaged in the same execution #246

namurdock opened this issue Jun 8, 2018 · 6 comments

Comments

@namurdock
Copy link

This is an extension of #208

We source control the unpacked files for both managed and unmanaged solutions.

It allows us to perform a pack within VSTS to both managed and unmanaged zip files.

Would it be possible to extend the unpack task to allow this.

e.g.

 "solutions": [
    {
      "profile": "default,debug",
      "solution_uniquename": "SolutionName",
      "packagepath": "..\\Solution",
      "solutionpath": "solution_{0}_{1}_{2}_{3}.zip",
      "packagetype": "unmanaged,managed"
    }
]
@scottdurow
Copy link
Owner

Thanks for your suggestion - the way I do it is having two separate profiles - one for managed and one for unmanaged. Would that work for you?

@namurdock
Copy link
Author

Thanks Scott. It probably would. Do you target two separate package folders for your unpack?

Further question...

When you pack in VSTS do you use an execute bat step? If so is there any documentation or examples of how to specify the output path so that the zip can be published as an artifact?

Thanks again. I really don't know how you have the time to do this and everything else you do!

@scottdurow
Copy link
Owner

Yes - two separate folders - one for managed and the other unmanaged.

When I'm packing in VSTS I use one similar to pack+import.bat that just uses the 'pack' task.
The published artifact is the solution zip that is copied to the drop location.

@namurdock
Copy link
Author

Thanks, when running the two profiles is it necessary to have the bat run spkl twice? (i.e. prompt for connection twice) or is it possible to run the two profiles using the same connection details?

@namurdock
Copy link
Author

namurdock commented Jun 11, 2018

I am fairly sure this is user error but i cannot get the solution to pack. Issue happens when the packer hits my plugin assemblies. I have played around with the paths but with no success. (would you like me to log this as a different issue?) (the webresources folder map works fine, and the unpack task is also working fine)

My VS solution layout is:

`

  • VS Solution
    -- Solution Project
    -- Webresources Project
    -- Plugin Project
    -- Workflows Project
    -- Runners (inc. spk.json)
    `

Maps i am using

 {
      "profile": "release",
      "solution_uniquename": "<SolutionName>",
      "packagepath": "managed",
      "solutionpath": "<SolutionName>_{0}_{1}_{2}_{3}_managed.zip",
      "filePath": "..\\SolutionProject",
      "packagetype": "managed",
      "increment_on_import": false,
       "map": [
        {
          "map": "path",
          "from": "PluginAssemblies\\**\\Plugins.dll",
          "to": "..\\..\\PluginProject\\bin\\Debug\\"
        },
        {
          "map": "path",
          "from": "PluginAssemblies\\**\\Workflows.dll",
          "to": "..\\..\\WorkflowProject\\bin\\Debug\\"
        },
        {
          "map": "folder",
          "from": "WebResources\\chorus_",
          "to": "..\\..\\WebResourcesProject\\Webresources\\"
        }
      ]
}

Error received:

Error Matched file 'C:\Repos\xxxxx\xxxxx\RunnersProject\managed\PluginAssemblies/Plugins-76C6CA04-A69C-4F8D-9DFB-032C1EF0731F/Plugins.dll' was not found in any mapping. Pack operation is aborted.

It appears that the pack is looking for a relative path, so i guess my bat is incorrect:

@echo off
set package_root=..\..\
REM Find the spkl in the package folder (irrespective of version)
For /R %package_root% %%G IN (spkl.exe) do (
	IF EXIST "%%G" (set spkl_path=%%G
	goto :continue)
	)

:continue
@echo Using '%spkl_path%' 

REM spkl instrument [path] [connection-string] [/p:release]
"%spkl_path%" pack /p:release
pause

Update: I think i have resolved the path issue by going to a file mapping rather than a path one.

@wajihqidwai
Copy link

I am having similar problem
Error Matched file 'C:\Repos\xxxxx\xxxxx\RunnersProject\managed\PluginAssemblies/Plugins-76C6CA04-A69C-4F8D-9DFB-032C1EF0731F/Plugins.dll' was not found in any mapping. Pack operation is aborted.

Any idea how to solve it

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