From dd419ea0d66af60909cb806cfd9601e12d80d1a6 Mon Sep 17 00:00:00 2001 From: Kapil Sachdev Date: Thu, 28 Sep 2023 18:57:44 +0530 Subject: [PATCH] WEB-6415: Accept module secrets --- app/commands/content_module_cli.rb | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/app/commands/content_module_cli.rb b/app/commands/content_module_cli.rb index dc503e5..b198da8 100644 --- a/app/commands/content_module_cli.rb +++ b/app/commands/content_module_cli.rb @@ -11,7 +11,7 @@ def render end desc 'serve', 'starts local preview server' - option :dev, type: :boolean, desc: 'Run in development mode (watch robles files, not book files)' + option :dev, type: :boolean, desc: 'Run in development mode (watch robles files, not module files)' def serve fork do if options[:dev] @@ -57,7 +57,7 @@ def slides desc 'serve', 'starts local preview server' - option :dev, type: :boolean, desc: 'Run in development mode (watch robles files, not book files)' + option :dev, type: :boolean, desc: 'Run in development mode (watch robles files, not module files)' def serve fork do if options[:dev] @@ -69,6 +69,29 @@ def serve RoblesContentModuleServer.run! end + desc 'secrets [REPO]', 'configures a module repo with the necessary secrets' + long_desc <<-LONGDESC + `robles module secrets [REPO]` will upload the secrets requires to run robles on a + git repository containing a module. + + You must ensure that the required secrets are provided as environment variables + before running this command: + + GITHUB_TOKEN= + REPO_ALEXANDRIA_SERVICE_API_TOKEN_PRODUCTION= + REPO_ALEXANDRIA_SERVICE_API_TOKEN_STAGING= + REPO_AWS_ACCESS_KEY_ID_PRODUCTION= + REPO_AWS_ACCESS_KEY_ID_STAGING= + REPO_AWS_SECRET_ACCESS_KEY_PRODUCTION= + REPO_AWS_SECRET_ACCESS_KEY_STAGING= + REPO_SLACK_BOT_TOKEN= + REPO_SLACK_WEBHOOK_URL= + LONGDESC + def secrets(repo) + secrets_manager = RepoManagement::Secrets.new(repo:, mode: :content_module) + secrets_manager.apply_secrets + end + private def runner