0

I have written a script which builds out the various IIS sites that a team of developers will use, ideally when a new Dev comes online, to build their IIS they would checkout our get repo then run the script. In the longer term this script would also do various other tasks in an Environment setup. What I now need to do is ensure the script is continuously integrated, as such how do I set up a testing environment to ensure the script still work after each git commit. I.e the steps would be something as follows - New commit is made - spin up fresh VM - Execute script on VM - Assert the script executed properly

JustSomeDev
  • 324
  • 5
  • 18
  • for clarity, I am not looking for a way to have the file in source control but a way in which I can test what the script does with each new commit. i.e as this is an IIS script if someone changed a folder directory that would cause part of the script to fail so I'd like that to be implemented into my build – JustSomeDev Oct 26 '16 at 09:29

3 Answers3

1

You could start with the following:

  • make sure that script is in source control. That way, the script always matches the version of your code
  • Your're probably using TFS? If thats correct you van use TFS Release management to automate this process for you after one checks-in some code. If your're not using TFS the Octopus Deploy might be a nice alternative
E. Staal
  • 525
  • 5
  • 18
1

I recommend using a CI environment containing:

  1. source control and review system
  2. do code reviews in the repo with systems like phabricator, github or gitlab
  3. track your changes with a build server like jenkins
  4. use the build server to trigger your psake and pester tests.
  5. and finally publish your build to the final destinations.
OCram85
  • 841
  • 1
  • 9
  • 25
  • I haven't heard of pester until now so thanks for the heads up on that. That seems to fill part of the gap in testing I'm looking for. additionally I need to simulate running the script on a fresh IIS install which would be on a VM. I think I can use azure powershell to spin up a VM to do this – JustSomeDev Oct 27 '16 at 09:47
0

I would advise using jenkins https://jenkins.io/ as continuous integration. You can trigger a build after a commit is detected.

Yasirmx
  • 417
  • 3
  • 9