Skip to content

Commit

Permalink
WEB-6415: Accept module secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
KapilSachdev committed Sep 28, 2023
1 parent 123d196 commit dd419ea
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions app/commands/content_module_cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand All @@ -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
Expand Down

0 comments on commit dd419ea

Please sign in to comment.