-
Notifications
You must be signed in to change notification settings - Fork 385
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #2503: Intergration of restyaboard installation using Plateform…
….sh is added.
- Loading branch information
G Balraj
committed
Mar 20, 2019
1 parent
2e5e659
commit 57adc91
Showing
8 changed files
with
171 additions
and
9 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,101 @@ | ||
# This file describes an application. You can have multiple applications | ||
# in the same project. | ||
|
||
# The name of this app. Must be unique within a project. | ||
name: restyaboard | ||
|
||
# The runtime the application uses. | ||
type: 'php:7.2' | ||
|
||
# The relationships of the application with services or other applications. | ||
# The left-hand side is the name of the relationship as it will be exposed | ||
# to the application in the PLATFORM_RELATIONSHIPS variable. The right-hand | ||
# side is in the form `<service name>:<endpoint name>`. | ||
relationships: | ||
database: 'pgsql96:postgresql' | ||
# platform sql -p 52l75zyfpy2t6 --relationship database < sql/restyaboard_with_empty_data.sql | ||
|
||
variables: | ||
php: | ||
# Turn display errors off when you're ready to launch. | ||
display_errors: On | ||
upload_max_filesize: 50M | ||
post_max_size: 50M | ||
max_execution_time: 200 | ||
max_input_time: 200 | ||
memory_limit: 256M | ||
|
||
# The configuration of app when it is exposed to the web. | ||
web: | ||
locations: | ||
'/': | ||
# The public directory of the app, relative to its root. | ||
root: '' | ||
# The front-controller script to send non-static requests to. | ||
passthru: '/client/index.html' | ||
allow: true | ||
rules: | ||
^/client/img/([a-zA-Z_]*)/([a-zA-Z_]*)/([a-zA-Z0-9_\.]*)$: | ||
passthru: '/server/php/image.php?size=$1&model=$2&filename=$3' | ||
^/ical/([0-9]*)/([0-9]*)/([a-zA-Z0-9]*).ics$: | ||
passthru: '/server/php/ical.php?id=$1&user_id=$2&hash=$2' | ||
^/download/([0-9]*)/([a-zA-Z0-9_\.]*)$: | ||
passthru: '/server/php/download.php?id=$1&hash=$2' | ||
^/oauth_callback/([a-zA-Z0-9_\.]*)/([a-zA-Z0-9_\.]*)$: | ||
passthru: '/server/php/oauth_callback.php?plugin=$1&code=$2' | ||
^/oauth/authorize$: | ||
passthru: '/server/php/authorize.php' | ||
^/api/(.*)$: | ||
passthru: '/server/php/R/r.php?_url=$1' | ||
^/(css|js|img|font|apps|locales)/(.*)$: | ||
passthru: '/client/$1/$2' | ||
^/favicon.ico$: | ||
passthru: '/client/favicon.ico' | ||
^/manifest.json$: | ||
passthru: '/client/manifest.json' | ||
^/apple-touch-icon(.*)$: | ||
passthru: '/client/apple-touch-icon$1' | ||
|
||
runtime: | ||
extensions: | ||
- pgsql | ||
- pdo_pgsql | ||
- curl | ||
- gd | ||
- imap | ||
- json | ||
- ldap | ||
- mbstring | ||
|
||
# The size of the persistent disk of the application (in MB). | ||
disk: 2048 | ||
|
||
|
||
# The mounts that will be performed when the package is deployed. | ||
mounts: | ||
'/client/img/micro_thumb': 'shared:files/client/img/micro_thumb' | ||
'/client/img/small_thumb': 'shared:files/client/img/small_thumb' | ||
'/client/img/normal_thumb': 'shared:files/client/img/normal_thumb' | ||
'/client/img/medium_thumb': 'shared:files/client/img/medium_thumb' | ||
'/client/img/large_thumb': 'shared:files/client/img/large_thumb' | ||
'/client/img/extra_large_thumb': 'shared:files/client/img/extra_large_thumb' | ||
'/client/img/original': 'shared:files/client/img/original' | ||
'/tmp': 'shared:files/tmp' | ||
'/tmp/cache': 'shared:files/tmp/cache' | ||
'/media': 'shared:files/media' | ||
|
||
# Restyaboard crons | ||
crons: | ||
main: | ||
spec: '*/5 * * * *' | ||
cmd: 'cd server/php/shell; ./main.sh' | ||
|
||
# Deploy hook, access to services & done once (per cluster, not per node), only mounts are writable at this point | ||
# Note: Http traffic is paused while this is running, so for prod code this should finish as fast as possible, < 30s | ||
hooks: | ||
deploy: | | ||
set -e | ||
# Mainly relevant for eZ Platform demo usage, for own setup adapt this or remove and rely on migrations. | ||
if [ ! -f /tmp/.sql.installed ]; then | ||
php server/php/platformsh_install.php | ||
fi |
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,11 @@ | ||
# The routes of the project. | ||
# | ||
# Each route describes how an incoming URL is going | ||
# to be processed by Platform.sh. | ||
|
||
"http://{default}/": | ||
type: upstream | ||
upstream: "restyaboard:http" | ||
"http://www.{default}/": | ||
type: redirect | ||
to: "https://{default}/" |
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,8 @@ | ||
# The services of the project. | ||
# | ||
# Each service listed will be deployed | ||
# to power your Platform.sh project. | ||
|
||
pgsql96: | ||
type: postgresql:9.6 | ||
disk: 2048 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,23 @@ | ||
<?php | ||
$current_dir = dirname(__FILE__); | ||
exec('chmod -R 0777 ' . $current_dir . '/../../tmp ' . $current_dir . '/../../media'); | ||
exec('echo "sql file executed" > /tmp/.sql.installed'); | ||
exec('mkdir -p /tmp/pgpass'); | ||
exec('chmod -R go-rwx /tmp/pgpass'); | ||
$relationships = json_decode(base64_decode(getenv('PLATFORM_RELATIONSHIPS')), true); | ||
if (!empty($relationships['database'])) { | ||
foreach ($relationships['database'] as $endpoint) { | ||
define('R_DB_HOST', $endpoint['host']); | ||
define('R_DB_USER', $endpoint['username']); | ||
define('R_DB_PASSWORD', $endpoint['password']); | ||
define('R_DB_NAME', $endpoint['path']); | ||
define('R_DB_PORT', $endpoint['port']); | ||
break; | ||
} | ||
} | ||
|
||
exec('echo "'.R_DB_HOST.':'.R_DB_PORT.':'.R_DB_NAME.':'.R_DB_USER.':'.R_DB_PASSWORD.'" > /tmp/pgpass/.pgpass'); | ||
exec('chmod 0600 /tmp/pgpass/.pgpass'); | ||
putenv('PGPASSFILE=/tmp/pgpass/.pgpass'); | ||
exec('psql --host='.R_DB_HOST. ' --port='.R_DB_PORT.' --dbname='.R_DB_NAME.' --username='.R_DB_USER.' --no-password --file=' . $current_dir . '/../../sql/restyaboard_with_empty_data.sql'); | ||
exec('rm -rf /tmp/pgpass'); |
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 |
---|---|---|
|
@@ -5472,7 +5472,7 @@ COPY public.user_logins (id, created, modified, user_id, ip_id, user_agent, is_l | |
-- | ||
COPY public.users (id, created, modified, role_id, username, email, password, full_name, initials, about_me, profile_picture_path, notification_frequency, is_allow_desktop_notification, is_active, is_email_confirmed, created_organization_count, created_board_count, joined_organization_count, list_count, joined_card_count, created_card_count, joined_board_count, checklist_count, checklist_item_completed_count, checklist_item_count, activity_count, card_voter_count, last_activity_id, last_login_date, last_login_ip_id, ip_id, login_type_id, is_productivity_beats, user_login_count, is_ldap, is_send_newsletter, last_email_notified_activity_id, owner_board_count, member_board_count, owner_organization_count, member_organization_count, language, timezone, default_desktop_notification, is_list_notifications_enabled, is_card_notifications_enabled, is_card_members_notifications_enabled, is_card_labels_notifications_enabled, is_card_checklists_notifications_enabled, is_card_attachments_notifications_enabled, is_intro_video_skipped, is_invite_from_board, is_two_factor_authentication_enabled, two_factor_authentication_hash) FROM stdin; | ||
1 2014-06-03 12:40:41.189 2015-04-02 16:26:03.939 1 admin [email protected] $2y$12$QiJW6TjPKzDZPAuoWEex9OjPHQF33YzfkdC09FhasgPO.MjZ5btKe New Admin PA Added About Me media/User/1/default-admin-user.png \N f t t 0 0 0 0 0 0 0 0 0 0 0 0 2 2015-06-06 10:53:34.46 1 \N 2 t 2 f 2 0 0 0 0 0 \N Europe/Andorra t t t t t t t f f f \N | ||
1 2014-06-03 12:40:41.189 2015-04-02 16:26:03.939 1 admin [email protected] $2y$12$QiJW6TjPKzDZPAuoWEex9OjPHQF33YzfkdC09FhasgPO.MjZ5btKe New Admin PA Added About Me client/img/default-admin-user.png \N f t t 0 0 0 0 0 0 0 0 0 0 0 0 2 2015-06-06 10:53:34.46 1 \N 2 t 2 f 2 0 0 0 0 0 \N Europe/Andorra t t t t t t t f f f \N | ||
2 2014-07-05 11:46:40.804 2014-07-05 11:46:40.804 2 user [email protected] $2y$12$QiJW6TjPKzDZPAuoWEex9OjPHQF33YzfkdC09FhasgPO.MjZ5btKe User U \N \N \N f t t 0 0 0 0 0 0 0 0 0 0 0 0 0 2018-10-29 18:23:04.746305 2 \N 2 f 1 f 0 0 0 0 0 0 \N Asia/Calcutta f f f f f f f f f f \N | ||
\. | ||
|