How can I run my own powershell script AFTER the build step?
Hi :)
I've got my own powershell script for nuget deployment (and later on, I might include some other deployment stuff).
Is there a way I can run my own Powershell script if the script is a file that is part of my git repo?
eg. \build\build.ps1
cheers AV team :)
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by gep13 on 12 Jan, 2015 07:37 AM
Hello,
Is this:
https://github.com/chocolatey/ChocolateyGUI/blob/develop/appveyor.y...
What you are looking for?
build.ps1
is a PowerShell script that is stored in my repository, and I run this as the first step in my build.Hope that helps!
Gary
2 Posted by Pure Krome on 12 Jan, 2015 07:39 AM
Hi @gep13 - thanks heaps for looking at my question. I really appreciate it, mate.
Um, nope. Your build script is the -full- build script (for your repo). I was just wanting to have my own deployment script (i guess i've renamed my script wrong - le blush!).
so it's like .. after the tests all work, run this PS script.
Support Staff 3 Posted by Feodor Fitsner on 12 Jan, 2015 05:46 PM
You can use "Script" mode on Deployment tab or
deploy_script
inappveyor.yml
.4 Posted by Pure Krome on 13 Jan, 2015 12:11 AM
thanks @feodor :)
one last question about this ... we :heart: using
appveyor.yml
scripts (instead of the ui).is there a way we can only run the deploy script when the git branch is
master
? for everything else - there is no deploy script / no deployment?PS. thanks for the good custom support and product -> we're going to be upgrading to a PAID account now :)
Support Staff 5 Posted by Feodor Fitsner on 13 Jan, 2015 12:13 AM
:) no prob - glad to be helpful!
Yes, you can check
$env:appveyor_repo_branch
environment variable, something like:6 Posted by Pure Krome on 13 Jan, 2015 12:17 AM
Hmm! I was thinking about having the powershell script only ran if the branch is
master
. Which means, leverage the branch only stuff in theappveyor.yml
file. Not have the script run for every branch and I do the branch specific checks in that.Support Staff 7 Posted by Feodor Fitsner on 13 Jan, 2015 12:20 AM
It could have been possible if there is "Script" deployment provider, but it's not. It's just "script" instead of "providers" infrastructure.
8 Posted by Pure Krome on 13 Jan, 2015 12:34 AM
er - I don't get it :( so there's no way in an
appveyor.yml
I can say ->deploy_scipt
=> when branchmaster
run thisps1
?Support Staff 9 Posted by Feodor Fitsner on 13 Jan, 2015 12:37 AM
Yep, but it's not a problem to check branch in that ps, right? It's not much overhead.
10 Posted by Pure Krome on 13 Jan, 2015 04:12 AM
true, but I would really prefer to do it via the
yml
file if possible :(any suggestions, please? :blush:
Support Staff 11 Posted by Feodor Fitsner on 13 Jan, 2015 04:27 AM
It's just few lines:
12 Posted by Pure Krome on 13 Jan, 2015 04:36 AM
How about something more like this...
otherwise, yeah .. i can just put that PS script inside my ps-file. I was hoping to do some tricks in the
yml
file to say: ifmaster
then run this script (to deploy)Support Staff 13 Posted by Feodor Fitsner on 13 Jan, 2015 07:30 PM
I see. This probably could be solved by introducing new "Script" deployment provider:
14 Posted by Pure Krome on 29 Jan, 2015 04:09 AM
Ok .. see how you have
script: do_something_here()
...is that the entire script? or just the name of the script path (eg. my ps1 script file). ?
Support Staff 15 Posted by Feodor Fitsner on 29 Jan, 2015 04:12 AM
Good question. It's supposed to be just a script, not a path to a file. Of course, you will be able to use dot-sourcing to run your .ps1 though it depends on current directory.
16 Posted by Pure Krome on 29 Jan, 2015 04:16 AM
example, please?
u mean something like this..
.\scripts\myScript.ps1
<-- that's a script, to run a script?Support Staff 17 Posted by Feodor Fitsner on 29 Jan, 2015 04:18 AM
Wait a second. This "script" provider doesn't exist yet. It's just hypothetical provider we could implement...
18 Posted by Pure Krome on 29 Jan, 2015 04:28 AM
Oh - ok. i thought there was a
- provider: Script
that currently exists and that it takes one option =>script: <the script code here>
.So, is this another item to the GH Issues list?
Support Staff 19 Posted by Feodor Fitsner on 29 Jan, 2015 04:29 AM
Yeah, feel free to add the item
...but it's been so real - you almost believed :)
Support Staff 20 Posted by Feodor Fitsner on 29 Jan, 2015 04:31 AM
The next AV "milestone" maybe be solely devoted to deployment, so that might come into it.
21 Posted by Pure Krome on 29 Jan, 2015 04:32 AM
Great! can i make an issue to remind me, if it gets implemented (i know it's an if).
Support Staff 22 Posted by Feodor Fitsner on 29 Jan, 2015 04:33 AM
Sure.
23 Posted by Pure Krome on 29 Jan, 2015 04:36 AM
Done - issue 128 :)
Pure Krome closed this discussion on 29 Jan, 2015 04:36 AM.