Skip to content

Commit

Permalink
Add shiny landing page (#1998)
Browse files Browse the repository at this point in the history
* Add initial landing page

* Minor design changes

* Put landing page into i18n

* Add pictures of foodsaving groups

* Use landing page as home page

* Remove unused LandingFeature component

* Fix tests to work with new homepage

* Put made screenshot inside a QImg

* Remove unused data property

* Minor style fixes/improvements

* More fiddling with landing page

- move photos more inline into text
- add group gallery cards

* Make it more likely to see groups on landing page

... if the installation doesn't have very good/active groups
this will still show what it can manage

* Add branch deployments

* Move images into images/ and generate thumbs

* Replace fridge picture with bike workshop

* Upgrade babel preset-env

Fixes incompatability with latest nodejs

* Make it more s-p-a-c-i-o-u-s

Content and style :)

* Prevent >100% width content causing scrollbar

... this is for the case of the landing page
oversized image ...

* Cleanup style and give more room for inline images

* Rename LANDING i18n key to ABOUT_KARROT

* Remove unused fullsized images

* Add docs for how to resize images

* Add better offers screenshot
  • Loading branch information
nicksellen committed May 4, 2020
1 parent 30227d0 commit edc671e
Show file tree
Hide file tree
Showing 21 changed files with 642 additions and 39 deletions.
29 changes: 25 additions & 4 deletions .circleci/config.yml
Expand Up @@ -259,6 +259,17 @@ jobs:
paths:
- android-prod.apk

deploy-branch:
<<: *defaults
steps:
- checkout
- attach_workspace:
at: ~/repo
- deploy:
name: Branch Deploy
command: |
./deploy.sh branch "${CIRCLE_BRANCH}"
deploy-dev:
<<: *defaults
steps:
Expand All @@ -268,7 +279,7 @@ jobs:
- deploy:
name: Dev Deploy
command: |
./deploy.sh "${CIRCLE_BRANCH}" "${CIRCLE_BRANCH}"
./deploy.sh dev "${CIRCLE_BRANCH}"
deploy-release:
<<: *defaults
Expand All @@ -279,7 +290,7 @@ jobs:
- deploy:
name: Release Deploy
command: |
./deploy.sh "${CIRCLE_BRANCH}" release
./deploy.sh release "${CIRCLE_BRANCH}"
sync-locale-messages:
<<: *defaults
Expand Down Expand Up @@ -350,8 +361,9 @@ workflows:
- build-dev:
filters:
branches:
only:
- master
ignore:
- circleci-update-locales
- /dependabot\/.*/
requires:
- install-dependencies
- build-storybook:
Expand Down Expand Up @@ -390,6 +402,15 @@ workflows:
requires:
- build-android-dev
- test
- deploy-branch:
filters:
branches:
ignore:
- master
- circleci-update-locales
- /dependabot\/.*/
requires:
- build-dev
- deploy-dev:
filters:
branches:
Expand Down
70 changes: 51 additions & 19 deletions deploy.sh
@@ -1,51 +1,80 @@
#!/bin/bash

set -e
set -eu

HOST=yuca.yunity.org
HOST="yuca.yunity.org"

REF=$1
DIR=$2
TYPE="$1"
REF="${2:-master}"

if [ -z "$REF" ] || [ -z "$DIR" ]; then
echo "Usage: <ref> <dir>"
# optionally available from the environment
SLACK_WEBHOOK_URL="${SLACK_WEBHOOK_URL:-}"

if [ -z "$REF" ]; then
echo "Usage: <type(release|dev|branch)> [<ref>]"
exit 1
fi

ISO_DATE=$(date -Idate)
REPO_URL="https://github.com/yunity/karrot-frontend"
COMMIT_SHA=$(git rev-parse HEAD)
COMMIT_SHA_SHORT=$(git rev-parse --short HEAD)

if [ "$DIR" == "release" ]; then
if [ "$TYPE" == "release" ]; then

# release

DIR="release"
DEPLOY_ENV="production"
DEPLOY_EMOJI=":rocket:"
URL="https://karrot.world"
APK_URL="https://karrot.world/app.apk"

elif [ "$REF" == "master" ]; then
elif [ "$TYPE" == "dev" ]; then

# dev

if [ "$REF" != "master" ]; then
# technically we could deploy other branches
# but the dir name is setup to be "master"
echo "Error: dev deployment must be of master branch"
echo "(it could be implemented that you can deploy other branches, but is not right now)"
exit 1
fi

DIR="master"
DEPLOY_ENV="development"
DEPLOY_EMOJI=":beer:"
URL="https://dev.karrot.world"
APK_URL="https://dev.karrot.world/app.apk"
STORYBOOK_URL="https://storybook.karrot.world"
DEPLOY_DOCS="true"

else
elif [ "$TYPE" == "branch" ]; then

# nothing
if [ -z "$REF" ]; then
echo "Error: you must specify ref for branch releases"
echo "Usage: <type(release|dev|branch)> [<ref>]"
exit 1
fi

exit 0
# branch deployment

fi
SAFE_DIR="$(echo -n "$REF" | tr -c '[a-zA-Z0-9]_-' '_' | tr "[:upper:]" "[:lower:]")"
DIR="branches/$SAFE_DIR"
DEPLOY_ENV="branch/$REF"
DEPLOY_EMOJI=":construction_worker:"
URL="https://$REF.dev.karrot.world"
APK_URL=
STORYBOOK_URL=
DEPLOY_DOCS="true"

else

echo "Invalid type, must be one of release|dev|branch"
exit 1

fi

ISO_DATE=$(date -Idate)
REPO_URL="https://github.com/yunity/karrot-frontend"
COMMIT_SHA=$(git rev-parse HEAD)
COMMIT_SHA_SHORT=$(git rev-parse --short HEAD)
REF_URL="$REPO_URL/tree/$REF"
COMMIT_URL="$REPO_URL/tree/$COMMIT_SHA"

Expand All @@ -64,11 +93,14 @@ about_json=$(printf '{
}' "$COMMIT_SHA" "$COMMIT_SHA_SHORT" "$REF" "$DEPLOY_ENV" "$APK_URL" "$ISO_DATE")

echo "$about_json" > dist/about.json
echo "$about_json" > storybook-static/about.json

# send it all to the host
rsync -avz --delete dist/ "deploy@$HOST:karrot-frontend/$DIR/"
rsync -avz --delete storybook-static/ "deploy@$HOST:karrot-frontend-storybook/$DIR/"

if [ ! -z "$STORYBOOK_URL" ]; then
echo "$about_json" > storybook-static/about.json
rsync -avz --delete storybook-static/ "deploy@$HOST:karrot-frontend-storybook/$DIR/"
fi

if [ "$DEPLOY_DOCS" == "true" ] && [ -d docs-dist/gitbook ]; then
rsync -avz --delete docs-dist/ "deploy@$HOST:karrot-docs/$DIR/"
Expand Down
3 changes: 0 additions & 3 deletions src/base/datastore/routerPlugin.js
Expand Up @@ -29,9 +29,6 @@ export default datastore => {
if (groupId) {
next = { name: 'group', params: { groupId } }
}
else {
next = { name: 'groupsGallery' }
}
}

// check meta.requireLoggedIn
Expand Down

0 comments on commit edc671e

Please sign in to comment.