{"id":22351894,"url":"https://github.com/screwdriver-cd/sd-local","last_synced_at":"2025-07-30T07:32:00.031Z","repository":{"id":41983348,"uuid":"234148057","full_name":"screwdriver-cd/sd-local","owner":"screwdriver-cd","description":"Screwdriver local mode","archived":false,"fork":false,"pushed_at":"2024-10-24T04:48:42.000Z","size":267,"stargazers_count":2,"open_issues_count":1,"forks_count":11,"subscribers_count":20,"default_branch":"master","last_synced_at":"2024-10-24T22:21:11.316Z","etag":null,"topics":["golang"],"latest_commit_sha":null,"homepage":"https://cd.screwdriver.cd/pipelines/4014/events","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/screwdriver-cd.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":"2020-01-15T18:41:50.000Z","updated_at":"2024-10-24T04:48:46.000Z","dependencies_parsed_at":"2023-12-28T05:23:39.204Z","dependency_job_id":"345852f2-f665-4980-bd24-353e7169aa35","html_url":"https://github.com/screwdriver-cd/sd-local","commit_stats":null,"previous_names":[],"tags_count":71,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/screwdriver-cd%2Fsd-local","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/screwdriver-cd%2Fsd-local/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/screwdriver-cd%2Fsd-local/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/screwdriver-cd%2Fsd-local/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/screwdriver-cd","download_url":"https://codeload.github.com/screwdriver-cd/sd-local/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228106386,"owners_count":17870438,"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":["golang"],"created_at":"2024-12-04T12:16:20.224Z","updated_at":"2025-07-30T07:32:00.020Z","avatar_url":"https://github.com/screwdriver-cd.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sd-local\n[![Build Status][build-image]][build-url]\n[![Latest Release][version-image]][version-url]\n[![Go Report Card][goreport-image]][goreport-url]\n\nScrewdriver local mode. See [User Guide](https://docs.screwdriver.cd/user-guide/local) for details.\n\n## Usage\n\n### Install\n\nSee [User Guide](https://docs.screwdriver.cd/user-guide/local) for instructions.\n\n#### Installing locally using homebrew\n\nTap and install `sd-local`.\n\n```bash\nbrew tap screwdriver-cd/sd-local https://github.com/screwdriver-cd/sd-local.git\nbrew install sd-local\n```\n\n### Execute\n```bash\n$ sd-local --help\nRun build instantly on your local machine with\na mostly the same environment as Screwdriver.cd's\n\nUsage:\n  sd-local [command]\n\nAvailable Commands:\n  build       Run screwdriver build.\n  config      Manage settings related to sd-local.\n  help        Help about any command\n  version     Display command's version.\n\nFlags:\n  -h, --help      help for sd-local\n  -v, --verbose   verbose output.\n\nUse \"sd-local [command] --help\" for more information about a command.\n```\n\n##### build\n```bash\n$ sd-local build --help\nRun screwdriver build of the specified job name.\n\nUsage:\n  sd-local build [job name] [flags]\n\nFlags:\n      --artifacts-dir string   Path to the host side directory which is mounted into $SD_ARTIFACTS_DIR. (default \"sd-artifacts\")\n  -e, --env stringToString     Set key and value relationship which is set as environment variables of Build Container. (\u003ckey\u003e=\u003cvalue\u003e) (default [])\n      --env-file string        Path to config file of environment variables. '.env' format file can be used.\n  -h, --help                   help for build\n  -i, --interactive            Attach the build container in interactive mode.\n  -m, --memory string          Memory limit for build container, which take a positive integer, followed by a suffix of b, k, m, g.\n      --meta string            Metadata to pass into the build environment, which is represented with JSON format\n      --meta-file string       Path to the meta file. meta file is represented with JSON format.\n      --no-image-pull          Skip container image pulls to save time.\n      --privileged             Use privileged mode for container runtime.\n  -S, --socket string          Path to the socket. It will used in build container.\n      --src-url string         Specify the source url to build.\n                               ex) git@github.com:\u003corg\u003e/\u003crepo\u003e.git[#\u003cbranch\u003e]\n                                   https://github.com/\u003corg\u003e/\u003crepo\u003e.git[#\u003cbranch\u003e]\n      --sudo                   Use sudo command for container runtime.\n      --vol string             Mount local volumes into build container. (\u003csrc\u003e:\u003cdestination\u003e) (default [])\n\n  -u, --user string            Change default build user. Default value is from container in use.\nGlobal Flags:\n  -v, --verbose   verbose output.\n```\n* There are some ways to set environment variables for a build. If the same key is set in more than one way, the priority is as follows:\n  1. `--env` or `-e` Flag\n  1. `--env-file` Flag\n  1. environment in a screwdriver.yaml\n  1. defaultEnv (e.g.: `SD_TOKEN`, `SD_API_URL`)\n\n* You can execute step commands in interactive mode.\n\n```bash\nsd-local# sdrun --help\nRun predefined steps of the specified job\n\nUsage:\n  sdrun [flags]\n  sdrun [step]\n\nFlags:\n  --help        help for sdrun\n  --list        show all steps\n  --all         run all steps\n```\n\n* You can use docker commands in the build to run containers, build images, etc.\n  * Set `screwdriver.cd/dockerEnabled: true` in the job annotations.\n```yaml\njobs:\n  main:\n    annotations:\n      screwdriver.cd/dockerEnabled: true\n```\n\n##### config\n_create_\n```bash\n$ sd-local config create --help\nCreate the config of sd-local.\nThe new config has only launcher-version and launcher-image.\n\nUsage:\n  sd-local config create [name] [flags]\n\nFlags:\n  -h, --help   help for create\n\nGlobal Flags:\n  -v, --verbose   verbose output.\n```\n\n_delete_\n```bash\n$ sd-local config delete --help\nDelete the config of sd-local.\n\nUsage:\n  sd-local config delete [name] [flags]\n\nFlags:\n  -h, --help   help for delete\n\nGlobal Flags:\n  -v, --verbose   verbose output.\n```\n\n_use_\n```bash\n$ sd-local config use --help\nUse the specified config as current config.\nYou can confirm the current config in view sub command.\n\nUsage:\n  sd-local config use [name] [flags]\n\nFlags:\n  -h, --help   help for use\n\nGlobal Flags:\n  -v, --verbose   verbose output.\n```\n\n_set_\n```bash\n$ sd-local config set --help\nSet the config of sd-local.\nCan set the below settings:\n* Screwdriver.cd API URL as \"api-url\"\n* Screwdriver.cd Store URL as \"store-url\"\n* Screwdriver.cd Token as \"token\"\n* Screwdriver.cd launcher version as \"launcher-version\"\n* Screwdriver.cd UUID as \"uuid\"\n* Screwdriver.cd launcher image as \"launcher-image\"\n\nUsage:\n  sd-local config set [key] [value] [flags]\n\nFlags:\n  -h, --help   help for set\n\nGlobal Flags:\n  -v, --verbose   verbose output.\n```\n\n_view_\n```bash\n$ sd-local config view\n  anoter:\n    api-url: \"\"\n    store-url: \"\"\n    token: \"\"\n    launcher:\n      version: stable\n      image: screwdrivercd/launcher\n* default:\n    api-url: https://api.screwdriver.cd\n    store-url: https://store.screwdriver.cd\n    token: \u003cAPI Token\u003e\n    launcher:\n      version: stable\n      image: screwdrivercd/launcher\n```\n\n##### version\n```bash\n$ sd-local version\n1.0.23\nplatform: darwin/amd64\ngo: go1.15.7\ncompiler: gc\n```\n\n##### update\n```bash\n$ sd-local update\nDo you want to update to 1.0.5? [y/N]: y\nSuccessfully updated to version 1.0.5\n```\nIf you get the following error while running the update command,\n```\nError occurred while detecting version: GET https://api.github.com/repos/screwdriver-cd/sd-local/releases: 403 API rate limit exceeded.\n```\nPlease set the [GitHub personal access token.](https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token)\n###### bash\n```bash\nexport GITHUB_TOKEN=\u003ctoken\u003e\n```\n\n## Testing\n```bash\n$ go get github.com/screwdriver-cd/sd-local\n$ go test -cover github.com/screwdriver-cd/sd-local/...\n```\n\n## FAQ\n1. How to forward your local `ssh-agent` to `sd-local` in Mac? \n\n   If your `sd-local` build needs access to ssh keys for your ssh-agent, then you can do one of the following options:\n   1. If using [Colima](https://github.com/abiosoft/colima/):\n  \n      Make sure to start Colima with ssh-agent `colima start --ssh-agent`\n      ```\n      sd-local build -i docker-build-api-pr --vol \"$HOME/.ssh/known_hosts:/root/.ssh/known_hosts\" -S $(colima ssh eval 'echo $SSH_AUTH_SOCK')\n      ```\n   2. If using [Docker Desktop](https://www.docker.com/products/docker-desktop):\n\n      Make sure to run Docker for Mac from a terminal `killall Docker \u0026\u0026 open /Applications/Docker.app`\n      \n      ```\n      sd-local build -i docker-build-api-pr --vol \"$HOME/.ssh/known_hosts:/root/.ssh/known_hosts\"\n      ```\n\n## License\nCode licensed under the BSD 3-Clause license. See [LICENSE](https://github.com/screwdriver-cd/sd-local/blob/master/LICENSE) file for terms.\n\n[version-image]: https://img.shields.io/github/tag/screwdriver-cd/sd-local.svg\n[version-url]: https://github.com/screwdriver-cd/sd-local/releases\n[build-image]: https://cd.screwdriver.cd/pipelines/4014/badge\n[build-url]: https://cd.screwdriver.cd/pipelines/4014\n[goreport-image]: https://goreportcard.com/badge/github.com/Screwdriver-cd/sd-local\n[goreport-url]: https://goreportcard.com/report/github.com/Screwdriver-cd/sd-local\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscrewdriver-cd%2Fsd-local","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscrewdriver-cd%2Fsd-local","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscrewdriver-cd%2Fsd-local/lists"}