Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Commit

Permalink
Merge pull request #7220 from alphagov/split-audit-tool-enable-prod
Browse files Browse the repository at this point in the history
Enable Content Audit Tool for production
  • Loading branch information
chao-xian committed Feb 6, 2018
2 parents e35de4c + 5369226 commit 1f0d273
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 58 deletions.
2 changes: 0 additions & 2 deletions hieradata/production.yaml
Expand Up @@ -72,8 +72,6 @@ base::supported_kernel::enabled: false

environment_ip_prefix: '10.3'

govuk::apps::content_audit_tool::ensure: 'absent'

govuk::apps::asset_manager::aws_s3_bucket_name: 'govuk-assets-production'
govuk::apps::asset_manager::aws_region: 'eu-west-1'
govuk::apps::content_store::performance_platform_big_screen_view_url: 'https://performance-platform-big-screen-view-production.cloudapps.digital'
Expand Down
106 changes: 50 additions & 56 deletions modules/govuk/manifests/apps/content_audit_tool.pp
Expand Up @@ -4,9 +4,6 @@
#
# === Parameters
#
# [*ensure*]
# Whether the application should be exist. Can be specified for each
# environment using deployment hieradata.
#
# [*db_hostname*]
# The hostname of the database server to use in the DATABASE_URL.
Expand Down Expand Up @@ -65,7 +62,6 @@
# The URL used by Sentry to report exceptions
#
class govuk::apps::content_audit_tool(
$ensure = 'present',
$db_hostname = undef,
$db_name = 'content_audit_tool_production',
$db_password = undef,
Expand All @@ -86,72 +82,70 @@
$app_name = 'content-audit-tool'

govuk::app { $app_name:
ensure => $ensure,
app_type => 'rack',
port => $port,
sentry_dsn => $sentry_dsn,
health_check_path => '/',
asset_pipeline => true,
}

if $ensure == 'present' {
Govuk::App::Envvar {
app => $app_name,
}
Govuk::App::Envvar {
app => $app_name,
}

govuk::procfile::worker { "${app_name}-google-analytics-worker":
enable_service => $enable_procfile_worker,
setenv_as => $app_name,
process_type => 'google-analytics-worker',
}
govuk::procfile::worker { "${app_name}-google-analytics-worker":
enable_service => $enable_procfile_worker,
setenv_as => $app_name,
process_type => 'google-analytics-worker',
}

govuk::procfile::worker { "${app_name}-publishing-api-worker":
enable_service => $enable_procfile_worker,
setenv_as => $app_name,
process_type => 'publishing-api-worker',
}
govuk::procfile::worker { "${app_name}-publishing-api-worker":
enable_service => $enable_procfile_worker,
setenv_as => $app_name,
process_type => 'publishing-api-worker',
}

govuk::app::envvar {
"${title}-GOOGLE_ANALYTICS_GOVUK_VIEW_ID":
varname => 'GOOGLE_ANALYTICS_GOVUK_VIEW_ID',
value => $google_analytics_govuk_view_id;
"${title}-GOOGLE_PRIVATE_KEY":
varname => 'GOOGLE_PRIVATE_KEY',
value => $google_private_key;
"${title}-GOOGLE_CLIENT_EMAIL":
varname => 'GOOGLE_CLIENT_EMAIL',
value => $google_client_email;
"${title}-OAUTH_ID":
varname => 'OAUTH_ID',
value => $oauth_id;
"${title}-OAUTH_SECRET":
varname => 'OAUTH_SECRET',
value => $oauth_secret;
"${title}-PUBLISHING_API_BEARER_TOKEN":
varname => 'PUBLISHING_API_BEARER_TOKEN',
value => $publishing_api_bearer_token;
}
govuk::app::envvar {
"${title}-GOOGLE_ANALYTICS_GOVUK_VIEW_ID":
varname => 'GOOGLE_ANALYTICS_GOVUK_VIEW_ID',
value => $google_analytics_govuk_view_id;
"${title}-GOOGLE_PRIVATE_KEY":
varname => 'GOOGLE_PRIVATE_KEY',
value => $google_private_key;
"${title}-GOOGLE_CLIENT_EMAIL":
varname => 'GOOGLE_CLIENT_EMAIL',
value => $google_client_email;
"${title}-OAUTH_ID":
varname => 'OAUTH_ID',
value => $oauth_id;
"${title}-OAUTH_SECRET":
varname => 'OAUTH_SECRET',
value => $oauth_secret;
"${title}-PUBLISHING_API_BEARER_TOKEN":
varname => 'PUBLISHING_API_BEARER_TOKEN',
value => $publishing_api_bearer_token;
}

govuk::app::envvar::redis { $app_name:
host => $redis_host,
port => $redis_port,
}
govuk::app::envvar::redis { $app_name:
host => $redis_host,
port => $redis_port,
}

if $secret_key_base != undef {
govuk::app::envvar { "${title}-SECRET_KEY_BASE":
varname => 'SECRET_KEY_BASE',
value => $secret_key_base,
}
if $secret_key_base != undef {
govuk::app::envvar { "${title}-SECRET_KEY_BASE":
varname => 'SECRET_KEY_BASE',
value => $secret_key_base,
}
}

if $::govuk_node_class !~ /^development$/ {
govuk::app::envvar::database_url { $app_name:
type => 'postgresql',
username => $db_username,
password => $db_password,
host => $db_hostname,
database => $db_name,
}
if $::govuk_node_class !~ /^development$/ {
govuk::app::envvar::database_url { $app_name:
type => 'postgresql',
username => $db_username,
password => $db_password,
host => $db_hostname,
database => $db_name,
}
}

}

0 comments on commit 1f0d273

Please sign in to comment.