Deploy to relative path

Support for all customers who have purchased a SAPIEN PowerShell Studio product license. This forum does not offer a response time guarantee.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
User avatar
claussen
Posts: 17
Joined: Thu Dec 04, 2014 9:48 am

Deploy to relative path

Post by claussen » Wed Dec 19, 2018 1:32 pm

Product, version and build: PSS 5.6.156
32 or 64 bit version of product: 64
Operating system: Win 10 Ent 1809
32 or 64 bit OS: 64

Using version control such as Git presents some complexities with psproj.psbuild files as the deployment settings are saved as absolute paths. Is it possible to use a relative path to the project? If I have the following structure:

Code: Select all

Root
  MyModule.psd1
  MyModule.psm1
  MyModule.psproj
  MyModule.psproj.psbuild
  MyModule\
    MyModule.psd1
    MyModule.psm1
Can I make PSS deploy to ".\MyModule" (which would be Root\MyModule)? Otherwise, when someone does any commits or checkouts which include a change to the deployment path, they will likely have to re-configure it for wherever they have their working directory. For example, if I clone/checkout the repository to "D:\projects\MyModule" and set the deployment folder to "D:\projects\MyModule\MyModule"... then commit that MyModule.psproj.psbuild file...

Now developer B comes along and clones/checkout to "C:\some\other\directory\MyModule", the deployment folder is still "D:\projects\MyModule\MyModule" which may not exist and will throw an error.

Or perhaps I am missing something which might solve this? Obviously the "easy" solution is probably to either ignore this file, or force devs to change it every time... Just hoping there was a better option. I'm open to ideas :-)

User avatar
davidc
Posts: 5839
Joined: Thu Aug 18, 2011 4:56 am

Re: Deploy to relative path

Post by davidc » Wed Jan 02, 2019 10:57 am

Can you zip and upload your psbuild file to get a better idea as to what is happening?

https://www.sapien.com/support/upload

Yes, you should be able to change it to a relative path. The base path will always be relative to the project folder / psbuild file.

At this time there is no mechanism to user specific deployment paths, but you can submit a feature request here:

https://www.sapien.com/requests
David
SAPIEN Technologies, Inc.

User avatar
claussen
Posts: 17
Joined: Thu Dec 04, 2014 9:48 am

Re: Deploy to relative path

Post by claussen » Thu Jan 03, 2019 8:10 am

davidc wrote:
Wed Jan 02, 2019 10:57 am
Can you zip and upload your psbuild file to get a better idea as to what is happening?

https://www.sapien.com/support/upload

Yes, you should be able to change it to a relative path. The base path will always be relative to the project folder / psbuild file.

At this time there is no mechanism to user specific deployment paths, but you can submit a feature request here:

https://www.sapien.com/requests
I uploaded as requested. I even deleted the psbuild file while the project was closed...reopened the project, and re-selected the deployment path. It made it an absolute path again on line 3

Code: Select all

[Deploy]
MainFile=(Source Script)
Destination=D:\git\DNSConsole\DNSConsole

User avatar
davidc
Posts: 5839
Joined: Thu Aug 18, 2011 4:56 am

Re: Deploy to relative path

Post by davidc » Thu Jan 03, 2019 2:07 pm

The browse button will only provide the absolute path. You will need to manually edit it.

Module projects are a special case, because it creates a staging folder before deploying. Therefore, the paths are going to be relative to the starting folder and not the project. We will need to investigate further and see what can be done. In the meantime, I recommend submitting a feature request.
David
SAPIEN Technologies, Inc.

User avatar
claussen
Posts: 17
Joined: Thu Dec 04, 2014 9:48 am

Re: Deploy to relative path

Post by claussen » Thu Jan 03, 2019 2:12 pm

After manually editing the psbuild file it appears it still works. The Deployment Settings GUI shows an error and will not let me save it giving me "Please enter a valid destination path"... But without messing with that, the Deploy button will create the file in the relative path.

My psbuild file now looks like:

Code: Select all

[Deploy]
MainFile=(Source Script)
Destination=DNSConsole
I will submit the feature request. Thanks!