Skip to content

PowerShell scripts loosely based on GitHub's Scripts To Rule Them All

License

Notifications You must be signed in to change notification settings

peteoshea/powershell-scripts-to-rule-them-all

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PowerShell Scripts To Rule Them All

CI

PowerShell scripts loosely based on GitHub's scripts-to-rule-them-all.

I did not have a reason to call the bootstrap script directly so I have moved it into a bin subfolder to allow reuse without cluttering up the main script folder.

The cibuild script didn't really make sense to me as different CI systems have different requirements so I have removed it. As an example the test script is called directly from the ci.yml GitHub action.

As for the server and console scripts then I haven't had a need for them yet so I've just removed them for now. I will recreate them as bash scripts if and when I have a need for them.

I have also created bash versions of the scripts-to-rule-them-all with my take on things.

The Scripts

The following is a list of scripts and their primary responsibilities.

Used to set up a project in an initial state. This is typically run after an initial clone, or, to reset the project back to its initial state.

Used to update the project after a fresh pull. This should include any database migrations or any other things required to get the state of the app into shape for the current version that is checked out.

Used to run the test suite of the project. To allow this script to be run from CI setup should be done outside of this script. A manual call to update before running the tests is usually a good idea.

A good pattern to support is having optional arguments that allow you to run specific tests.

Linting is also be considered a form of testing. These tend to run faster than tests, so put them towards the beginning so it fails faster if there's a linting problem.

Used to start the application. For a web application, this might start up any extra processes that the application requires to run in addition to itself.

The update script is called ahead of any application booting to ensure that the application is up to date and can run appropriately.

Installing Dependencies

The bootstrap script, called from both setup and update scripts, is used solely for fulfilling dependencies of the project. This can mean installing packages, updating git submodules, etc. The goal is to make sure all required dependencies are installed.

This script currently allows for following package managers:

If you have some Chocolatey packages required then you can simply add a chocolatey-packages file at the top level of the project with a list of the packages and they will be installed and updated as required. Simply having the chocolatey-packages file means Chocolatey will be installed and updated.

Microsoft has recently released it's own package manager winget. This is currently only a preview so some functionality may not be available yet but it sounds promising so if you want to use this to install some packages then you can simply add a winget-packages file at the top level of the project with a list of the packages and they will be installed and updated as required.

About

PowerShell scripts loosely based on GitHub's Scripts To Rule Them All

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published