Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tristanpoland/genesis-ci-update
https://github.com/tristanpoland/genesis-ci-update
Last synced: 26 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/tristanpoland/genesis-ci-update
- Owner: tristanpoland
- Created: 2024-10-18T14:02:27.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-11-06T23:01:07.000Z (about 2 months ago)
- Last Synced: 2024-11-07T00:22:14.360Z (about 2 months ago)
- Language: Shell
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# genesis-ci-update
`genesis-ci-update` is a configurable Bash script designed to update CI (Continuous Integration) configurations for Genesis projects. It copies and updates configuration files and directories from a template to a target project, allowing for easy maintenance of consistent CI setups across multiple repositories.
## Features
- Selectively updates specified directories and files
- Preserves custom configurations
- Easily configurable through arrays
- Identifies potentially removed files
- Works without Git dependencies## Prerequisites
- Bash shell (version 4.0 or later recommended)
- Standard Unix utilities (find, cp, etc.)## Installation
1. Copy the `ci-update.sh` script to your desired location.
2. Make the script executable:
```
chmod +x ci-update.sh
```## Usage
Run the script with the following command:
```
./ci-update.sh [ci_directory_name]
```Where:
- `` is the path to the directory containing the template CI configuration
- `` is the path to the target project directory
- `[ci_directory_name]` is an optional name for the CI directory (default is "ci")## Configuration
The script uses several arrays to control its behavior. You can modify these arrays at the top of the script to customize which directories and files are updated:
- `DIRS_TO_UPDATE`: Directories to be updated (relative to the CI directory)
- `FILES_TO_COPY`: Individual files to be copied from the base template directory
- `DIRS_TO_PRESERVE`: Directories that should not be deleted during the update processExample configuration:
```bash
DIRS_TO_UPDATE=(
"pipeline"
"scripts"
"tasks"
)FILES_TO_COPY=(
"repipe"
)DIRS_TO_PRESERVE=(
"pipeline/custom-*"
)
```## How It Works
1. The script creates the target CI directory if it doesn't exist.
2. For each directory in `DIRS_TO_UPDATE`, it:
- Removes existing contents (except those matching patterns in `DIRS_TO_PRESERVE`)
- Copies new contents from the template
3. Copies individual files listed in `FILES_TO_COPY` from the template to the target.
4. Identifies and reports potentially removed files by comparing the template and target directories.## Example
```bash
./ci-update.sh /path/to/genesis-ci-template /path/to/my-project
```This command will update the CI configuration in `/path/to/my-project/ci` using the template from `/path/to/genesis-ci-template/ci`.
## Contributing
Contributions to improve `genesis-ci-update` are welcome. Please feel free to submit pull requests or open issues to suggest improvements or report bugs.
## License
Apache 2.0