forked from gitcoinco/code_fund_ads
-
Notifications
You must be signed in to change notification settings - Fork 2
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
1 parent
5f9a716
commit 1b6ab98
Showing
19 changed files
with
493 additions
and
106 deletions.
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
alias be="bundle exec" |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
if ENV["HISTFILE"] | ||
hist_dir = ENV["HISTFILE"].sub(/\/[^\/]+$/, "") | ||
Pry.config.history.should_save = true | ||
Pry.config.history.file = File.join(hist_dir, ".pry_history") | ||
end |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
-- Don't display the "helpful" message on startup. | ||
\set QUIET 1 | ||
|
||
-- Allow specifying the path to history file via `PSQL_HISTFILE` env variable | ||
-- (and fallback to the defaukt $HOME/.psql_history otherwise) | ||
\set HISTFILE `[[ -z $PSQL_HISTFILE ]] && echo $HOME/.psql_history || echo $PSQL_HISTFILE` | ||
|
||
-- Show how long each query takes to execute | ||
\timing | ||
|
||
-- Use best available output format | ||
\x auto | ||
|
||
-- Verbose error reports | ||
\set VERBOSITY verbose | ||
|
||
-- If a command is run more than once in a row, | ||
-- only store it once in the history | ||
\set HISTCONTROL ignoredups | ||
\set COMP_KEYWORD_CASE upper | ||
|
||
-- By default, NULL displays as an empty space. Is it actually an empty | ||
-- string, or is it null? This makes that distinction visible | ||
\pset null '[NULL]' | ||
|
||
\unset QUIET |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
vim |
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 |
---|---|---|
@@ -0,0 +1,67 @@ | ||
ARG RUBY_VERSION | ||
FROM ruby:$RUBY_VERSION-slim-buster | ||
|
||
ARG PG_MAJOR | ||
ARG NODE_MAJOR | ||
ARG BUNDLER_VERSION | ||
ARG YARN_VERSION | ||
|
||
# Common dependencies | ||
RUN apt-get update -qq \ | ||
&& DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \ | ||
build-essential \ | ||
gnupg2 \ | ||
curl \ | ||
less \ | ||
git \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/cache/apt/archives/* \ | ||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \ | ||
&& truncate -s 0 /var/log/*log | ||
|
||
# Add PostgreSQL to sources list | ||
RUN curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ | ||
&& echo 'deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list | ||
|
||
# Add NodeJS to sources list | ||
RUN curl -sL https://deb.nodesource.com/setup_$NODE_MAJOR.x | bash - | ||
|
||
# Add Yarn to the sources list | ||
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ | ||
&& echo 'deb http://dl.yarnpkg.com/debian/ stable main' > /etc/apt/sources.list.d/yarn.list | ||
|
||
# Install deps + add Chrome Stable + purge all the things | ||
RUN curl -sSL https://dl.google.com/linux/linux_signing_key.pub | apt-key add - \ | ||
&& echo "deb https://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list | ||
|
||
# Install dependencies | ||
COPY .docker/Aptfile /tmp/Aptfile | ||
RUN apt-get update -qq && DEBIAN_FRONTEND=noninteractive apt-get -yq dist-upgrade && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \ | ||
libpq-dev \ | ||
postgresql-client-$PG_MAJOR \ | ||
google-chrome-stable \ | ||
nodejs \ | ||
yarn=$YARN_VERSION-1 \ | ||
$(cat /tmp/Aptfile | xargs) && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ | ||
truncate -s 0 /var/log/*log | ||
|
||
# Configure bundler | ||
ENV LANG=C.UTF-8 \ | ||
BUNDLE_JOBS=4 \ | ||
BUNDLE_RETRY=3 \ | ||
BUNDLE_APP_CONFIG=.bundle | ||
|
||
# Upgrade RubyGems and install required Bundler version | ||
RUN gem update --system && \ | ||
gem install bundler:$BUNDLER_VERSION | ||
|
||
# Run binstubs without prefixing with `bin/` or `bundle exec` | ||
ENV PATH /app/bin:$PATH | ||
|
||
# Create a directory for the app code | ||
RUN mkdir -p /app | ||
|
||
WORKDIR /app |
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,80 +1,86 @@ | ||
export ACTION_CABLE_MAX_THREADS=5 | ||
export API_BASED_PROPERTY_IDS=114 | ||
export AWS_S3_ACCESS_KEY_ID='AKIAIOSFODNN7EXAMPLE' | ||
export AWS_S3_BUCKET='example_s3_bucket' | ||
export AWS_S3_REGION='us-west-2' | ||
export AWS_S3_SECRET_ACCESS_KEY='wJalrXUtnFEMI/K7MDENG/bPxRfiCYzEXAMPLEKEY' | ||
export BASE_ECPM=400 | ||
export BROWSER_PATH= | ||
export CAMO_HOST= | ||
export CAMO_KEY= | ||
export CAMPAIGN_DEMO_ID=395 | ||
export CLOUDFRONT_HOST= | ||
export CODEFUND_ANALYTICS_KEY= | ||
export DATABASE_URL= | ||
export DEFAULT_HOST=app.codefund.io | ||
export DOCRAPTOR_API_KEY= | ||
export DOCRAPTOR_HTTP_PASSWORD= | ||
export DOCRAPTOR_HTTP_USERNAME= | ||
export ENABLED_FEATURES=jobs | ||
export FILESTACK_API_KEY= | ||
export GITHUB_CLIENT_ID= | ||
export GITHUB_CLIENT_SECRET= | ||
export GOOGLE_CLIENT_ID= | ||
export GOOGLE_CLIENT_SECRET= | ||
export GROOVE_WIDGET_ID= | ||
export INTERCOM_APP_ID= | ||
export INTERCOM_SECRET_KEY= | ||
export IP_ADDRESS_SALT= | ||
export JOBS_MONTHLY_PLAN_PRICE= | ||
export JOBS_PREPAID_PLAN_PRICE= | ||
export LINKEDIN_KEY= | ||
export LINKEDIN_SECRET= | ||
export MAX_QUEUE_SIZE=2500 | ||
export MAX_REQUESTS_PER_IP_PER_MIN=20 | ||
export MAX_REQUESTS_PER_PROPERTY_PER_MIN=600 | ||
export METABASE_CAMPAIGN_DASHBOARD_ID= | ||
export METABASE_PROPERTY_DASHBOARD_ID= | ||
export METABASE_ADVERTISER_DASHBOARD_ID= | ||
export METABASE_ADMINISTRATOR_DASHBOARD_ID= | ||
export METABASE_SECRET_KEY= | ||
export METABASE_SITE_URL= | ||
export METABASE_URL= | ||
export NGROK_HOST= | ||
export NGROK_SUBDOMAIN= | ||
export PAID_FALLBACK_PERCENT=90 | ||
export PG_DATABASE_NAME='code_fund_ads_development' | ||
export PG_PASSWORD= | ||
export PG_TIMEOUT_IN_SECONDS=3 | ||
export PG_URL= | ||
export PG_USERNAME= | ||
export PIPEDRIVE_SYNC_HOOK_URL= | ||
export PROHIBITED_HOUR_END= | ||
export PROHIBITED_HOUR_START= | ||
export RAILS_INBOUND_EMAIL_PASSWORD= | ||
export RAILS_MAX_THREADS=5 | ||
export READ_THE_DOCS_EMAIL= | ||
export RECAPTCHA_SECRET_KEY= | ||
export RECAPTCHA_SITE_KEY= | ||
export REDIS_CACHE_MAX_THREADS=5 | ||
export REDIS_CACHE_URL='redis://127.0.0.1:6379' | ||
export REDIS_QUEUE_MAX_THREADS=5 | ||
export REDIS_QUEUE_URL='redis://127.0.0.1:6379' | ||
export ROLLBAR_ACCESS_TOKEN= | ||
export SCOUT_ENABLED='false' | ||
export SCOUT_KEY= | ||
export SCOUT_SAMPLE_RATE=0.3 | ||
export SCREENSHOT_MACHINE_KEY= | ||
export SENDGRID_API_KEY= | ||
export SILENCE_ACTION_CABLE='false' | ||
export SITE_TRAFFIC_API_KEY= | ||
export SKIP_EVENTS=1 | ||
export SLACK_WEBHOOK_URL= | ||
export STRIPE_PUBLISHABLE_KEY= | ||
export STRIPE_SECRET_KEY= | ||
export TEST_CONCURRENCY= | ||
export TRADE_API_KEY | ||
export UPLOADCARE_PUBLIC_KEY= | ||
export UPLOADCARE_SECRET= | ||
export WORDPRESS_SITE_ENABLED= | ||
export WORDPRESS_URL='https://codefund.io' | ||
ACTION_CABLE_MAX_THREADS=5 | ||
AWS_S3_ACCESS_KEY_ID='AKIAIOSFODNN7EXAMPLE' | ||
AWS_S3_BUCKET='example_s3_bucket' | ||
AWS_S3_REGION='us-west-2' | ||
AWS_S3_SECRET_ACCESS_KEY='wJalrXUtnFEMI/K7MDENG/bPxRfiCYzEXAMPLEKEY' | ||
BASE_ECPM=400 | ||
BROWSER_PATH= | ||
CAMO_HOST= | ||
CAMO_KEY= | ||
CAMPAIGN_DEMO_ID=395 | ||
CLOUDFRONT_HOST= | ||
CODEFUND_ANALYTICS_KEY= | ||
DATABASE_URL= | ||
DEFAULT_HOST=app.codefund.io | ||
DOCRAPTOR_API_KEY= | ||
DOCRAPTOR_HTTP_PASSWORD= | ||
DOCRAPTOR_HTTP_USERNAME= | ||
ENABLED_FEATURES=jobs | ||
FILESTACK_API_KEY= | ||
GITHUB_CLIENT_ID= | ||
GITHUB_CLIENT_SECRET= | ||
GOOGLE_CLIENT_ID= | ||
GOOGLE_CLIENT_SECRET= | ||
GROOVE_WIDGET_ID= | ||
INTERCOM_APP_ID= | ||
INTERCOM_SECRET_KEY= | ||
IP_ADDRESS_SALT= | ||
JOBS_MONTHLY_PLAN_PRICE= | ||
JOBS_PREPAID_PLAN_PRICE= | ||
LINKEDIN_KEY= | ||
LINKEDIN_SECRET= | ||
MAX_QUEUE_SIZE=2500 | ||
MAX_REQUESTS_PER_IP_PER_MIN=20 | ||
MAX_REQUESTS_PER_PROPERTY_PER_MIN=600 | ||
METABASE_CAMPAIGN_DASHBOARD_ID= | ||
METABASE_PROPERTY_DASHBOARD_ID= | ||
METABASE_ADVERTISER_DASHBOARD_ID= | ||
METABASE_ADMINISTRATOR_DASHBOARD_ID= | ||
METABASE_SECRET_KEY= | ||
METABASE_SITE_URL= | ||
METABASE_URL= | ||
NGROK_HOST= | ||
NGROK_SUBDOMAIN= | ||
PAID_FALLBACK_PERCENT=90 | ||
PG_DATABASE_NAME='code_fund_ads_development' | ||
PG_PASSWORD= | ||
PG_TIMEOUT_IN_SECONDS=3 | ||
PG_URL= | ||
PG_USERNAME= | ||
PIPEDRIVE_SYNC_HOOK_URL= | ||
PROHIBITED_HOUR_END= | ||
PROHIBITED_HOUR_START= | ||
RAILS_MAX_THREADS=5 | ||
READ_THE_DOCS_EMAIL= | ||
RECAPTCHA_SECRET_KEY= | ||
RECAPTCHA_SITE_KEY= | ||
REDIS_CACHE_MAX_THREADS=5 | ||
REDIS_QUEUE_MAX_THREADS=5 | ||
ROLLBAR_ACCESS_TOKEN= | ||
SCOUT_ENABLED='false' | ||
SCOUT_KEY= | ||
SCOUT_SAMPLE_RATE=0.3 | ||
SCREENSHOT_MACHINE_KEY= | ||
SENDGRID_API_KEY= | ||
SILENCE_ACTION_CABLE='false' | ||
SITE_TRAFFIC_API_KEY= | ||
SKIP_EVENTS=1 | ||
SLACK_WEBHOOK_URL= | ||
STRIPE_PUBLISHABLE_KEY= | ||
STRIPE_SECRET_KEY= | ||
TEST_CONCURRENCY= | ||
TRADE_API_KEY | ||
UPLOADCARE_PUBLIC_KEY= | ||
UPLOADCARE_SECRET= | ||
WORDPRESS_SITE_ENABLED= | ||
WORDPRESS_URL='https://codefund.io' | ||
|
||
# Comment these out if using docker | ||
REDIS_URL=redis://127.0.0.1:6379 | ||
REDIS_CACHE_URL=redis://127.0.0.1:6379 | ||
REDIS_QUEUE_URL=redis://127.0.0.1:6379 | ||
|
||
# Uncomment these if using Docker | ||
# REDIS_URL=redis://redis:6379 | ||
# REDIS_CACHE_URL=redis://redis:6379 | ||
# REDIS_QUEUE_URL=redis://redis:6379 |
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
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
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
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env bash | ||
|
||
bundle check || bundle install | ||
bundle exec rails s -b 0.0.0.0 |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env bash | ||
|
||
bundle check || bundle install | ||
bundle exec sidekiq -C config/sidekiq.yml |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
bundle check || bundle install | ||
yarn check || yarn install | ||
./bin/webpack-dev-server |
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,36 +1,25 @@ | ||
#!/usr/bin/env ruby | ||
require 'fileutils' | ||
require "fileutils" | ||
include FileUtils | ||
|
||
# path to your application root. | ||
APP_ROOT = File.expand_path('..', __dir__) | ||
APP_ROOT = File.expand_path("..", __dir__) | ||
|
||
def system!(*args) | ||
system(*args) || abort("\n== Command #{args} failed ==") | ||
end | ||
|
||
chdir APP_ROOT do | ||
# This script is a starting point to setup your application. | ||
# Add necessary setup steps to this file. | ||
|
||
puts '== Installing dependencies ==' | ||
system! 'gem install bundler --conservative' | ||
system('bundle check') || system!('bundle install') | ||
|
||
# Install JavaScript dependencies if using Yarn | ||
# system('bin/yarn') | ||
|
||
# puts "\n== Copying sample files ==" | ||
# unless File.exist?('config/database.yml') | ||
# cp 'config/database.yml.sample', 'config/database.yml' | ||
# end | ||
puts "== Installing dependencies ==" | ||
system! "gem install bundler --conservative" | ||
system("bundle check") || system!("bundle install") | ||
system("bin/yarn") | ||
|
||
puts "\n== Preparing database ==" | ||
system! 'bin/rails db:setup' | ||
system! "bundle exec rails db:create db:structure:load" | ||
system! "bundle exec rails db:test:prepare" | ||
system! "bundle exec rails db:seed" | ||
|
||
puts "\n== Removing old logs and tempfiles ==" | ||
system! 'bin/rails log:clear tmp:clear' | ||
|
||
puts "\n== Restarting application server ==" | ||
system! 'bin/rails restart' | ||
system! "bin/rails log:clear tmp:clear" | ||
end |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
# Export the vars in .env into your shell: | ||
export "$(egrep -v '^#' .env | xargs)" |
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
Oops, something went wrong.