|
1 |
| -# About # |
2 |
| -This repo is basically my template for new bash repos/projects |
| 1 | +# Bash Project Template |
3 | 2 |
|
4 |
| -# CI Template # |
| 3 | +[](https://travis-ci.org/reactive-firewall/bash-repo) |
| 4 | +[](https://codecov.io/gh/reactive-firewall/bash-repo) |
5 | 5 |
|
6 |
| -By default this template will assume that the Travis CI Service is used for CI/CD |
| 6 | +A template repository for Bash projects, including CI/CD setup, testing, and code coverage integration. |
7 | 7 |
|
8 |
| -# Status # |
| 8 | +## Table of Contents |
9 | 9 |
|
10 |
| -### master ### |
11 |
| -[](https://travis-ci.org/reactive-firewall/bash-repo) |
12 |
| -[](https://codecov.io/gh/reactive-firewall/bash-repo/branch/master/) |
| 10 | +- [About](#about) |
| 11 | +- [Status](#status) |
| 12 | +- [Usage](#usage) |
| 13 | +- [Installation](#installation) |
| 14 | +- [Development and Testing](#development-and-testing) |
| 15 | +- [Contributing](#contributing) |
| 16 | +- [License](#license) |
13 | 17 |
|
14 |
| -### Stable ### |
15 |
| -[](https://travis-ci.org/reactive-firewall/bash-repo) |
16 |
| -[](https://codecov.io/gh/reactive-firewall/bash-repo/branch/stable/) |
| 18 | +## About |
17 | 19 |
|
18 |
| -# How do I use this to create a new project repo? # |
| 20 | +This repository serves as a template for new Bash projects, providing a starting point with essential configurations for continuous integration, testing, and code coverage. |
19 | 21 |
|
20 |
| -(assuming new project is already forked on github to `MY-NEW-REPO`) |
| 22 | +## Status |
21 | 23 |
|
22 |
| -```bash |
23 |
| -# cd /MY-AWSOME-DEV-PATH |
24 |
| -git clone https://github.com/reactive-firewall/MY-NEW-REPO.git MY-NEW-REPO |
25 |
| -# cd ./MY-NEW-REPO |
26 |
| -``` |
| 24 | +### Master Branch |
| 25 | + |
| 26 | +[](https://travis-ci.org/reactive-firewall/bash-repo) |
| 27 | +[](https://codecov.io/gh/reactive-firewall/bash-repo/branch/master/) |
| 28 | + |
| 29 | +### Stable Branch |
| 30 | + |
| 31 | +[](https://travis-ci.org/reactive-firewall/bash-repo) |
| 32 | +[](https://codecov.io/gh/reactive-firewall/bash-repo/branch/stable/) |
27 | 33 |
|
28 |
| -# Dev Testing Template # |
| 34 | +## Usage |
29 | 35 |
|
30 |
| -In a rush? Then use this: |
| 36 | +To use this template as the basis for your new project, clone your new repository and start development. |
| 37 | + |
| 38 | +### Cloning the Repository |
31 | 39 |
|
32 | 40 | ```bash
|
33 |
| -make clean ; # cleans up from any previous tests hopefully |
34 |
| -make test ; # runs the tests |
35 |
| -make clean ; # cleans up for next test |
| 41 | +# Navigate to your development directory |
| 42 | +cd /path/to/your/dev/directory |
| 43 | + |
| 44 | +# Clone your new repository |
| 45 | +git clone https://github.com/reactive-firewall/MY-NEW-REPO.git MY-NEW-REPO |
| 46 | + |
| 47 | +# Change into the project directory |
| 48 | +cd MY-NEW-REPO |
36 | 49 | ```
|
37 | 50 |
|
38 |
| -# Example Usage Template # |
| 51 | +### Example Script |
39 | 52 |
|
40 |
| -Want to use the Example `speed_test.bash` script then try this: |
| 53 | +An example script `speed_test.bash` is included in the `bin` directory. |
41 | 54 |
|
42 |
| -### Running... ### |
| 55 | +#### Running the Script |
43 | 56 |
|
44 | 57 | ```bash
|
45 |
| -speed_test.bash |
| 58 | +bin/speed_test.bash |
46 | 59 | ```
|
47 | 60 |
|
48 |
| -### ...Outputs ### |
| 61 | +#### Sample Output |
49 | 62 |
|
50 | 63 | ```plain
|
51 | 64 | Local: 4620K
|
52 | 65 | Server: 1472K
|
53 | 66 | ```
|
54 | 67 |
|
55 |
| -# Example installing Template # |
| 68 | +## Installation |
56 | 69 |
|
57 |
| -The following describes how to install the example script: |
| 70 | +To install the example script and other project components: |
58 | 71 |
|
59 |
| -### Download... ### |
| 72 | +### Download the Repository |
60 | 73 |
|
61 | 74 | ```bash
|
62 | 75 | cd /tmp
|
63 | 76 | git clone https://github.com/reactive-firewall/bash-repo.git bash-repo
|
64 |
| -cd ./bash-repo |
| 77 | +cd bash-repo |
65 | 78 | make clean
|
66 | 79 | ```
|
67 | 80 |
|
68 |
| -### ...install ### |
| 81 | +### Install |
| 82 | + |
| 83 | +You may need superuser permissions for installation. |
| 84 | + |
| 85 | +```bash |
| 86 | +sudo make install |
| 87 | +``` |
| 88 | + |
| 89 | +### Uninstall |
69 | 90 |
|
70 |
| -(might need sudo) |
| 91 | +To uninstall: |
71 | 92 |
|
72 | 93 | ```bash
|
73 |
| -make install |
| 94 | +sudo make uninstall |
74 | 95 | ```
|
75 | 96 |
|
76 |
| -### ...uninstall ### |
| 97 | +## Development and Testing |
| 98 | + |
| 99 | +For development and running tests, use the provided `Makefile`. |
77 | 100 |
|
78 |
| -uninstall is similar |
| 101 | +### Running Tests |
79 | 102 |
|
80 | 103 | ```bash
|
81 |
| -make uninstall |
| 104 | +make clean # Cleans up from any previous tests |
| 105 | +make test # Runs the tests |
| 106 | +make clean # Cleans up after tests |
82 | 107 | ```
|
83 | 108 |
|
84 |
| -# [](https://github.com/reactive-firewall/bash-repo/LICENSE.md) |
85 |
| - |
86 |
| -## Copyright (c) 2017 Mr. Walls |
87 |
| -### |
88 |
| -### THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
89 |
| -### IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
90 |
| -### FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
91 |
| -### AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
92 |
| -### LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
93 |
| -### OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
94 |
| -### SOFTWARE. |
95 |
| -### |
96 |
| -### Permission is hereby granted, free of charge, to any person obtaining a copy |
97 |
| -### of this software and associated documentation files (the "Software"), to deal |
98 |
| -### in the Software without restriction, including without limitation the rights |
99 |
| -### to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
100 |
| -### copies of the Software, and to permit persons to whom the Software is |
101 |
| -### furnished to do so, subject to the following conditions: |
102 |
| -### |
103 |
| -### The above copyright notice and this permission notice shall be included in all |
104 |
| -### copies or substantial portions of the Software. |
105 |
| - |
106 |
| -## USE AT OWN RISK. |
| 109 | +## Contributing |
| 110 | + |
| 111 | +Contributions are welcome! Please adhere to the project's coding standards: |
| 112 | + |
| 113 | +- **[CEP-5](https://gist.github.com/reactive-firewall/3d2bd3cf37f87974df6f7bee31a05a89)**: Custom coding standard for Bash scripts. |
| 114 | +- **[CEP-8](https://gist.github.com/reactive-firewall/b7ee98df9e636a51806e62ef9c4ab161)**: Custom coding standard for Python scripts. |
| 115 | + |
| 116 | +Ensure that all scripts use POSIX built-ins (e.g., use `printf` instead of `echo`) and follow the project's style guidelines, such as keeping the shebang line with an extra space (e.g., `#! /bin/bash`). |
| 117 | + |
| 118 | +## License |
| 119 | + |
| 120 | +[](LICENSE.md) |
| 121 | + |
107 | 122 |
|
0 commit comments