{"id":17311247,"url":"https://github.com/rockstorm101/bash-ci-server","last_synced_at":"2026-02-24T02:07:32.472Z","repository":{"id":116363326,"uuid":"591916707","full_name":"rockstorm101/bash-ci-server","owner":"rockstorm101","description":"Lightweight CI/CD server written in Bash","archived":false,"fork":false,"pushed_at":"2025-02-23T10:17:06.000Z","size":45,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-28T03:12:46.023Z","etag":null,"topics":["bash","ci","continuous-integration","server"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rockstorm101.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-22T10:42:36.000Z","updated_at":"2025-02-23T10:17:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"d1ac57ea-6838-409f-8973-526d5d261281","html_url":"https://github.com/rockstorm101/bash-ci-server","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rockstorm101%2Fbash-ci-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rockstorm101%2Fbash-ci-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rockstorm101%2Fbash-ci-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rockstorm101%2Fbash-ci-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rockstorm101","download_url":"https://codeload.github.com/rockstorm101/bash-ci-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248894937,"owners_count":21179152,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","ci","continuous-integration","server"],"created_at":"2024-10-15T12:39:56.089Z","updated_at":"2026-02-24T02:07:32.421Z","avatar_url":"https://github.com/rockstorm101.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bash CI Server\n![Version][b3]\n[![Test Build Status][b1]][bl]\n[![Docker Image Size][b2]][bl]\n\nLightweight CI/CD server written in Bash.\n\nThis is simply the combination of the [Bash CI scripts][1] by Shumpei\nIinuma and an [Ncat server][2]. Together they are able to serve as a\nlightweight CI server for other services such as a git server.\n\nImage source at: https://github.com/rockstorm101/bash-ci-server\n\n[1]: https://github.com/iinm/bash-ci\n[2]: https://nmap.org/ncat/guide/index.html\n\n\n## Usage\n\nSetting up automated CI/CD tasks requires 3 steps:\n\n * Set up a CI/CD action on your repository\n * Register the desired action on the CI server\n * Notify the CI server of updates\n\n\n### Setting up a CI/CD action on your repository\n\nWhen using CI services like GitHub Actions you would define your CI/CD\nactions at `.github/workflows`. In this case you are free to define\nthem wherever you want as long as it is coherent with what will be\nregistered on the CI server. As an example, our repository could have\na file `.actions/deploy.sh` like:\n\n```\n#!/usr/bin/env bash\n\nmkdir -p tmp\necho \"FROM alpine:3.17\" \u003e ./tmp/Dockerfile\n\nbash ${BASH_CI_DIR}/with_dockerfile --verbose \\\n     --build-path ./tmp \\\n     --task-id 'deploy' \\\n     sh -c 'build ...'\n\nrsync build remote-ip:/deploy\n```\n\nThe action script is guaranteed to run at the root of your repository\nchecked out at the commit that triggered the action.\n\nVariables that are available to the script:\n\n * BASH_CI_DIR: Directory with scripts like `with_dockerfile`. See\n   [iinm's repository][1] for more information on what they can do.\n\n\n### Registering the desired action on the CI server\n\nThe CI server will receive the update notifications from the git\nserver and act upon them in accordance with what's defined in files\ncalled `hooks.ltsv`. These files reside at the CI server at the\nlocation defined by HOOKS_DIR (by default this is\n`/srv/bash-ci/hooks`). For each registered repository there will be a\nsub-folder named after an ID of your choosing, e.g. 'repository.git',\nand the relevant `hooks.ltsv` file for this repository shall be within\nit.\n\nFollowing on with the example, the CI server would have a file\n`/srv/bash-ci/hooks/repository.git/hooks.ltsv` like (note there should\nbe tabs between each field):\n\n```\nhook_id:deploy    refs_pattern:master    cmd:bash .actions/deploy.sh\n```\n\nFrom [iinm's][3]:\n\n * `hook_id`: Unique ID (Used as a part of log file name)\n * `refs_pattern`: pattern to filter branches or tags\n * `cmd` : Command you want to execute when branch is pushed\n\n[3]: https://github.com/iinm/bash-ci#git\n\n\n### Notifying the CI server of updates\n\nThe CI server listens for notifications in the form of 4 fields,\nseparated by space or tab and with a new line at the end:\n\n```\n\u003cREPO-ID\u003e   \u003cURL\u003e  \u003cSHA-1\u003e   \u003cREF\u003e\n```\n\n 1. Repository ID: Can be anything but must uniquely identify a\n    particular repository. Must match that expected by the CI server\n    in order to locate the relevant `hooks.ltsv` file\n    (e.g. 'repository.git')\n\n 2. Repository URL: The URL that allows fetching this repository. The\n    CI server will attempt to clone this repository\n    (e.g. 'https://example.com/user/repository.git')\n\n 3. Commit ID: 40 hexadecimal characters that identify the Git commit\n    that triggers the action. The CI server will checkout the\n    repository at this commit\n    (e.g. '1a410efbd13591db07496601ebc7a059dd55cfe9')\n\n 4. Ref: Git reference for this commit (e.g. 'refs/heads/master')\n\n\nAs an example, we could set up a post-receive hook in a git server to\ndeliver this notification. Following on in our example we would have a\nfile `/srv/git/repository.git/hooks/post-receive` like:\n\n```\n#!/bin/sh\n\nrepo_id=\"repository.git\"\nurl=\"https://example.com/user/repository.git\"\n\nwhile read -r old_sha new_sha ref; do\n    echo -e \"${repo_id}\\t${url}\\t${new_sha}\\t${ref}\" | \\\n        nc ci.example.com 1337\ndone\n```\n\nNote that in this case the notification is sent using the `nc` command\nwhich is usually installed by default on Linux distributions. For\nthis, the CI server URL and the port where it listens (1337 by\ndefault) are required.\n\nSee [official Git documentation][4] for more information about the\npost-receive server hook and how it is intended to work.\n\n[4]: https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks\n\n\n### Example configuration\n\nExample configuration for this CI server running alongside a [git\nserver][5].\n\n```\nservices:\n  git-server:\n    # git server configuration\n\n  bash-ci:\n    image: rockstorm/bash-ci-server\n\n    environment:\n      # Must match the locations defined below\n      JOBS_DIR: /tmp/bash-ci\n\n    volumes:\n      - ./hooks:/srv/bash-ci/hooks:ro\n\n      # Volume to make job logs persistent\n      - ci-logs:/srv/bash-ci/logs\n\n      # Required to be able to run Docker containers\n      - /tmp/bash-ci:/tmp/bash-ci\n      - /var/run/docker.sock:/var/run/docker.sock\n```\n\n\n## Disclaimer\n\nNote that, at the current stage, no authentication mechanism is\nimplemented. This server is **not** suitable to be exposed to the\ninternet. User caution is advised.\n\nIn the examples above the host's Docker socket is shared with the CI\nserver. Doing this has security implications since the CI server user\nwill be able to run and have access to _any_ and _all_ containers on\nthe host.\n\n\n## Tags and Variants\n\nThis image uses the stable Alpine image.\n\n - **'X.Y-bZ'**: Immutable tag. Points to a specific image build and will\n   not be reused.\n\n - **'X.Y'**: Stable tag for specific Git major and minor versions. It\n   follows the latest build for Git version X.Y and therefore changes\n   on every patch change (i.e. 1.2.3 to 1.2.4), on every change on\n   Nginx and every change on the base Alpine image.\n\n - **'latest'**: This tag follows the very latest build regardless any\n   major/minor versions.\n\n\n## See Also\n\n * [git-server][5]: A lightweight, simple to configure git server\n   over SSH.\n * [gitweb][6]: A lightweight git repositories server over HTTP.\n * If you need something more elaborated, have a look at [Woodpecker\n   CI][7].\n\n[5]: https://github.com/rockstorm101/git-server-docker\n[6]: https://github.com/rockstorm101/gitweb-docker\n[7]: https://woodpecker-ci.org/\n\n## License\n\nView [license information][8] for the software contained in this\nimage.\n\nAs with all Docker images, these likely also contain other software\nwhich may be under other licenses (such as bash, etc from the base\ndistribution, along with any direct or indirect dependencies of the\nprimary software being contained).\n\nAs for any pre-built image usage, it is the image user's\nresponsibility to ensure that any use of this image complies with any\nrelevant licenses for all software contained within.\n\n[8]: https://github.com/rockstorm101/bash-ci-server/blob/master/LICENSE\n\n\n[b3]: https://img.shields.io/github/v/release/rockstorm101/bash-ci-server?include_prereleases\u0026label=version\n[b1]: https://img.shields.io/github/actions/workflow/status/rockstorm101/bash-ci-server/test-build.yml?branch=master\n[b2]: https://img.shields.io/docker/image-size/rockstorm/bash-ci-server?logo=docker\n[bl]: https://hub.docker.com/r/rockstorm/bash-ci-server\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frockstorm101%2Fbash-ci-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frockstorm101%2Fbash-ci-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frockstorm101%2Fbash-ci-server/lists"}