{"id":24992215,"url":"https://github.com/etcdevteam/janus","last_synced_at":"2025-04-12T02:13:39.758Z","repository":{"id":64306743,"uuid":"96564800","full_name":"ETCDEVTeam/janus","owner":"ETCDEVTeam","description":":shipit: Shared CI deployment tool","archived":false,"fork":false,"pushed_at":"2018-06-11T13:23:49.000Z","size":14704,"stargazers_count":5,"open_issues_count":4,"forks_count":3,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-12T02:13:33.000Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","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/ETCDEVTeam.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":"2017-07-07T18:20:16.000Z","updated_at":"2020-12-10T14:23:55.000Z","dependencies_parsed_at":"2023-01-15T10:45:40.936Z","dependency_job_id":null,"html_url":"https://github.com/ETCDEVTeam/janus","commit_stats":null,"previous_names":["ethereumproject/janus"],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ETCDEVTeam%2Fjanus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ETCDEVTeam%2Fjanus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ETCDEVTeam%2Fjanus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ETCDEVTeam%2Fjanus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ETCDEVTeam","download_url":"https://codeload.github.com/ETCDEVTeam/janus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248505925,"owners_count":21115354,"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":[],"created_at":"2025-02-04T13:54:33.950Z","updated_at":"2025-04-12T02:13:39.731Z","avatar_url":"https://github.com/ETCDEVTeam.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Janus is a tool for versioning and deploying builds to Google Cloud Provider (GCP) Storage from the CI\nenvironment.\n\n## Install\n\n#### CI System Requirements:\n- [ ] __JSON GCP Service Account Key__, with access to GCP _Storage_ enabled.\n- [ ] __CI environment variable `GCP_PASSWD`__ to be set if the key is encrypted.\n- [ ] __openssl__ is required for key decryption. This is standard on Travis. AppVeyor may require that you add some extra things to your `PATH`, but you may not have to install anything extra.\n- [ ] __gpg__ is required to verify the Janus binary. This is standard on Travis and AppVeyor.\n- [ ] __gpg__ can also be used for key decryption (with symmetric cipher). This solution is more portable than `openssl` encryption.\n- [ ] __rev__, __curl__, and a few other basic bash commands are required for the installer script. Standard on Travis, can be added to PATH for AppVeyor as per example below\n\n#### Install Janus:\n\n##### Travis\n```shell\n- curl -sL https://raw.githubusercontent.com/ETCDEVTeam/janus/master/get.sh | bash\n- export PATH=./janusbin:$PATH\n```\n\n##### AppVeyor\n```shell\n- set PATH=C:\\msys64\\mingw64\\bin;C:\\msys64\\usr\\bin\\;%PATH%\n- curl -sL https://raw.githubusercontent.com/ETCDEVTeam/janus/master/get-windows.sh | bash\n- set PATH=./janusbin;%PATH%\n```\n\n__Security note:__ The installer scripts `get.sh` and `get-windows.sh` will use GPG to verify the latest Janus release binary against\nthe signing GPG key downloaded from a [specific commit at ethereumproject/volunteer](https://raw.githubusercontent.com/ethereumproject/volunteer/7a78a94307d67a0b20e418568b7bccac83c3d143/Volunteer-Public-Keys/isaac.ardis%40gmail.com).\nFor an additional layer of security, you may use the provided installer script signatures (`./*.sig`) to verify the installer script itself before using Janus\nto deploy from your CI build. For maximum security, use a locally tracked version of [the signing key](https://raw.githubusercontent.com/ethereumproject/volunteer/7a78a94307d67a0b20e418568b7bccac83c3d143/Volunteer-Public-Keys/isaac.ardis%40gmail.com)\nin your own repo. Alternatively, you can mimic the installer script itself, and use `curl` to download the key from the specific commit as mentioned previously. The link is:\n\n\u003e https://raw.githubusercontent.com/ethereumproject/volunteer/7a78a94307d67a0b20e418568b7bccac83c3d143/Volunteer-Public-Keys/isaac.ardis%40gmail.com\n\nIn practice, this would look like:\n```yml\n - curl -sLO https://raw.githubusercontent.com/ethereumproject/volunteer/7a78a94307d67a0b20e418568b7bccac83c3d143/Volunteer-Public-Keys/isaac.ardis%40gmail.com\n - gpg --import isaac.ardis@gmail.com\n - curl -sLO https://raw.githubusercontent.com/ETCDEVTeam/janus/master/get.sh\n - curl -sLO https://raw.githubusercontent.com/ETCDEVTeam/janus/master/get.sh.sig\n - gpg --verify get.sh.sig get.sh\n - chmod +x get.sh\n - bash get.sh\n```\n\nNote that if you implement this additional layer and the signing key changes, you'll need to update either your tracked version of the key or download link accordingly.\n\n## Usage\nJanus has two subcommands: `deploy` and `version`.\n\n#### Deploy\nJanus can use an encrypted _or_ decrypted `.json` GCP service key file. In case of an _encrypted_ JSON key file, Janus will attempt to decrypt it using `openssl`,\nand depends on an __environment variable `GCP_PASSWD`__ to be set. After successfully decrypting the key and deploying the files, Janus will automatically destroy (`rm`) the decrypted key from the CI.\n\n| flag | example | description |\n| --- | --- | --- |\n| `-to` | `builds.etcdevteam.com/go-ethereum/v3.5.x/`| bucket, followed by 'directory' in which to hold the uploaded archive |\n| `-files` | `./dist/*.zip` | file(s) to upload, can use relative or absolute path and/or wildcard globbing |\n| `-key` | `./gcloud-travis.enc.json` | encrypted or decrypted JSON GCP service key file |\n\n```shell\n$ janus deploy -to builds.etcdevteam.com/go-ethereum/v3.5.x/ -files ./dist/*.zip -key gcloud-service-encrypted-or-decrypted.json\n\u003e Deploying...\n```\n\n#### Version\n`version` uses `git` subcommands to produce a\nversion number, as defined by `-format`\n\n```shell\n$ janus version -format='v%M.%m.%P+%C-%S'\n\u003e v3.5.0+55-asdf123\n```\n\n`-format=value` takes the interpolated forms:\n```txt\n%M, _M - major version\n%m, _m - minor version\n%P, _P - patch version\n%B, _B - hybrid patch version: `(%P * 100) + %C`\n%C, _C - commit count since last tag\n%S, _S - HEAD sha1 (first 7 characters)\n```\n_Note_: you may use either `%M` or `_M` syntax to interpolate version variables, since escaping `%` in batch scripts is rather tricky.\n\nSo this:\n\n| sed output (.txt) | format syntax |\n| --- | --- |\n| `version-base.txt` | `-format v%M.%m.x` |\n| `version-app.txt` | `-format v%M.%m.%P+%C-%S` |\n\nreplaces this:\n```yml\n- git describe --tags --always \u003e version.txt\n- sed -E 's/v([[:digit:]]+\\.[[:digit:]]+)\\.[[:digit:]]-([[:digit:]]+)-g([a-f0-9]+)/v\\1.\\2+\\3/' version.txt \u003e version-app.txt\n- sed -E 's/v([[:digit:]]+\\.[[:digit:]]+)\\.[[:digit:]]-([[:digit:]]+).+/v\\1.\\2/' version.txt \u003e version-only.txt\n- sed -E 's/v([[:digit:]]+\\.[[:digit:]]+)\\.[[:digit:]]-([[:digit:]]+).+/v\\1.x/' version.txt \u003e version-base.txt\n```\n\n## Examples and notes\nPlease visit the [/examples directory](./examples) to find example Travis and AppVeyor configuration files, deploy script, and service key.\n\n### Encrypting files\n#### With OpenSSL\nTo encrypt file with `openssl` you should use following command:\n```\nopenssl aes-256-cbc -e -in input_file.json -out output_file.json.enc\n```\n#### With GPG\nTo encrypt file with `gpg` you should use following command:\n```\ngpg --symmetric --cipher-algo AES-256 --output output_file.json.enc input_file.json\n```\nDifferent `--cipher-algo` may be used as well.\n\n### Gotchas\n\nThe same version of `openssl` should be used for file encryption and decryption.\n\n----\n\nIf you use a `script` deploy for Travis, __ensure that the deploy script is executable__, eg.\n```yml\ndeploy:\n  skip_cleanup: true\n  provider: script\n  script: ./deploy.sh # \u003c-- chmod +x\n  on:\n    branch: master\n  tags: true\n```\n\n----\n\nAn encrypted `GCP_PASSWD` _cannot_ be used between repos; __each GCP_PASSWD encryption should\nbe specific to a repo__.\n\nFor Appveyor and Travis there are two ways to establish environment\nvariables:\n\n1. In the configuration file itself, eg.\n\n```bash\n# Encrypt GCP_PASSWD for Travis\n$ travis encrypt GCP_PASSWD=abcd\n\u003e MKhc0c07V1z75sGJuZl19lM2Mj5hIXuM5DxTI1hLxz0kfOel/TZSf4557ip5Mp0MRKkgXeTlP6bJQX3taVONVTT8ZFwj9m2gbiYYuOubx5mf17Fa2YwYmQ9G7HRmMvge6ypeI1uibyOv2fUNhIMeMLhuFTgkV1pw1R/oeXTD8U7TivgYTXy8/6iDf66NPpXWZNwJ0d5GfSybiT31gglubiC9ehnmDNIgDYRlO8vr7TdB9eTkX6gEiEhdvyLBu+ljLN2VznvTQoCsByq6yUPNSKDbTodcYXfugtWpksqnsSoinlGhVAMJE2jCT71gdeMHzIgo4xYxEB6GqfbnOot5knlgBmQo7tlPHD7gfCYfdB7WWKJW9lmUAGVwpWQup+rBLbuVhKvjgeevZy/5JkGghoiPh6Mw9txy/zmTS+QwlTA9m+blZcqAksNcT0TE68dGXxpvhzI+WDu3XjhQE31VWG7daw9QyZHlhkma2xCmM1zDHvpbiyPlTSAWQyUU2TgVOs4fIlMYbV/NSkB4zWz4TvhqJHv2AtFtXw9y+xoBgd2GidKR7YtAjjBOPjb+KmyZ470nwdmoe7tCZM6Y0FLlkeVjKRxS0sD2DOheZX/gzdsQt2L8XIzjCdcp2QhV1/h5WEQop9Lm1FO/bGco/2525l2ExR7AW8Phz7ot+/mpvQA=\n```\n\n```yml\n# .travis.yml\nenv:\n  global:\n    - secure: \"MKhc0c07V1z75sGJuZl19lM2Mj5hIXuM5DxTI1hLxz0kfOel/TZSf4557ip5Mp0MRKkgXeTlP6bJQX3taVONVTT8ZFwj9m2gbiYYuOubx5mf17Fa2YwYmQ9G7HRmMvge6ypeI1uibyOv2fUNhIMeMLhuFTgkV1pw1R/oeXTD8U7TivgYTXy8/6iDf66NPpXWZNwJ0d5GfSybiT31gglubiC9ehnmDNIgDYRlO8vr7TdB9eTkX6gEiEhdvyLBu+ljLN2VznvTQoCsByq6yUPNSKDbTodcYXfugtWpksqnsSoinlGhVAMJE2jCT71gdeMHzIgo4xYxEB6GqfbnOot5knlgBmQo7tlPHD7gfCYfdB7WWKJW9lmUAGVwpWQup+rBLbuVhKvjgeevZy/5JkGghoiPh6Mw9txy/zmTS+QwlTA9m+blZcqAksNcT0TE68dGXxpvhzI+WDu3XjhQE31VWG7daw9QyZHlhkma2xCmM1zDHvpbiyPlTSAWQyUU2TgVOs4fIlMYbV/NSkB4zWz4TvhqJHv2AtFtXw9y+xoBgd2GidKR7YtAjjBOPjb+KmyZ470nwdmoe7tCZM6Y0FLlkeVjKRxS0sD2DOheZX/gzdsQt2L8XIzjCdcp2QhV1/h5WEQop9Lm1FO/bGco/2525l2ExR7AW8Phz7ot+/mpvQA=\"\n```\n\n2. In the CI GUI under _Environment_ or _Settings_. In this case you should use\nthe _unencrypted_ password. Don't worry, it won't be visible in the logs.\n\nIn both cases, environment `GCP_PASSWD` will be now available for use.\n\n----\n\n\u003e In ancient Roman religion and myth, Janus (/ˈdʒeɪnəs/; Latin: Iānus, pronounced [ˈjaː.nus]) is the god of beginnings, gates, transitions, time, duality, doorways,[1] passages, and endings.\n- https://en.wikipedia.org/wiki/Janus\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fetcdevteam%2Fjanus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fetcdevteam%2Fjanus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fetcdevteam%2Fjanus/lists"}