From 121f4866efc9eb42c57c12b4136ad779d9b616fb Mon Sep 17 00:00:00 2001 From: Henne Vogelsang Date: Sat, 19 Jan 2019 01:36:05 +0100 Subject: [PATCH] Simplify app.json Use system libraries for building nokogiri and do not require to configure so many environment variables. --- app.json | 71 +++++++------------------------------- lib/tasks/data_deploy.rake | 12 +++++++ 2 files changed, 24 insertions(+), 59 deletions(-) create mode 100644 lib/tasks/data_deploy.rake diff --git a/app.json b/app.json index 9d6acc52..ee8eabf5 100644 --- a/app.json +++ b/app.json @@ -1,67 +1,21 @@ { "name": "osem", "description": "Open Source Event Manager", + "repository": "https://github.com/openSUSE/osem", "env": { "CLOUDINARY_URL": { - "description": "Configure your cloudinary.com cloud name and api key/secret", - "required": true - }, - "DATABASE_URL": { - "description": "Configure your database connection", - "required": false + "description": "Create a https://cloudinary.com account and set the cloud url here. It starts with cloudinary://" }, "SECRET_KEY_BASE": { - "description": "a key which allows sessions to be verified against a known secure key to prevent tampering", - "required": true + "description": "A key to verify sessions. At least 40 characters. For instance: https://www.randomlists.com/string?base=16&length=64&qty=1", + "generator": "secret" }, - "LANG": { - "required": false - }, - "OSEM_EMAIL_ADDRESS": { - "description": "The address OSEM uses for sending mails", - "required": false - }, - "OSEM_HOSTNAME": { - "description": "The host this OSEM instance runs on", - "required": false - }, - "OSEM_NAME": { - "description": "The name of your page", - "required": false - }, - "OSEM_SMTP_ADDRESS": { - "description": "The smtp server to use", - "required": false - }, - "OSEM_SMTP_AUTHENTICATION": { - "description": "The auth method for the smtp server", - "required": false - }, - "OSEM_SMTP_DOMAIN": { - "description": "The HELO domain for the smtp server", - "required": false - }, - "OSEM_SMTP_PASSWORD": { - "description": "The password for the smtp server", - "required": false - }, - "OSEM_SMTP_PORT": { - "description": "The port on the smtp server", - "required": false - }, - "OSEM_SMTP_USERNAME": { - "description": "The user for the smtp server", - "required": false - }, - "RACK_ENV": { - "required": false - }, - "RAILS_ENV": { - "required": false - } + "NOKOGIRI_USE_SYSTEM_LIBRARIES": "1", + "RAILS_ENV": "production", + "RACK_ENV": "production" }, "scripts": { - "postdeploy": "bundle exec rake db:reset data:demo" + "postdeploy": "bundle exec rake db:schema:load db:seed data:deploy" }, "formation": { "web": { @@ -72,12 +26,11 @@ } }, "addons": [ - "heroku-postgresql", - "sendgrid" - ], - "buildpacks": [ { - "url": "heroku/ruby" + "plan": "heroku-postgresql" + }, + { + "plan": "sendgrid" } ] } diff --git a/lib/tasks/data_deploy.rake b/lib/tasks/data_deploy.rake new file mode 100644 index 00000000..23497477 --- /dev/null +++ b/lib/tasks/data_deploy.rake @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +namespace :data do + desc 'Create demo data for production systems' + + task deploy: :environment do + include FactoryBot::Syntax::Methods + conference = create(:full_conference, title: 'Your Own Open Source Event Manager', + short_title: 'yourosem', + description: "This is your new [Open Source Event Manager](http://osem.io/) instance. The first user to [sign up](/accounts/sign_up) will the be administrator of this instance. You can safely delete this conference once you have checked out all the features. We hope you enjoy using OSEM, if you have any question don't hesitate to [contact us](http://osem.io/#contact)!") + end +end