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

Kaiserfile syntax for env vars that the kaiserfile uses #36

Open
davidsiaw opened this issue Jan 14, 2020 · 0 comments
Open

Kaiserfile syntax for env vars that the kaiserfile uses #36

davidsiaw opened this issue Jan 14, 2020 · 0 comments

Comments

@davidsiaw
Copy link
Collaborator

This seems to be a very common thing in our Kaiserfiles:

github_webhook_secret = ENV['GITHUB_WEBHOOK_SECRET'] || 'aaaaaa'
twilio_webhook_secret = ENV['TWILIO_WEBHOOK_SECRET'] || 'abcdef'
twilio_webhook_url = ENV['TWILIO_WEBHOOK_URL'] || 'https://dff80da3.ngrok.io/api/v1/webhook/twilio/sms'
ping_channel = ENV['GITHUB_PING_CHANNEL'] || 'dsiawlab'

app_params "
  -e RAILS_ENV='#{rails_env}'
  -e GITHUB_ORGANIZATION=#{github_org}
  -e GITHUB_TOKEN=#{github_token}
  -e SLACK_TOKEN=#{slack_token}
  -e GITHUB_WEBHOOK_SECRET=#{github_webhook_secret}
  -e TWILIO_WEBHOOK_SECRET=#{twilio_webhook_secret}
  -e TWILIO_WEBHOOK_URL=#{twilio_webhook_url}

We can possibly start abstracting it into a new syntax for kaiserfiles such as:

input_var :GITHUB_WEBHOOK_SECRET, default: 'aaaaaa'

Also ,typically we read Kaiser values like this:

app_params "
  -e CHROME_HOSTNAME=<%= @config[:shared_names][:chrome] %>

Also providing values can be done like this:

input_var :CHROME_HOSTNAME, default: ->{ @config[:shared_names][:chrome] }

This will add additional params to our docker run command which helps make writing Kaiserfiles easier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant