Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WEB-6415: Accept module secrets #215

Merged
merged 1 commit into from
Sep 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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