Compare commits

...

2 Commits

Author SHA1 Message Date
Samuel Young 0ed6c29ee8
CLDC-NONE: Add dev container to access infrastructure (#3135) 6 days ago
Samuel Young 7626b5a477
CLDC-4129: Add a default option for location search (#3126) 6 days ago
  1. 4
      app/models/form/lettings/questions/location_id_search.rb
  2. 8
      aws-devcontainer/.devcontainer/Dockerfile
  3. 6
      aws-devcontainer/.devcontainer/devcontainer.json
  4. 2
      aws-devcontainer/.gitignore
  5. 5
      aws-devcontainer/README.md
  6. 3
      aws-devcontainer/config.template

4
app/models/form/lettings/questions/location_id_search.rb

@ -16,7 +16,7 @@ class Form::Lettings::Questions::LocationIdSearch < ::Form::Question
end
def answer_options
answer_opts = {}
answer_opts = { "" => "Select an option" }
return answer_opts unless ActiveRecord::Base.connected?
Location.visible.started_in_2_weeks.select(:id, :postcode, :name).each_with_object(answer_opts) do |location, hsh|
@ -29,7 +29,7 @@ class Form::Lettings::Questions::LocationIdSearch < ::Form::Question
return {} unless lettings_log.scheme
scheme_location_ids = lettings_log.scheme.locations.visible.confirmed.pluck(:id)
answer_options.select { |k, _v| scheme_location_ids.include?(k.to_i) }.to_h
answer_options.select { |k, _v| scheme_location_ids.include?(k.to_i) or k == "" }.to_h
end
def hidden_in_check_answers?(lettings_log, _current_user = nil)

8
aws-devcontainer/.devcontainer/Dockerfile

@ -0,0 +1,8 @@
FROM homebrew/brew
RUN brew install aws-vault && brew install awscli
RUN curl "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/ubuntu_64bit/session-manager-plugin.deb" -o "session-manager-plugin.deb" && sudo dpkg -i session-manager-plugin.deb
ENV AWS_VAULT_BACKEND=file
ENV AWS_VAULT_FILE_DIR=./vault
ENV AWS_CONFIG_FILE=./config

6
aws-devcontainer/.devcontainer/devcontainer.json

@ -0,0 +1,6 @@
{
"name": "CORE aws-vault",
"build": {
"dockerfile": "Dockerfile"
}
}

2
aws-devcontainer/.gitignore vendored

@ -0,0 +1,2 @@
config
vault/*

5
aws-devcontainer/README.md

@ -0,0 +1,5 @@
# CORE AWS/AWS-vault dev container
Sets up aws CLI & aws-vault CLI, as well as config storage.
See [internal documentation](https://softwiretech.atlassian.net/wiki/spaces/Support/pages/21648277643/CORE+AWS+Tasks#Accessing-a-database) for further description on configuring this with our infrastructure.

3
aws-devcontainer/config.template

@ -0,0 +1,3 @@
[default]
region=eu-west-2
output=json
Loading…
Cancel
Save