{"id":19107234,"url":"https://github.com/govtechsg/teamcity-s3-backup","last_synced_at":"2026-05-29T19:30:18.134Z","repository":{"id":74216806,"uuid":"80694311","full_name":"GovTechSG/teamcity-s3-backup","owner":"GovTechSG","description":"Ansible playbook to backup Teamcity to S3","archived":false,"fork":false,"pushed_at":"2018-09-05T05:56:38.000Z","size":12,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-01-03T03:13:01.356Z","etag":null,"topics":["ansible","backup-teamcity","playbook","s3","teamcity"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GovTechSG.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":"2017-02-02T04:49:37.000Z","updated_at":"2018-09-05T05:56:37.000Z","dependencies_parsed_at":"2023-07-10T12:34:11.294Z","dependency_job_id":null,"html_url":"https://github.com/GovTechSG/teamcity-s3-backup","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GovTechSG%2Fteamcity-s3-backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GovTechSG%2Fteamcity-s3-backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GovTechSG%2Fteamcity-s3-backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GovTechSG%2Fteamcity-s3-backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GovTechSG","download_url":"https://codeload.github.com/GovTechSG/teamcity-s3-backup/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240161627,"owners_count":19757861,"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":["ansible","backup-teamcity","playbook","s3","teamcity"],"created_at":"2024-11-09T04:11:43.222Z","updated_at":"2026-05-29T19:30:18.079Z","avatar_url":"https://github.com/GovTechSG.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Backup Teamcity Settings\n\n## Pre-requisites\n\n### Software on Ansible Machine\n\nYou will need the following installed on the machine:\n\n- [Ansible 2.4](https://docs.ansible.com/ansible/intro_installation.html)\n- [AWS CLI](https://github.com/aws/aws-cli)\n\n### Amazon S3\n\nYou will need to setup a S3 bucket with the appropriate settings.\n\nThen, you should create a IAM user specifically with permissions to only put objects into the bucket. An example Policy\ndocument is this:\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"1\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": [\n                \"arn:aws:s3:::YOUR-BUCKET-NAME\"\n            ]\n        },\n        {\n            \"Sid\": \"2\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:PutObject\",\n                \"s3:ListMultipartUploadParts\",\n                \"s3:AbortMultipartUpload\"\n            ],\n            \"Resource\": [\n                \"arn:aws:s3:::YOUR-BUCKET-NAME/*\"\n            ]\n        }\n    ]\n}\n```\n\n### TeamCity\n\nYou should also setup a TeamCity user solely for the purpose of trigerring and downloading backups only. The user will\nneed the `Change backup settings and control backup process` permission.\n\n### Ansible Secrets\n\nRefer to `secrets.template.yml` and fill it in. By default, the playbook will look for the secrets in `secrets.yml`, but\nyou can override it with the `secrets_file` variable.\n\n### Playbook Variables\n\nThe playbook has additional variables you can override at run time, in addition to the secrets file\nit will include. Refer to the playbook. You might want to refer to\n[variable precedence](https://docs.ansible.com/ansible/latest/playbooks_variables.html#variable-precedence-where-should-i-put-a-variable)\nto decide where to place them.\n\n## Running the entire playbook\n\nYou won't need to ask ansible to run the playbook at another host, and you can run it locally. The default invocation\nwould simply be\n\n```bash\nansible-playbook -i localhost --connection local site.yml\n```\n\nAlternatively, you can use the provided Docker Compose file to run the playbook if you have `secrets.yml`\nin the current directory:\n\n```bash\ndocker-compose up\n```\n\n### Tags\n\nThe playbook tasks occur in two separate and distinct stages that can be run independently. Each stage is tagged.\n\n- Trigger Backup on TeamCity (`trigger_backup`)\n- Download Backup from TeamCity and upload to S3 (`upload_backup`)\n\nFor instance, to only trigger backup, do\n\n```bash\nansible-playbook -i localhost --connection local site.yml --skip-tags upload_backup\n```\n\nIf you just want to upload a backup to S3, you will need to know the name of the backup and then do:\n\n```bash\nansible-playbook -i localhost --connection local site.yml \\\n  -e \"{'teamcity': { 'backup_name': 'TeamCity_Backup_2017-02-02T05-28-36Z_20170202_052905.zip'}}\" \\\n  --skip-tags trigger_backup\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgovtechsg%2Fteamcity-s3-backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgovtechsg%2Fteamcity-s3-backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgovtechsg%2Fteamcity-s3-backup/lists"}