From b25391735004845906b5d96a1a47173ff6483fd5 Mon Sep 17 00:00:00 2001 From: Michael Schramm Date: Wed, 3 Jun 2020 13:27:57 +0200 Subject: [PATCH] add heroku deploy with data from https://github.com/ohmyform/ohmyform/pull/83 --- Dockerfile | 1 + Procfile | 2 +- README.md | 15 +++++----- app.json | 29 +++++-------------- public/{modules/core/img/brand => }/logo.png | Bin scripts/heroku/postdeploy.sh | 24 +++++++++++++++ 6 files changed, 42 insertions(+), 29 deletions(-) rename public/{modules/core/img/brand => }/logo.png (100%) create mode 100644 scripts/heroku/postdeploy.sh diff --git a/Dockerfile b/Dockerfile index c54bbc74..0930dd39 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,6 +13,7 @@ LABEL maintainer="OhMyForm " WORKDIR /usr/src/app COPY api/ . +COPY --from=builder /usr/src/app/out /usr/src/app/public RUN yarn install --frozen-lockfile RUN yarn build diff --git a/Procfile b/Procfile index 489b2700..c417a650 100755 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -web: node server.js +web: node api/dist/main diff --git a/README.md b/README.md index 18dbf10f..045398da 100755 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ -# OhMyForm 0.9.1 +![OhMyForm](public/logo.png) +# OhMyForm 0.9.1 @@ -17,7 +18,7 @@ Moving over to Discord so that I can manage things without hassle. [![Discord](https://img.shields.io/discord/595773457862492190.svg?label=Discord%20Chat)](https://discord.gg/nWbrjtz) > An *open source alternative to TypeForm* that can create stunning mobile-ready forms, surveys and questionnaires. - +[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/ohmyform/ohmyform/tree/master) ## Table of Contents @@ -84,7 +85,7 @@ Follow documentation hosted on [OhMyForm.com](http://ohmyform.com/docs/install/) ### Code Contributors This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)]. -Contributors +[![Contributors](https://opencollective.com/ohmyform-sustainability/contributors.svg?width=890&button=false)](https://github.com/ohmyform/ohmyform/graphs/contributors) ### Financial Contributors @@ -92,13 +93,13 @@ Become a financial contributor and help us sustain our community. [[Contribute]( #### Individuals -Individuals +[![Individuals](https://opencollective.com/static/images/opencollective-og-default.png?width=890)](https://opencollective.com/ohmyform-sustainability) #### Organizations Support this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/ohmyform-sustainability/contribute)] - - - +[![](https://opencollective.com/ohmyform-sustainability/organization/0/avatar.svg)](https://opencollective.com/ohmyform-sustainability/organization/0/website) +[![](https://opencollective.com/ohmyform-sustainability/organization/1/avatar.svg)](https://opencollective.com/ohmyform-sustainability/organization/1/website) +[![](https://opencollective.com/ohmyform-sustainability/organization/2/avatar.svg)](https://opencollective.com/ohmyform-sustainability/organization/2/website) diff --git a/app.json b/app.json index cca72c32..f6280a62 100644 --- a/app.json +++ b/app.json @@ -3,36 +3,20 @@ "name": "ohmyform", "description": "Opensource alternative to TypeForm", "repository": "https://github.com/ohmyform/ohmyform", - "logo": "https://raw.githubusercontent.com/ohmyform/ohmyform/master/public/modules/core/img/brand/logo.png", + "logo": "https://raw.githubusercontent.com/ohmyform/ohmyform/master/public/logo.png", "keywords": ["form", "survey"], "env": { "BASE_URL": { "description": "Domain name where the site will be hosted", "value": "ohmyform.herokuapp.com" }, - "MAILER_SERVICE_PROVIDER": { - "description": "Set this to any services from https://nodemailer.com/smtp/well-known/ to use a 'well-known' email provider", - "value": "" - }, - "MAILER_SMTP_HOST": { - "description": "Set this if you are not using a 'MAILER_SERVICE_PROVIDER'", - "value": "" - }, - "MAILER_SMTP_PORT": { - "description": "Set this if you are not using a 'MAILER_SERVICE_PROVIDER'", - "value": "" - }, - "MAILER_EMAIL_ID": { - "description": "Username credential of your SMTP service", - "value": "" - }, - "MAILER_PASSWORD": { - "description": "Password credential of your SMTP service", + "MAILER_URI": { + "description": "Set this to a uri like smtp://localhost:1025 - for more information check https://nodemailer.com/", "value": "" }, "MAILER_FROM": { "description": "Email address from which signup/verifications are sent", - "value": "" + "value": "OhMyForm " }, "CREATE_ADMIN": { "description": "Use this to automatically create an admin user on startup", @@ -67,5 +51,8 @@ { "url": "heroku/nodejs" } - ] + ], + "scripts": { + "postdeploy": "scripts/heroku/postdeploy.sh" + } } diff --git a/public/modules/core/img/brand/logo.png b/public/logo.png similarity index 100% rename from public/modules/core/img/brand/logo.png rename to public/logo.png diff --git a/scripts/heroku/postdeploy.sh b/scripts/heroku/postdeploy.sh new file mode 100644 index 00000000..9111858e --- /dev/null +++ b/scripts/heroku/postdeploy.sh @@ -0,0 +1,24 @@ + +cd ui/ + +echo "Install UI" +yarn install --frozen-lockfile + +echo "Build and Export UI" +yarn export + +cd ../api + +echo "Install API" +yarn install --frozen-lockfile + +echo "Copy Exported UI to API" +cp -r ui/out public + +yarn install + +echo "Build API" +yarn build + + +echo "FINISHED build for UI and API"