{"id":37088349,"url":"https://github.com/heetch/s3update","last_synced_at":"2026-01-14T10:51:30.876Z","repository":{"id":57498059,"uuid":"62650904","full_name":"heetch/s3update","owner":"heetch","description":"Enable your Golang applications to self update with S3","archived":false,"fork":false,"pushed_at":"2020-08-28T10:41:24.000Z","size":14,"stargazers_count":105,"open_issues_count":3,"forks_count":20,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-08-14T04:58:29.402Z","etag":null,"topics":["go","s3","team-glue"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/heetch.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}},"created_at":"2016-07-05T16:05:45.000Z","updated_at":"2025-03-14T13:05:03.000Z","dependencies_parsed_at":"2022-08-28T14:20:59.682Z","dependency_job_id":null,"html_url":"https://github.com/heetch/s3update","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/heetch/s3update","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heetch%2Fs3update","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heetch%2Fs3update/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heetch%2Fs3update/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heetch%2Fs3update/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heetch","download_url":"https://codeload.github.com/heetch/s3update/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heetch%2Fs3update/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28417716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["go","s3","team-glue"],"created_at":"2026-01-14T10:51:30.289Z","updated_at":"2026-01-14T10:51:30.869Z","avatar_url":"https://github.com/heetch.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# s3update\n\n__Enable your Golang applications to self update with S3. Requires Go 1.8+__\n\nThis package enables our internal tools to be updated when new commits to their master branch are pushed to Github.\n\nLatest binaries are hosted on S3 under a specific bucket along its current version. When ran locally, the binary will\nfetch the version and if its local version is older than the remote one, the new binary will get fetched and will exit,\nstating to the user that it got updated and need to be ran again.\n\nIn our case, we're only shipping Linux and Darwin, targeting amd64 platform.\n\nBucket will have the following structure:\n\n```\nmybucket/\n  mytool/\n\tVERSION\n\tmytool-linux-amd64\n\tmytool-darwin-amd64\n```\n\n## Usage\n\nUpdates are easier to deal with when done through a continuous integration platform. We're using CircleCI but the following\nexcerpt can easily be adapted to whichever solution being used.\n\n### CircleCI\n\n[xgo](https://github.com/karalabe/xgo) is being used to easily cross-compile code.\n\nAdding the following at the end of the build script will push the binaries and its version to S3.\n\n```sh\nxgo --targets=\"linux/amd64,darwin/amd64\" -ldflags=\"-X main.Version=$CIRCLE_BUILD_NUM\" .\n\nif [[ \"$CIRCLE_BRANCH\" = \"master\" ]]; then\n\taws s3 cp mytool-darwin-10.6-amd64 s3://mybucket/mytool/mytool-darwin-amd64 --acl authenticated-read\n\taws s3 cp mytool-linux-amd64 s3://mybucket/mytool/mytool-linux-amd64 --acl authenticated-read\n\techo -n $CIRCLE_BUILD_NUM \u003e VERSION \u0026\u0026 aws s3 cp VERSION  s3://mybucket/mytool/VERSION --acl authenticated-read\nfi\n```\n\n### Example\n\n```go\npackage main\n\nimport (\n\t\"github.com/heetch/s3update\"\n)\n\nvar (\n\t// This gets set during the compilation. See below.\n\tVersion = \"\"\n)\n\nfunc main() {\n\terr := s3update.AutoUpdate(s3update.Updater{\n\t\tCurrentVersion: Version,\n\t\tS3Bucket:       \"mybucket\",\n\t\tS3Region:       \"eu-west-1\",\n\t\tS3ReleaseKey:   \"mytool/mytool-{{OS}}-{{ARCH}}\",\n\t\tS3VersionKey:   \"mytool/VERSION\",\n\t})\n\n  if err != nil {\n    // ...\n  }\n\n  ...\n}\n```\n\nBinary must be compiled with a flag specifying the new version:\n\n```sh\ngo build -ldflags \"-X main.Version=111\" main.go\n```\n\n## Contributions\n\nAny contribution is welcomed!\n\n- Open an issue if you want to discuss bugs/features\n- Open Pull Requests if you want to contribute to the code\n\n## Copyright\n\nCopyright © 2016 Heetch\n\nSee the [LICENSE](https://github.com/heetch/s3update/blob/master/LICENSE) (MIT) file for more details.\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheetch%2Fs3update","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheetch%2Fs3update","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheetch%2Fs3update/lists"}