DevOps with PowerShell Studio (Continuous Integration/Continuous Deployment)

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION 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.
This topic is 5 years and 1 month old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
software@wku.edu
Posts: 14
Last visit: Fri Jul 30, 2021 9:49 am

DevOps with PowerShell Studio (Continuous Integration/Continuous Deployment)

Post by software@wku.edu »

To help you better we need some information from you.

*** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. ***

Product, version and build: 2018, 5.5.154
32 or 64 bit version of product: x64
Operating system: Windows 10
32 or 64 bit OS: x64

*** Please add details and screenshots as needed below. ***

DO NOT POST SUBSCRIPTIONS, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM
-----------
Hello everyone!

I wanted to inquire about whether or not there was a workflow for integrating a PowerShell Studio project into a CI/CD pipeline? What I'm particularly concerned about is the action "compilation" of the source code of a PSS project in a CI/CD pipeline. How would one accomplish that?

Ideally, the workflow would be:

1. Check out repo
2. Compile the executable (?) (PESTER tests would probably be run before or after this step)
3. Deploy the .exe to production server

Typically with .NET applications, I believe compilation in a CI/CD pipeline is done with "msbuild". Is there documentation / blogs on how to "compile" the source code of a PSS project into an .exe manually, such that it could be implemented in a CI/CD? Would this "compiler" work in only a Windows environment?

Again, the compilation of source code while in a CI/CD pipeline is all I am worried about.

Thanks for your time.
User avatar
software@wku.edu
Posts: 14
Last visit: Fri Jul 30, 2021 9:49 am

Re: DevOps with PowerShell Studio (Continuous Integration/Continuous Deployment)

Post by software@wku.edu »

I was able to find the executable that builds the project from source. The executable is located at: "C:\Program Files\SAPIEN Technologies, Inc\PowerShell Studio 2018\PSBuild.exe"

The command line arguments used to package a project is: /PACKAGE C:\Path\To\some_project.psproj.psbuild; this will package the .exe into a .\bin directory. If it does not exist, it will be created.

The above pretty much answers my question, however, the packaged executable doesn't appear to launch; a process is started for it, but no GUI appears, and it dies soon after. The executable when built from the IDE works fine. Below is the output of manually running PSBuild.exe with this project file with the /BUILD:

Code: Select all

SAPIEN Package and Deploy Tool 4.1 (c) 2005 - 2018 SAPIEN Technologies, Inc.

------ Build started: RollOutWinPE, Configuration: x64 ------
Packaging with SAPIEN PowerShell V5 Host (Windows Forms) x64
Adding C:\Users\git\trailblazer\trailblazer\Trailblazer.psproj
Warning: Cannot open external script syncfilter="*.ps1
Warning: Cannot open external script syncfilter="*.ps1;*.psm1;*.psd1;*.ps1
Warning: Cannot open external script referencefunction="invoke-global_ps1">globals.ps1
Writing scripts to bin\x64\RollOutWinPE.exe
Embedding default manifest...
Package completed
Would either of the warnings cause this issue? The /PACKAGE commands shows the same output. For further testing, I have replaced the executable in a working build from the IDE with the one built from the CLI, and the issue persists (ruling out dependency issues, I believe).

Thanks.

Edit: I found a post from 2011 that was asking for a way to build a working .EXE from the CLI: viewtopic.php?t=12620 Has there been any progress on this?
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: DevOps with PowerShell Studio (Continuous Integration/Continuous Deployment)

Post by davidc »

These articles may be of use to you:

https://www.sapien.com/blog/2014/03/25/ ... 14-part-1/
https://www.sapien.com/blog/2014/04/07/ ... 14-part-2/
https://www.sapien.com/blog/2014/04/14/ ... 14-part-3/
https://www.sapien.com/blog/2014/04/21/ ... 14-part-4/

As for the PSBuild, it will only work with ps1 directly. For project files or psf files, you will need to use PowerShell Studio's IDE. As for the command line support, we are laying the ground work for this. We still don't have a time table, but it is something we are pursuing. It is taking some time because it requires rearchitecting of the software.
David
SAPIEN Technologies, Inc.
User avatar
software@wku.edu
Posts: 14
Last visit: Fri Jul 30, 2021 9:49 am

Re: DevOps with PowerShell Studio (Continuous Integration/Continuous Deployment)

Post by software@wku.edu »

Thanks, David!
This topic is 5 years and 1 month old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.