Skip to content

Commit

Permalink
Merge pull request #813 from Vizzuality/release/home-updated
Browse files Browse the repository at this point in the history
Release: New Homepage
  • Loading branch information
simaob authored Mar 21, 2019
2 parents 9a6f6b6 + 4d9389b commit 0195a33
Show file tree
Hide file tree
Showing 322 changed files with 17,320 additions and 1,813 deletions.
23 changes: 14 additions & 9 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
APP_NAME=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_REGION=
S3_BUCKET_NAME=
CW_FILES_PREFIX=climatewatch.org/staging.climatewatch.org/climate-watch/
POSTGRES_URL=
SHARED_POSTGRES_URL=
ESP_API=
CW_FILES_PREFIX=
CW_API=
DEV_USER_ID=
DEV_USER_TOKEN=
ESP_API=
GFW_API=
DEV_USER_ID=DEV_USER_ID_PLACEHOLDER
DEV_USER_TOKEN=DEV_USER_TOKEN_PLACEHOLDER
GOOGLE_ANALYTICS_ID=
USER_REPORT_KEY=
IPSTACK_GEOLOCATION_API_KEY=
POSTGRES_URL=
S3_BUCKET_NAME=
USER_SURVEY_SPREADSHEET_URL=
IPSTACK_GEOLOCATION_API_KEY=


FEATURE_AGRICULTURE=


FEATURE_DATA_EXPLORER=
FEATURE_DATA_SURVEY=
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ ENV S3_BUCKET_NAME wri-sites

ENV GOOGLE_ANALYTICS_ID UA-1981881-51

ARG FEATURE_AGRICULTURE
ENV FEATURE_AGRICULTURE $FEATURE_AGRICULTURE

ARG USER_REPORT_KEY
ENV USER_REPORT_KEY $USER_REPORT_KEY

# Install dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
Expand Down Expand Up @@ -58,6 +64,9 @@ ENV APPSIGNAL_PUSH_API_KEY $APPSIGNAL_PUSH_API_KEY
ARG USER_SURVEY_SPREADSHEET_URL
ENV USER_SURVEY_SPREADSHEET_URL $USER_SURVEY_SPREADSHEET_URL

ARG IPSTACK_GEOLOCATION_API_KEY
ENV IPSTACK_GEOLOCATION_API_KEY $IPSTACK_GEOLOCATION_API_KEY

# Bundle app source
COPY . ./

Expand Down
1 change: 1 addition & 0 deletions Dockerfile-dev
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ ENV CW_API /api/v1
ENV ESP_API https://data.emissionspathways.org/api/v1
ENV S3_BUCKET_NAME climate-watch-dev
ENV GOOGLE_ANALYTICS_ID UA-1981881-51
ENV USER_REPORT_KEY 5fe46fa7-c7e6-40e6-8e48-37479c4599f1

# Install dependencies
RUN apt-get update \
Expand Down
5 changes: 3 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ git_source(:github) do |repo_name|
end

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '5.2'
gem 'rails', '5.2.2'
gem 'bootsnap'

gem 'sprockets', '~> 3.7.2'
Expand Down Expand Up @@ -100,7 +100,8 @@ end
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

git 'https://github.com/ClimateWatch-Vizzuality/climate-watch-gems.git' do
gem 'cw_data_uploader', '~> 0.4.2', require: 'data_uploader'
gem 'cw_data_uploader', '~> 0.4.3', require: 'data_uploader'
gem 'climate_watch_engine', '~> 1.4.3'
end

# for debugging
Expand Down
103 changes: 52 additions & 51 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
GIT
remote: https://github.com/ClimateWatch-Vizzuality/climate-watch-gems.git
revision: f72b6b06a989d1c3c92f4864f03f689f9d7d04ba
revision: a5590a5bcda709af9541c9125032372f05e55413
specs:
climate_watch_engine (1.4.1)
climate_watch_engine (1.4.3)
aws-sdk-s3 (~> 1)
rails (~> 5.2.0)
cw_data_uploader (0.4.2)
cw_data_uploader (0.4.3)
activeadmin
aws-sdk-rails (~> 2)
aws-sdk-s3 (~> 1)
Expand All @@ -18,25 +18,25 @@ GIT
GEM
remote: https://rubygems.org/
specs:
actioncable (5.2.0)
actionpack (= 5.2.0)
actioncable (5.2.2)
actionpack (= 5.2.2)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailer (5.2.0)
actionpack (= 5.2.0)
actionview (= 5.2.0)
activejob (= 5.2.0)
actionmailer (5.2.2)
actionpack (= 5.2.2)
actionview (= 5.2.2)
activejob (= 5.2.2)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (5.2.0)
actionview (= 5.2.0)
activesupport (= 5.2.0)
actionpack (5.2.2)
actionview (= 5.2.2)
activesupport (= 5.2.2)
rack (~> 2.0)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.2.0)
activesupport (= 5.2.0)
actionview (5.2.2)
activesupport (= 5.2.2)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
Expand All @@ -58,20 +58,20 @@ GEM
ransack (>= 1.8.7)
sass (~> 3.1)
sprockets (< 4.1)
activejob (5.2.0)
activesupport (= 5.2.0)
activejob (5.2.2)
activesupport (= 5.2.2)
globalid (>= 0.3.6)
activemodel (5.2.0)
activesupport (= 5.2.0)
activerecord (5.2.0)
activemodel (= 5.2.0)
activesupport (= 5.2.0)
activemodel (5.2.2)
activesupport (= 5.2.2)
activerecord (5.2.2)
activemodel (= 5.2.2)
activesupport (= 5.2.2)
arel (>= 9.0)
activestorage (5.2.0)
actionpack (= 5.2.0)
activerecord (= 5.2.0)
activestorage (5.2.2)
actionpack (= 5.2.2)
activerecord (= 5.2.2)
marcel (~> 0.3.1)
activesupport (5.2.0)
activesupport (5.2.2)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
Expand Down Expand Up @@ -130,7 +130,7 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.12.2)
concurrent-ruby (1.1.3)
concurrent-ruby (1.1.4)
connection_pool (2.2.2)
crack (0.4.3)
safe_yaml (~> 1.0.0)
Expand All @@ -147,7 +147,7 @@ GEM
dotenv-rails (2.5.0)
dotenv (= 2.5.0)
railties (>= 3.2, < 6.0)
erubi (1.7.1)
erubi (1.8.0)
execjs (2.7.0)
factory_bot (4.11.1)
activesupport (>= 3.0.0)
Expand All @@ -160,13 +160,13 @@ GEM
formtastic (3.1.5)
actionpack (>= 3.2.13)
formtastic_i18n (0.6.0)
globalid (0.4.1)
globalid (0.4.2)
activesupport (>= 4.2.0)
has_scope (0.7.2)
actionpack (>= 4.1)
activesupport (>= 4.1)
hashdiff (0.3.7)
i18n (1.1.1)
i18n (1.5.3)
concurrent-ruby (~> 1.0)
inherited_resources (1.9.0)
actionpack (>= 4.2, < 5.3)
Expand Down Expand Up @@ -207,15 +207,15 @@ GEM
marcel (0.3.3)
mimemagic (~> 0.3.2)
method_source (0.9.2)
mimemagic (0.3.2)
mimemagic (0.3.3)
mini_mime (1.0.1)
mini_portile2 (2.3.0)
mini_portile2 (2.4.0)
minitest (5.11.3)
msgpack (1.2.4)
multipart-post (2.0.0)
nio4r (2.3.1)
nokogiri (1.8.5)
mini_portile2 (~> 2.3.0)
nokogiri (1.10.1)
mini_portile2 (~> 2.4.0)
oj (3.6.8)
orm_adapter (0.5.0)
parallel (1.12.1)
Expand All @@ -236,18 +236,18 @@ GEM
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (5.2.0)
actioncable (= 5.2.0)
actionmailer (= 5.2.0)
actionpack (= 5.2.0)
actionview (= 5.2.0)
activejob (= 5.2.0)
activemodel (= 5.2.0)
activerecord (= 5.2.0)
activestorage (= 5.2.0)
activesupport (= 5.2.0)
rails (5.2.2)
actioncable (= 5.2.2)
actionmailer (= 5.2.2)
actionpack (= 5.2.2)
actionview (= 5.2.2)
activejob (= 5.2.2)
activemodel (= 5.2.2)
activerecord (= 5.2.2)
activestorage (= 5.2.2)
activesupport (= 5.2.2)
bundler (>= 1.3.0)
railties (= 5.2.0)
railties (= 5.2.2)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.2)
actionpack (~> 5.x, >= 5.0.1)
Expand All @@ -258,12 +258,12 @@ GEM
nokogiri (>= 1.6)
rails-html-sanitizer (1.0.4)
loofah (~> 2.2, >= 2.2.2)
railties (5.2.0)
actionpack (= 5.2.0)
activesupport (= 5.2.0)
railties (5.2.2)
actionpack (= 5.2.2)
activesupport (= 5.2.2)
method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
thor (>= 0.19.0, < 2.0)
rainbow (3.0.0)
rake (12.3.2)
ransack (2.1.1)
Expand Down Expand Up @@ -395,8 +395,9 @@ DEPENDENCIES
bootsnap
byebug
capybara (~> 2.13)
climate_watch_engine (~> 1.4.3)!
coffee-rails (~> 4.2)
cw_data_uploader (~> 0.4.2)!
cw_data_uploader (~> 0.4.3)!
devise
dotenv-rails
factory_bot_rails
Expand All @@ -408,7 +409,7 @@ DEPENDENCIES
pg (~> 0.20)
pg_search
puma (~> 3.7)
rails (= 5.2)
rails (= 5.2.2)
rails-controller-testing
rspec-collection_matchers
rspec-rails (~> 3.5)
Expand All @@ -435,4 +436,4 @@ RUBY VERSION
ruby 2.5.1p57

BUNDLED WITH
1.16.4
1.17.2
20 changes: 13 additions & 7 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,29 @@ node {
checkout scm
properties([pipelineTriggers([[$class: 'GitHubPushTrigger']])])

def cw_files_prefix = (env.BRANCH_NAME == 'master') ? 'climatewatch.org/www.climatewatch.org/climate-watch/' : 'climatewatch.org/staging.climatewatch.org/climate-watch/'
def cw_files_prefix = 'climatewatch.org/staging.climatewatch.org/climate-watch/'
def user_report_key = 'cf0fa021-d239-457b-bb99-e9ab0205134c'

if (env.BRANCH_NAME == 'master') {
cw_files_prefix = 'climatewatch.org/www.climatewatch.org/climate-watch/'
user_report_key = '5fe46fa7-c7e6-40e6-8e48-37479c4599f1'
}

try {

stage ('Build docker') {
switch ("${env.BRANCH_NAME}") {
case "master":
sh("docker -H :2375 build --build-arg RAILS_ENV=production --build-arg secretKey=${secretKey} --build-arg CW_FILES_PREFIX=${cw_files_prefix} --build-arg APPSIGNAL_PUSH_API_KEY=${env.CW_APP_SIGNAL} --build-arg USER_SURVEY_SPREADSHEET_URL=https://script.google.com/macros/s/AKfycbzgN1G9IdLYO3KqlTC4gzBxR1UTX5bYXu1qRaiRn1oD9qoaq6s/exec -t ${imageTag} ." )
sh("docker -H :2375 build --build-arg RAILS_ENV=production --build-arg secretKey=${secretKey} --build-arg CW_FILES_PREFIX=${cw_files_prefix} --build-arg APPSIGNAL_PUSH_API_KEY=${env.CW_APP_SIGNAL} --build-arg USER_SURVEY_SPREADSHEET_URL=https://script.google.com/macros/s/AKfycbzgN1G9IdLYO3KqlTC4gzBxR1UTX5bYXu1qRaiRn1oD9qoaq6s/exec -t ${dockerUsername}/${appName}:latest ." )
sh("docker -H :2375 build --build-arg RAILS_ENV=production --build-arg USER_REPORT_KEY=${user_report_key} --build-arg secretKey=${secretKey} --build-arg FEATURE_AGRICULTURE=false --build-arg CW_FILES_PREFIX=${cw_files_prefix} --build-arg APPSIGNAL_PUSH_API_KEY=${env.CW_APP_SIGNAL} --build-arg USER_SURVEY_SPREADSHEET_URL=https://script.google.com/macros/s/AKfycbzgN1G9IdLYO3KqlTC4gzBxR1UTX5bYXu1qRaiRn1oD9qoaq6s/exec -t ${imageTag} ." )
sh("docker -H :2375 build --build-arg RAILS_ENV=production --build-arg USER_REPORT_KEY=${user_report_key} --build-arg secretKey=${secretKey} --build-arg FEATURE_AGRICULTURE=false --build-arg CW_FILES_PREFIX=${cw_files_prefix} --build-arg APPSIGNAL_PUSH_API_KEY=${env.CW_APP_SIGNAL} --build-arg USER_SURVEY_SPREADSHEET_URL=https://script.google.com/macros/s/AKfycbzgN1G9IdLYO3KqlTC4gzBxR1UTX5bYXu1qRaiRn1oD9qoaq6s/exec -t ${dockerUsername}/${appName}:latest ." )
break
case "sandbox":
sh("docker -H :2375 build --build-arg RAILS_ENV=production --build-arg secretKey=${secretKey} --build-arg CW_FILES_PREFIX=${cw_files_prefix} --build-arg APPSIGNAL_PUSH_API_KEY=${env.CW_APP_SIGNAL} --build-arg USER_SURVEY_SPREADSHEET_URL=https://script.google.com/macros/s/AKfycbzgN1G9IdLYO3KqlTC4gzBxR1UTX5bYXu1qRaiRn1oD9qoaq6s/exec -t ${imageTag} ." )
sh("docker -H :2375 build --build-arg RAILS_ENV=production --build-arg secretKey=${secretKey} --build-arg CW_FILES_PREFIX=${cw_files_prefix} --build-arg APPSIGNAL_PUSH_API_KEY=${env.CW_APP_SIGNAL} --build-arg USER_SURVEY_SPREADSHEET_URL=https://script.google.com/macros/s/AKfycbzgN1G9IdLYO3KqlTC4gzBxR1UTX5bYXu1qRaiRn1oD9qoaq6s/exec -t ${dockerUsername}/${appName}:latest ." )
sh("docker -H :2375 build --build-arg RAILS_ENV=production --build-arg USER_REPORT_KEY=${user_report_key} --build-arg secretKey=${secretKey} --build-arg FEATURE_AGRICULTURE=true --build-arg CW_FILES_PREFIX=${cw_files_prefix} --build-arg APPSIGNAL_PUSH_API_KEY=${env.CW_APP_SIGNAL} --build-arg USER_SURVEY_SPREADSHEET_URL=https://script.google.com/macros/s/AKfycbzgN1G9IdLYO3KqlTC4gzBxR1UTX5bYXu1qRaiRn1oD9qoaq6s/exec -t ${imageTag} ." )
sh("docker -H :2375 build --build-arg RAILS_ENV=production --build-arg USER_REPORT_KEY=${user_report_key} --build-arg secretKey=${secretKey} --build-arg FEATURE_AGRICULTURE=true --build-arg CW_FILES_PREFIX=${cw_files_prefix} --build-arg APPSIGNAL_PUSH_API_KEY=${env.CW_APP_SIGNAL} --build-arg USER_SURVEY_SPREADSHEET_URL=https://script.google.com/macros/s/AKfycbzgN1G9IdLYO3KqlTC4gzBxR1UTX5bYXu1qRaiRn1oD9qoaq6s/exec -t ${dockerUsername}/${appName}:latest ." )
break
default:
sh("docker -H :2375 build --build-arg RAILS_ENV=production --build-arg secretKey=${secretKey} --build-arg CW_FILES_PREFIX=${cw_files_prefix} --build-arg APPSIGNAL_PUSH_API_KEY=${env.CW_APP_SIGNAL} --build-arg USER_SURVEY_SPREADSHEET_URL=https://script.google.com/macros/s/AKfycbzgN1G9IdLYO3KqlTC4gzBxR1UTX5bYXu1qRaiRn1oD9qoaq6s/exec -t ${imageTag} ." )
sh("docker -H :2375 build --build-arg RAILS_ENV=production --build-arg secretKey=${secretKey} --build-arg CW_FILES_PREFIX=${cw_files_prefix} --build-arg APPSIGNAL_PUSH_API_KEY=${env.CW_APP_SIGNAL} --build-arg USER_SURVEY_SPREADSHEET_URL=https://script.google.com/macros/s/AKfycbzgN1G9IdLYO3KqlTC4gzBxR1UTX5bYXu1qRaiRn1oD9qoaq6s/exec -t ${dockerUsername}/${appName}:latest ." )
sh("docker -H :2375 build --build-arg RAILS_ENV=production --build-arg USER_REPORT_KEY=${user_report_key} --build-arg secretKey=${secretKey} --build-arg FEATURE_AGRICULTURE=false --build-arg CW_FILES_PREFIX=${cw_files_prefix} --build-arg APPSIGNAL_PUSH_API_KEY=${env.CW_APP_SIGNAL} --build-arg USER_SURVEY_SPREADSHEET_URL=https://script.google.com/macros/s/AKfycbzgN1G9IdLYO3KqlTC4gzBxR1UTX5bYXu1qRaiRn1oD9qoaq6s/exec -t ${imageTag} ." )
sh("docker -H :2375 build --build-arg RAILS_ENV=production --build-arg USER_REPORT_KEY=${user_report_key} --build-arg secretKey=${secretKey} --build-arg FEATURE_AGRICULTURE=false --build-arg CW_FILES_PREFIX=${cw_files_prefix} --build-arg APPSIGNAL_PUSH_API_KEY=${env.CW_APP_SIGNAL} --build-arg USER_SURVEY_SPREADSHEET_URL=https://script.google.com/macros/s/AKfycbzgN1G9IdLYO3KqlTC4gzBxR1UTX5bYXu1qRaiRn1oD9qoaq6s/exec -t ${dockerUsername}/${appName}:latest ." )
}
}

Expand Down
5 changes: 2 additions & 3 deletions app/admin/global_cw_platform/adaptation.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ActiveAdmin.register_page 'Global Cw Platform Adaptation' do
ActiveAdmin.register_page 'Global CW Platform Adaptation' do
include DataUploader::SharedAdmin

section_name = 'adaptation'
Expand Down Expand Up @@ -29,8 +29,7 @@ def section
end

def import_worker
DataUploader::BaseImportWorker.perform_async(section.id, 'ImportAdaptation',
current_admin_user.email)
DataUploader::BaseImportWorker.perform_async(section.id, 'ImportAdaptation', current_admin_user.email)
end

def section_repository
Expand Down
Loading

0 comments on commit 0195a33

Please sign in to comment.