-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
6 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
<%# | ||
This file is used by Kamal to generate the `deploy/.env` file when running `kamal envify` | ||
It is a Ruby 'ERB' template, so you can use Ruby code in it. | ||
See https://fireapp.kkbox.com/doc/tutorial_2.html for more information. | ||
%> | ||
<% `op signin --account dimagi.1password.com --raw` %> | ||
<% if $?.exitstatus == 0 %> | ||
<% vars = YAML.load(`op item get --vault "CommCare Connect" "Connect Secrets" --fields type=string,type=concealed`) %> | ||
<% for var in vars %><% if var.key?("Value") %><% if var["Value"].kind_of?(Array) %> | ||
<%= var['Label'] %>=<%= var['Value'].join(',') %> | ||
<% else %><%= var['Label'] %>=<%= var['Value'] %> | ||
<% end %><% end %><% end %> | ||
<% else raise ArgumentError, "Error getting values from 1Password" end %> | ||
<% else raise ArgumentError, "Error getting values from 1Password. Try sign in." end %> |