{"id":17489645,"url":"https://github.com/bozdoz/fabric-deployment","last_synced_at":"2026-01-05T01:32:01.465Z","repository":{"id":74096685,"uuid":"198002910","full_name":"bozdoz/fabric-deployment","owner":"bozdoz","description":"Deploy with fabric","archived":false,"fork":false,"pushed_at":"2024-05-23T02:11:58.000Z","size":17,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-05-23T02:44:26.635Z","etag":null,"topics":["cicd","docker","python","python-fabric","ssh"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/bozdoz/fabric-deployment","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bozdoz.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2019-07-21T02:27:07.000Z","updated_at":"2024-05-23T02:44:30.301Z","dependencies_parsed_at":null,"dependency_job_id":"8f6fdc5e-f4b6-4dde-9172-ebff3cc8e322","html_url":"https://github.com/bozdoz/fabric-deployment","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bozdoz%2Ffabric-deployment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bozdoz%2Ffabric-deployment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bozdoz%2Ffabric-deployment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bozdoz%2Ffabric-deployment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bozdoz","download_url":"https://codeload.github.com/bozdoz/fabric-deployment/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244977003,"owners_count":20541578,"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":["cicd","docker","python","python-fabric","ssh"],"created_at":"2024-10-19T05:43:42.543Z","updated_at":"2026-01-05T01:32:01.391Z","avatar_url":"https://github.com/bozdoz.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fabric-deployment\n\nDockerfile for remote commands, CI/CD.\n\n## Usage\n\n### Run with an env file:\n\n**env**\n\n```bash\nFAB_USER=user\nFAB_HOST=12.34.567.89\n# optional CWD (defaults to \".\")\nFAB_CWD=/path/to/my/remote/repo\n# optional password\nFAB_PASSWORD=qwertydvorak\n# optional ssh keyfile (passed via volume)\nFAB_SSH_KEY=/id_rsa\n```\n\n`\u003e docker run --rm -it --env-file env bozdoz/fabric-deployment fab ls`\n\n### Run in CI/CD\n\n#### GitHub\n\nIn a workflow: \n\n```yml\njobs:\n  deploy:\n    runs-on: ubuntu-latest\n    container:\n      image: bozdoz/fabric-deployment:1.1.0\n      env:\n        FAB_CWD: ${{ secrets.FAB_CWD }}\n        FAB_HOST: ${{ secrets.FAB_HOST }}\n        FAB_PORT: ${{ secrets.FAB_PORT }}\n        FAB_USER: ${{ secrets.FAB_USER }}\n        FAB_PASSWORD: ${{ secrets.FAB_PASSWORD }}\n    steps:\n      - run: fab gitpull dockercomposebuild\n```\n\n### Passing a Private SSH KEY\n\n```bash\n\u003e docker run --rm -it \\\n  --env-file env \\\n  -v ~/.ssh/id_rsa:/id_rsa \\\n  -e FAB_SSH_KEY=/id_rsa \\\n  bozdoz/fabric-deployment fab ls\n```\n\nIf your remote user has proper permissions you can execute commands through fabric.\n\n### Troubleshooting CI/CD Pipeline\n\nYou can use `bozdoz/fabric-deployment` as a CI/CD image (In GitLab for example), but you may need to execute fab commands with the collection flag `-r /app` to tell fabric where the root fabfile is (see Dockerfile WORKDIR); however, there is a workaround in the Dockerfile: \n\n```dockerfile\n# wrap fab so that we always reference workdir\nRUN mv /usr/local/bin/fab /usr/local/bin/_fab \\\n  \u0026\u0026 echo -e '#!/bin/sh\\n_fab -r /app \"$@\"' \u003e /usr/local/bin/fab \\\n  \u0026\u0026 chmod +x /usr/local/bin/fab\n```\n\n## But Why Do Any of This?\n\nFor ease of use with CI/CD.\n\n## Commands\n\n| Command              | Description                                                         |\n| -------------------- | ------------------------------------------------------------------- |\n| apachereload         | Reloads Apache, assuming sudo permissions are setup                 |\n| djangostatic         | Runs collectstatic on a Django project                              |\n| dockercomposebuild   | Runs docker-compose up -d --build                                   |\n| dockercomposerestart | Runs docker-compose restart, which stops/starts containers          |\n| dockercomposeup      | Runs docker-compose up -d                                           |\n| gitpull              | Runs git pull                                                       |\n| gulpproduction       | Runs gulp production                                                |\n| ls                   | Runs ls for debugging purposes                                      |\n| npmbuild             | Runs npm run build                                                  |\n| npmci                | Runs npm ci                                                         |\n| npminstall           | Runs npm install                                                    |\n| put                  | Transfer files from local disk to remote server                     |\n| pwd                  | Runs pwd for debugging purposes                                     |\n| runscript            | Moves a shell script to remote CWD, executes it, and deletes it     |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbozdoz%2Ffabric-deployment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbozdoz%2Ffabric-deployment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbozdoz%2Ffabric-deployment/lists"}