Skip to content

Latest commit

 

History

History
108 lines (83 loc) · 2.87 KB

generic.md

File metadata and controls

108 lines (83 loc) · 2.87 KB

Requirements

  • Operating system Ubuntu 14.04 or above is preferred. (This guide will be based on ubuntu/debian based operating systems.)
  • Python 2.7
  • Oracle JDK 8
  • Android SDK & necessary build tools and platform SDKs
  • Redis Server

Cloning the Project

git clone https://github.com/fossasia/open-event-android.git && cd open-event-android
export PROJECT_DIR=$(pwd)

Installing the requirements

Installing dependencies

sudo dpkg --add-architecture i386
sudo apt-get install -y software-properties-common git wget libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5 lib32z1 curl libqt5widgets5
sudo apt-get install -y ca-certificates && update-ca-certificates

Installing Python 2.7.x

sudo apt-get install -y python python-dev python-pip libpq-dev libevent-dev libmagic-dev 

Installing Oracle JDK 8

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer oracle-java8-set-default

Installing Android SDK

sudo cp kubernetes/images/generator/tools /opt
sudo ./kubernetes/images/generator/android.sh

export ANDROID_HOME="/opt/android-sdk-linux"
export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools

Installing Redis Server

You can follow the Redis Installation Guide to install and activate Redis Server on your machine.

Installing the project requirements

Let's go into the app generator's directory

cd ${PROJECT_DIR}/apk-generator/v2/

Installing python dependencies

sudo -H pip install -r requirements.txt

Creating a keystore

export KEY_ALIAS=debug
export KEYSTORE_PASSWORD=debug
export KEYSTORE_PATH=$(pwd)/keystore/debug.keystore
keytool -genkey -noprompt \
 -alias ${KEY_ALIAS} \
 -dname "CN=localhost, OU=SG, O=SomeName, L=SomeCountry, S=SomeCountry, C=SG" \
 -keystore ${KEYSTORE_PATH} \
 -storepass ${KEYSTORE_PASSWORD} \
 -keypass ${KEYSTORE_PASSWORD} \
 -keyalg RSA \
 -keysize 2048 \
 -validity 10000

Starting the generator

Set the appropriate config class to use as an environment variable

export APP_CONFIG=config.DevelopmentConfig # for a development environment
export APP_CONFIG=config.ProductionConfig  # for a production environment
export APP_CONFIG=config.TestingConfig     # for a testing environment

Set the URI to your redis instance as an environment variable

export REDIS_URL=redis://localhost:6379/0
Starting celery worker in the background
celery worker -A app.celery &
Starting the app generator web server
gunicorn -b 0.0.0.0:8080 app:app --enable-stdio-inheritance --log-level "info"

You can now visit http://localhost:8080 on your browser to access the app generator.