Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Mar 8, 2024. It is now read-only.

Set of boilerplate scripts describing the normalized script pattern that GitHub uses in its projects.

License

NotificationsYou must be signed in to change notification settings

github/scripts-to-rule-them-all

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 

This is a set of boilerplate scripts describing thenormalized script patternthat GitHub uses in its projects. While thesepatterns can work for projects based on any framework or language, theseparticular examples are for a simple Ruby on Rails application.

The Idea

If your scripts are normalized by name across all of your projects, yourcontributors only need to know the pattern, not a deep knowledge of theapplication. This means they can jump into a project and make contributionswithout first learning how to bootstrap the project or how to get its tests torun.

The intricacies of things like test commands and bootstrapping can be managed bymaintainers, who have a rich understanding of the project's domain. Individualcontributors need only to know the patterns and can simply run the commands andget what they expect.

The Scripts

Each of these scripts is responsible for a unit of work. This way they can becalled from other scripts.

This not only cleans up a lot of duplicated effort, it means contributors can dothe things they need to do, without having an extensive fundamental knowledge ofhow the project works. Lowering friction like this is key to faster and happiercontributions.

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

script/bootstrap

script/bootstrap is used solely for fulfilling dependencies of the project.

This can mean RubyGems, npm packages, Homebrew packages, Ruby versions, Git submodules, etc.

The goal is to make sure all required dependencies are installed.

script/setup

script/setup is used to set up a project in an initial state.This is typically run after an initial clone, or, to reset the project back toits initial state.

This is also useful for ensuring that your bootstrapping actually works well.

script/update

script/update is used to update the project after a fresh pull.

If you have not worked on the project for a while, runningscript/update aftera pull will ensure that everything inside the project is up to date and ready to work.

Typically,script/bootstrap is run inside this script. This is also a goodopportunity to run database migrations or any other things required to get thestate of the app into shape for the current version that is checked out.

script/server

script/server is used to start the application.

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

script/update should be called ahead of any application booting to ensure thatthe application is up to date and can run appropriately.

script/test

script/test is used to run the test suite of the application.

A good pattern to support is having an optional argument that is a file path.This allows you to support running single tests.

Linting (i.e. rubocop, jshint, pmd, etc.) can also be considered a form of testing. These tend to run faster than tests, so put them towards the beginning of ascript/test so it fails faster if there's a linting problem.

script/test should be called fromscript/cibuild, so it should handlesetting up the application appropriately based on the environment. For example,if called in a development environment, it should probably callscript/updateto always ensure that the application is up to date. If called fromscript/cibuild, it should probably reset the application to a clean state.

script/cibuild

script/cibuild is used for your continuous integration server.This script is typically only called from your CI server.

You should set up any specific things for your environment here before your testsare run. Your test are run simply by callingscript/test.

script/console

script/console is used to open a console for your application.

A good pattern to support is having an optional argument that is an environmentname, so you can connect to that environment's console.

You should configure and run anything that needs to happen to open a console forthe requested environment.

About

Set of boilerplate scripts describing the normalized script pattern that GitHub uses in its projects.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Languages


[8]ページ先頭

©2009-2025 Movatter.jp