This repository contains a Bash script designed for deploying the Clearinghouse System. The script automates the generation and deployment of SQL change requests and integrates with the SEAD Change Control System.
- Supports different deployment modes:
dryrun
,update
, andnew
. - Automatically generates SQL deploy scripts based on provided SQL files.
- Handles schema creation with options to drop, update, or abort if the schema already exists.
- Creates and updates issues in GitHub when specified.
usage: deploy-clearinghouse [--mode update|new|dryrun] [--sql-folder FOLDER] [--force]
--mode dryrun|update|new Whether to update an existing change request or add a new one to the SEAD Control System
dryrun Generate a change request in the target folder but do not update or add to the SEAD Control System
update Update the deploy script in an existing change request in the SEAD Control System
new Add a new change request to the SEAD Control System (mandatory)
--note Note added to the change request and issue
--related-issue-id Related issue GitHub ID
--no-create-issue Do not create a new GitHub issue
--sql-folder FOLDER Folder containing Clearinghouse SQL scripts (mandatory)
--force Force overwrite of existing temporary folder
--work-folder FOLDER Override default temporary directory (not recommended)
--change Override the default change request name
--on-schema-exists Action to take if the schema already exists: drop, abort, or update (default: drop)
deploy-clearinghouse --mode dryrun --sql-folder ./sql_scripts
This command generates a deploy script in the specified folder but does not update or add it to the SEAD Control System.
deploy-clearinghouse --mode new --sql-folder ./sql_scripts --note "Initial deployment of Clearinghouse System"
This command adds a new change request to the SEAD Control System with an optional note.
deploy-clearinghouse --mode update --sql-folder ./sql_scripts --force
This command updates an existing change request and forces the overwrite of the existing deploy script.
-
Modes:
new
: Generates a new change request and adds it to the SEAD Change Control System.update
: Updates an existing change request.dryrun
: Generates a deploy script without updating or adding it.
-
Schema Handling:
- The script supports actions for existing schemas:
drop
,abort
, orupdate
.
- The script supports actions for existing schemas:
-
Change Request Generation:
- The script generates a deploy script with headers containing metadata such as author, date, description, and issue ID.
-
GitHub Integration:
- Optionally creates or links related issues on GitHub using the provided
--related-issue-id
or--no-create-issue
option.
- Optionally creates or links related issues on GitHub using the provided
- Bash shell (
/bin/bash
) - Access to the SEAD Control System for adding or updating change requests
- Properly structured SQL files in the specified folder
This script is licensed under the MIT License. See LICENSE
for more details.
Contributions are welcome! Please fork the repository and submit a pull request.
This script was authored by the SEAD Change Control System team.