Skip to content

Assorted Bash / PS scripts for common project use.

Notifications You must be signed in to change notification settings

shuwariafrica/scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

General Scripts Repository

This repository serves as a shared toolkit aimed at improving efficiency in tasks related to project lifecycle management.

Contents

1. Simple Build Tool Wrapper Scripts (sbtw)

Purpose

The Simple Build Tool Wrapper (sbtw) scripts enable the use of sbt (Simple Build Tool) without requiring pre-installation. They dynamically download and execute the appropriate version of sbt based on the sbt.version specified in the project's build.properties file.

Files

  • sbtw: A Bash script for Linux and macOS users.
  • sbtw.ps1: A PowerShell script for Windows users.

Usage

  1. Verify that a project/build.properties file exists and specifies a valid sbt.version.
  2. Run the script from the root of the project directory, passing regular sbt commands as arguments (e.g., compile, test):
    • For Linux or macOS:
      ./sbtw <sbt-arguments>
    • For Windows (PowerShell):
      ./sbtw.ps1 <sbt-arguments>

Requirements

  • Bash script:
    • Requires curl to be installed and available in the system PATH.
    • Requires an active internet connection to download necessary files.
  • PowerShell script:
    • Requires PowerShell 5.0 or later (or PowerShell Core for cross-platform use).
    • Requires an active internet connection to download necessary files.

2. Git Release Tagging Scripts (git-tag-release)

Purpose

These scripts simplify the creation of annotated and GPG-signed Git release tags in compliance with the stricter Semantic Versioning (SemVer) specification. They enforce consistency in tagging practices to simplify release workflows and ensure a predictable release process.

Files

  • git-tag-release.sh: A Bash script for Linux and macOS users.
  • git-tag-release.ps1: A PowerShell script for Windows users.

Usage

  1. Ensure the following checks are completed:
    • The current working directory is a valid Git repository.
    • There are no uncommitted changes in your working directory.
    • GPG signing is configured and functional in Git.
  2. To tag a release, execute the script with the desired version:
    • For Linux or macOS:
      ./git-tag-release.sh <version>
    • For Windows (PowerShell):
      ./git-tag-release.ps1 <version>

Version Format

The version must conform to the updated strict Semantic Versioning (SemVer) rules implemented in the scripts:

  • Main version:

    • The format must be X.Y.Z where X, Y, and Z are non-negative integers.
    • Examples of valid main versions: 1.0.0, 2.3.1, 0.9.5.
  • Prerelease versions (optional):

    • A prerelease version must include an allowed qualifier and a numeric part.
    • Supported qualifiers (case-insensitive):
      • Alpha (alpha, a)
      • Beta (beta ,b)
      • Milestone (milestone, m)
      • Release Candidate (rc, cr)
    • Examples of valid prerelease versions: 1.0.0-alpha.1, 2.3.1-beta.2, 0.9.5-rc.3.
  • Build metadata:

    • Build metadata (e.g., 1.0.0+build123) is not permitted.
  • Examples of valid versions:

    • 1.0.0
    • 1.0.0-alpha.1
    • 2.1.3-beta.2
    • 3.0.0-rc.5
  • Examples of invalid versions:

    • 1.0.0+build123 (Build metadata is disallowed)
    • 1.0.0-alpha (Missing numeric part for prerelease qualifier)
    • 1.0.0-beta.xyz (Prerelease must end with a number)
    • 1.0.0-gamma.1 (gamma is not a valid qualifier)

Notes

  • The script performs validation of the version string and reports errors if the provided version does not meet the required format.
  • If any required conditions are not met (e.g., uncommitted changes or invalid versions), the script terminates with an error message.
  • The script automatically prefixes the version with v when creating Git tags (e.g., v1.0.0).

Licence

This repository and its scripts are published under the CC0 1.0 Universal (Public Domain Dedication). This means that you are free to use, adapt, and redistribute them without any restrictions.

For more information about the CC0 1.0 Universal licence, please visit https://creativecommons.org/publicdomain/zero/1.0/.


Feedback and Support

If you encounter any issues, please raise an issue in the repository or submit a pull request. Detailed bug reports or proposals with a clear explanation are appreciated.

About

Assorted Bash / PS scripts for common project use.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published