Jaypore CI

> Jaypore CI: Minimal, Offline, Local CI system.
Log | Files | Refs | README | LICENSE

commit 7a2522aa7f886a01a0c2863097d8fb5f5ba85a68
parent 0c84ec2be766404ec3c85a39ac7806624ebe0c07
Author: arjoonn <arjoonn@midpathsoftware.com>
Date:   Sat, 28 Feb 2026 05:54:27 +0000

Versions inside binaries (!9)

Reviewed-on: https://gitea.midpathsoftware.com/midpath/jayporeci/pulls/9
Co-authored-by: arjoonn <arjoonn@midpathsoftware.com>
Co-committed-by: arjoonn <arjoonn@midpathsoftware.com>

Diffstat:
M.jci/run.sh | 9++++++---
ALICENSE | 33+++++++++++++++++++++++++++++++++
AVERSION | 1+
Mcmd/git-jci/main.go | 23++++++++++++++++-------
Mscripts/build_binary.sh | 6+++++-
Ascripts/sync_version.sh | 11+++++++++++
Mwww_jci/public/index.html | 16++++++++++++++++
7 files changed, 88 insertions(+), 11 deletions(-)

diff --git a/.jci/run.sh b/.jci/run.sh @@ -51,9 +51,12 @@ build_target() { } # --------------------------------------------------------------------------- +echo "--- Step 1: Updating code with latest VERSION ---" +scripts/sync_version.sh + # Step 1: Build Docker image (sequential — other steps depend on it) # --------------------------------------------------------------------------- -echo "--- Step 1: Building Docker image via scripts/build_image.sh ---" +echo "--- Step 2: Building Docker image via scripts/build_image.sh ---" scripts/build_image.sh echo "" @@ -67,7 +70,7 @@ echo "" # Windows amd64 git-jci-windows-amd64.exe # Windows arm64 git-jci-windows-arm64.exe # --------------------------------------------------------------------------- -echo "--- Step 2: Building binaries in parallel ---" +echo "--- Step 3: Building binaries in parallel ---" mkdir -p bin build_target linux amd64 git-jci-linux-amd64 @@ -108,7 +111,7 @@ echo "" # --------------------------------------------------------------------------- # Step 3: Build site (sequential — needs the binaries to be present) # --------------------------------------------------------------------------- -echo "--- Step 3: Building site inside jci container ---" +echo "--- Step 4: Building site inside jci container ---" docker run --rm -it -v "$PWD:/tmp/Jaypore CI" jci "/tmp/Jaypore CI/scripts/build_site.sh" echo "" diff --git a/LICENSE b/LICENSE @@ -0,0 +1,33 @@ +COMMERCIAL USE NOTICE + +While this software is provided under the MIT License below, if you are using +this software for a commercial purpose (e.g., within a company, for a client +project, or a paid service), please consider supporting the project by +purchasing a Commercial License. + +Your support allows for continued maintenance and new features. [https://www.jayporeci.in/#support] + +--- + +MIT License + +Copyright (c) 2026 Midpath Software Private Limited + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/VERSION b/VERSION @@ -0,0 +1 @@ +1.0.1 diff --git a/cmd/git-jci/main.go b/cmd/git-jci/main.go @@ -7,6 +7,10 @@ import ( "github.com/exedev/git-jci/internal/jci" ) +// version is set at build time via -ldflags "-X main.version=<version>". +// It falls back to "dev" when built without the flag (e.g. go run). +var version = "dev" + func main() { if len(os.Args) < 2 { printUsage() @@ -28,6 +32,9 @@ func main() { err = jci.Pull(args) case "prune": err = jci.Prune(args) + case "version", "--version", "-v": + fmt.Println("git-jci version " + version) + return case "help", "-h", "--help": printUsage() return @@ -44,16 +51,18 @@ func main() { } func printUsage() { - fmt.Println(`git-jci - Local-first CI system stored in git + fmt.Printf(`git-jci %s - Local-first CI system stored in git Usage: git jci <command> [options] Commands: - run Run CI for the current commit and store results - web Start a web server to view CI results - push Push CI results to remote - pull Pull CI results from remote - prune Remove old CI results + run Run CI for the current commit and store results + web Start a web server to view CI results + push Push CI results to remote + pull Pull CI results from remote + prune Remove old CI results + version Print the version and exit -CI results are stored in refs/jci/<commit> namespace.`) +CI results are stored in refs/jci/<commit> namespace. +`, version) } diff --git a/scripts/build_binary.sh b/scripts/build_binary.sh @@ -27,6 +27,10 @@ GOARM="${GOARM:-7}" cd "${REPO_DIR}" +# Read the version from the VERSION file at the repo root. +VERSION="$(cat "${REPO_DIR}/VERSION" | tr -d '[:space:]')" +echo "[${OUTPUT_BINARY_NAME}] Version: ${VERSION}" + echo "[${OUTPUT_BINARY_NAME}] Downloading dependencies..." go mod download @@ -40,7 +44,7 @@ GOARM="${GOARM}" \ go build \ -buildvcs=false \ -tags "netgo osusergo" \ - -ldflags "-s -w -extldflags '-static'" \ + -ldflags "-s -w -X main.version=${VERSION} -extldflags '-static'" \ -o "${OUTPUT_DIR}/${OUTPUT_BINARY_NAME}" \ "${ENTRY_POINT}" diff --git a/scripts/sync_version.sh b/scripts/sync_version.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)" + +VERSION=$(cat $REPO_ROOT/VERSION) +INDEX_HTML="${REPO_ROOT}/www_jci/public/index.html" +sed -i "s|<span id=\"jci-version\">.*</span>|<span id=\"jci-version\">v${VERSION}</span>|" \ + "${INDEX_HTML}" +echo " ✓ www_jci/public/index.html" diff --git a/www_jci/public/index.html b/www_jci/public/index.html @@ -15,6 +15,7 @@ <div> <a href="/binaries.html">Binaries</a> <a href="/releases/file/README.md.html">Docs</a> + <span id="jci-version">v1.0.1</span> </div> </nav> <h1><img src="assets/logo.png" alt="JCI logo" style="height:1em;width:auto;vertical-align:middle;margin-right:0.4em;">Minimal. Offline. Local.</h1> @@ -34,6 +35,21 @@ </p> <p> </p> + </section> + + <section id="support"> + <span class="label">Supporting</span> + <h2>Support Jaypore CI</h2> + <p> +While this software is provided under the MIT License, if you are using +this software for a commercial purpose (e.g., within a company, for a client +project, or a paid service), please consider supporting the project by +purchasing a Commercial License. + </p> + + <p> +Your support allows for continued maintenance and new features. + </p> <form id="rzp-form" class="rzp-skeleton" style="display:inline-block;min-width:172px;min-height:48px;"><script src="https://checkout.razorpay.com/v1/payment-button.js" data-payment_button_id="pl_SKcbmqJhCoHh1L" async> </script> </form> <script> (function () {