{"id":18408398,"url":"https://github.com/pingcap/cloud-assets-utils","last_synced_at":"2026-02-19T04:32:24.426Z","repository":{"id":53717021,"uuid":"239953634","full_name":"pingcap/cloud-assets-utils","owner":"pingcap","description":"Cloud assets utils by PingCAP FE.","archived":false,"fork":false,"pushed_at":"2021-03-18T12:51:44.000Z","size":72,"stargazers_count":3,"open_issues_count":0,"forks_count":4,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-10-11T13:41:27.761Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"OCaml","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/pingcap.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":"2020-02-12T07:41:01.000Z","updated_at":"2025-02-08T13:58:46.000Z","dependencies_parsed_at":"2022-09-11T13:23:17.354Z","dependency_job_id":null,"html_url":"https://github.com/pingcap/cloud-assets-utils","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/pingcap/cloud-assets-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pingcap%2Fcloud-assets-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pingcap%2Fcloud-assets-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pingcap%2Fcloud-assets-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pingcap%2Fcloud-assets-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pingcap","download_url":"https://codeload.github.com/pingcap/cloud-assets-utils/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pingcap%2Fcloud-assets-utils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29603075,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T04:01:40.476Z","status":"ssl_error","status_checked_at":"2026-02-19T04:01:12.960Z","response_time":117,"last_error":"SSL_read: 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":[],"created_at":"2024-11-06T03:18:58.247Z","updated_at":"2026-02-19T04:32:24.410Z","avatar_url":"https://github.com/pingcap.png","language":"OCaml","readme":"# cloud-assets-utils\n\nCloud assets utils by PingCAP FE.\n\nIts main purpose is to unify the operation of Qiniu and AWS S3.\n\n![OCaml Version](https://img.shields.io/badge/OCaml-4.10.0-000?logo=ocaml)\n![Upload changed files to Qiniu and AWS S3](https://github.com/pingcap/cloud-assets-utils/workflows/Upload%20changed%20files%20to%20Qiniu%20and%20AWS%20S3/badge.svg)\n[![CircleCI](https://circleci.com/gh/pingcap/cloud-assets-utils.svg?style=svg)](https://circleci.com/gh/pingcap/cloud-assets-utils)\n\n- [How to use](#how-to-use)\n  - [Use in CI](#use-in-ci)\n  - [Install and configure qshell](#install-and-configure-qshell)\n  - [Install and configure awscli](#install-and-configure-awscli)\n  - [Install cloud_assets_utils](#install-cloud_assets_utils)\n- [Use it](#use-it)\n- [All subcommands](#all-subcommands)\n- [Verify And Sync](#verify-and-sync)\n  - [Replace first path to](#replace-first-path-to)\n  - [CDN refresh](#cdn-refresh)\n- [License](#license)\n\n## How to use\n\n### Use in CI\n\nThis tool is usually used in CI. You can find binaries in [Release](https://github.com/pingcap/cloud-assets-utils/releases). Download and use it.\n\nAlso, we test it in circleci and GitHub actions. View these files for more details:\n\n- [.circleci/config.yml](https://github.com/pingcap/cloud-assets-utils/blob/master/.circleci/config.yml)\n- [.github/workflows/test.yml](https://github.com/pingcap/cloud-assets-utils/blob/master/.github/workflows/test.yml)\n- [use-in-github-actions-template.yml](https://github.com/pingcap/cloud-assets-utils/blob/master/use-in-github-actions-template.yml)\n\nIf you want to use it in a local machine. Please read below carefully.\n\n### Install and configure qshell\n\nThe [qshell](https://github.com/qiniu/qshell) we used is `v2.4.2`:\n\n```sh\nqshell account AccessKey SecretKey Name\n```\n\nCheck qshell's configuration:\n\n```sh\nqshell account\nqshell buckets # list all buckets\n```\n\n### Install and configure awscli\n\n```sh\npip install awscli\n```\n\nThe version we used is `aws-cli/1.18.105 Python/3.7.6 Darwin/19.6.0 botocore/1.17.28`:\n\n```sh\naws configure\n```\n\nCheck awscli's configuration:\n\n```sh\naws configure list\n```\n\n### Install cloud_assets_utils\n\nInstall OCaml and Opam:\n\n\u003chttp://ocaml.org/docs/install.html\u003e\n\nInstall dependencies:\n\n```sh\nopam install dune core\n\n# For development (Optional)\nopam install merlin ocp-indent utop ocamlformat\n```\n\nBuild by dune:\n\n```sh\ndune build\n```\n\nThe output file can be executed by:\n\n```sh\n./_build/default/bin/cloud_assets_utils.exe help\n```\n\nOr merge two commands to one:\n\n```sh\ndune exec -- bin/cloud_assets_utils.exe help\n```\n\n## Use it\n\nType `cloud_assets_utils help`:\n\n```sh\nCloud assets utils by PingCAP FE.\n\n  cloud_assets_utils.exe SUBCOMMAND\n\nhttps://github.com/pingcap/cloud-assets-utils\nversion:0.2.2 (2020-07-27)\n\n=== subcommands ===\n\n  aws-buckets      Run `aws s3 ls`\n  aws-delete       AWS CLI S3 Delete\n  aws-upload       AWS CLI S3 Upload\n  aws-version      Run `aws --version`\n  qshell-buckets   Run `qshell buckets`\n  qshell-delete    Qshell Delete\n  qshell-upload    Qshell Upload\n  qshell-version   Run `qshell --version`\n  verify           Verify changed files from HEAD\n  verify-and-sync  Verify changed files from HEAD and sync to oss\n  version          print version information\n  help             explain a given subcommand (perhaps recursively)\n```\n\nYou can use the commands according to your needs.\n\nFor example, type `cloud_assets_utils qshell-upload -h`:\n\n```sh\nQshell Upload\n\n  cloud_assets_utils.exe qshell-upload FILENAME\n\n=== flags ===\n\n  -bucket Specify                   the bucket name\n  [-overwrite Overwrite]            exist file or not\n  [-replace-first-path-to Replace]  first path to\n  [-help]                           print this help text and exit\n                                    (alias: -?)\n```\n\n## All subcommands\n\n| Command         | Action                                                  |\n| --------------- | ------------------------------------------------------- |\n| aws-buckets     | Same as `aws s3 ls`                                     |\n| aws-delete      | Delete a file or a folder                               |\n| aws-upload      | Upload a file or a folder                               |\n| aws-version     | Same as `aws --version`                                 |\n| qshell-buckets  | Same as `qshell buckets`                                |\n| qshell-delete   | Delete a file                                           |\n| qshell-upload   | Upload a file or all files in a folder                  |\n| qshell-version  | Same as `qshell -v`                                     |\n| verify          | Same as `git --no-pager show --pretty=\"\" --name-status` |\n| verify-and-sync | `verify` and sync to oss (qiniu, aws s3)                |\n\n## Verify and Sync\n\nThis subcommand verify the last git commit files in a specific folder and sync the changes to oss.\n\nSupported changes: **Added**, **Modified** and **Deleted**.\n\n```sh\nVerify changed files from HEAD and sync to oss\n\n  cloud_assets_utils.exe verify-and-sync DIR\n\n=== flags ===\n\n  [-aws Sync]                       files to aws\n  [-aws-bucket Specify]             the aws bucket\n  [-cdn-refresh Refresh]            cdn caches with\n  [-qiniu Sync]                     files to qiniu\n  [-qiniu-bucket Specify]           the qiniu bucket\n  [-replace-first-path-to Replace]  first path to\n  [-help]                           print this help text and exit\n                                    (alias: -?)\n```\n\nif you want to sync to aws, pass `-aws true -aws-bucket bucket` after `cloud_assets_utils verify-and-sync`.\n\nQiniu is the same.\n\n### Replace first path to\n\nThe `-replace-first-path-to` replace the files' first path, for example:\n\n`cloud_assets_utils verify-and-sync media -replace-first-path-to pingcap/test`\n\nwill replace `media/a.png` to `pingcap/test/a.png`.\n\n### CDN refresh\n\n\u003e Note: only for Qiniu\n\nQiniu will cache the most recent upload files so maybe you need to refresh it to make it at the latest.\n\nPass `-cdn-refresh URL_PRIFIX` to take its effect on the modified files.\n\n## License\n\nUnder Apache 2.0 license.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpingcap%2Fcloud-assets-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpingcap%2Fcloud-assets-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpingcap%2Fcloud-assets-utils/lists"}