Skip to content

Latest commit

 

History

History
77 lines (48 loc) · 3.7 KB

README.md

File metadata and controls

77 lines (48 loc) · 3.7 KB

Scripts To Rule Them All

CI

This is a set of boilerplate bash scripts 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 console script then I haven't had a need for it yet so I've just removed it for now. I will recreate it as a bash script if and when I have a need for it.

I have also created a set of PowerShell Scripts To Rule Them All for developing also happens on Windows machines.

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 are on a Debian based Linux system, like Ubuntu, then you can create an apt-packages file with a list of the required packages. You must ensure that this file has Linux line-endings (LF) otherwise it may not work as expected.

If you are on a RedHat based Linux system, like CentOS or Fedora, then you can create an yum-packages file with a list of the required packages. You must ensure that this file has Linux line-endings (LF) otherwise it may not work as expected.

You can use Homebrew by creating a Brewfile at the top level of the project with a list of the packages to be installed. Simply having the Brewfile means Homebrew will be installed and updated.