Skip to content

convert from deploy to install #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -8,13 +8,20 @@

### Environment Topology

The JPS package creates a Python-based environment, which initially contains a single Apache application server, and deploys the Django CMS software.
The JPS package creates a Python-based environment, which contains a MySQL Server, Apache application server and deploys the Django CMS software from the web.
The version to be installed on a choice in the install between <strong>Stable</strong> and <strong>LTS</strong>, currently equal on both releases.
<table border="0"><tr><td>
<img src="images/djangocms-environment-topology.png">
</td><td>
<strong>Django Version: 1.11.17</strong></br>
<strong>Django CMS Version: 3.5.3</strong></br>
<strong>Python Engine: Python 3.6.6</strong></br>
<strong>Stable</strong></br>
<strong>Django Version: 2.2.9</strong></br>
<strong>Django CMS Version: 3.7.1</strong></br>
<strong>Python Engine: Python 3.7.5</strong></br>
</td><td>
<strong>LTS</strong></br>
<strong>Django Version: 2.2.9</strong></br>
<strong>Django CMS Version: 3.7.1</strong></br>
<strong>Python Engine: Python 3.7.5</strong></br>
</td></tr></table>

### Deployment to the Cloud
Binary file removed dumps/djangocms-master.zip
Binary file not shown.
121 changes: 105 additions & 16 deletions manifest.jps
Original file line number Diff line number Diff line change
@@ -1,24 +1,113 @@
---
type: install
baseUrl: https://download.jelastic.com
logo: /public.php?service=files&t=bf35478b7707b5269d44adfe07b093a6&download
baseUrl: https://raw.githubusercontent.com/jelastic-jps/django-cms/master
logo: /images/cms_icon.png
homepage: http://django-cms.org/
startPage: ${env.protocol}://${env.domain}/admin/
name: DjangoCMS
id: Django-Scripted
categories:
- apps/cms
- apps/content-management
description: The open source content management system based on the Web framework Django.

settings:
fields:
- caption: Select django CMS and django version to install
type: list
name: DJANGO_VER
default: stable
required: true
values:
- value: lts
caption: Long Term Support
- value: stable
caption: Stable 3.7 (Default)

globals:
DB_USER: jelastic-${fn.random}
DB_PASS: ${fn.password(10)}
ADMIN_PASS: ${fn.password(10)}
ADMIN_USER: dj-${fn.random}

nodes:
nodeType: apache-python
cloudlets: 8
onInstall:
deploy:
archive: ${baseUrl}/public.php?service=files&t=37fb2dedbc72453fe73fbe2e890a10f2&download
name: djangoCMS.zip
context: ROOT
success: |
Below you will find your domain name link.
Domain name URL: [${env.protocol}://${env.domain}/](${env.protocol}://${env.domain}/)
Admin panel URL: [${env.protocol}://${env.domain}/admin/](${env.protocol}://${env.domain}/admin/)
Admin name: jelastic
Password: jelastic
To add custom domain name for your DjangoCMS installation follow the steps described in our [documentation](http://docs.jelastic.com/custom-domains)
- nodeType: apache-python
tag: 2.4.41-python-3.7.5
#django is not supported yet on python 3.8
#ref: https://django.readthedocs.io/en/2.2.x/faq/install.html#faq-python-version-support
cloudlets: 8
count: 1
nodeGroup: cp
links: sqldb:DB

- nodeType: mariadb-dockerized
count: 1
cloudlets: 8
nodeGroup: sqldb

onInstall:
- log: Set Node Display Name
- setNodeDisplayName [cp]: AppServer
- setNodeDisplayName [sqldb]: Database
- log: Creating django Database
- createDb
- log: Deploying djangocms-installer
- deployDjango
- log: Setting up django cms
- setupDjango
- log: Install Complete

actions:
createDb:
- cmd [sqldb]: |-
wget https://raw.githubusercontent.com/jelastic-jps/mysql-cluster/master/scripts/setupUser.sh -O ~/setupUser.sh &>> /var/log/run.log
bash ~/setupUser.sh ${globals.DB_USER} ${globals.DB_PASS} &>> /var/log/run.log
jem passwd set -p ${globals.DB_PASS} &>> /var/log/run.log
mysql -u${globals.DB_USER} -p${globals.DB_PASS} -e "CREATE DATABASE IF NOT EXISTS django;"
user: root

deployDjango:
- log: Adding jelastic-python to PATH
- cmd [cp]: echo 'export PATH=$PATH:/opt/jelastic-python37/bin/' >> /etc/profile
user: root
- log: Updating pip
- cmd [cp]: python -m pip install --upgrade pip
user: root

setupDjango:
- log: Removing ROOT (will be created by djangocms)
- cmd [cp]: rm -rf /var/www/webroot/ROOT
user: jelastic
- log: Installing djangocms-installer
- cmd [cp]: python -m pip install djangocms-installer django-cms
user: jelastic
- log: Installing djangocms to ROOT
- cmd [cp]: >-
/opt/jelastic-python37/bin/djangocms
--django-version ${settings.DJANGO_VER}
--cms-version ${settings.DJANGO_VER}
--db mysql://${globals.DB_USER}:${globals.DB_PASS}@DB/django
-s --no-user --bootstrap yes --permissions yes
--parent-dir /var/www/webroot ROOT
user: jelastic
- log: Finalalize settings
- cmd [cp]: |-
sed -i "s/^ALLOWED_HOSTS.*/ALLOWED_HOSTS = ['*']/g" /var/www/webroot/ROOT/settings.py
sed -i "s/^Alias \/static.*/Alias \/static \/var\/www\/webroot\/static/g" /etc/httpd/conf.d/wsgi.conf
sed -i "s/^Alias \/images.*/Alias \/media \/var\/www\/webroot\/media/g" /etc/httpd/conf.d/wsgi.conf
jem service restart httpd
/var/www/webroot/manage.py collectstatic
/var/www/webroot/manage.py createsuperuser --username ${globals.ADMIN_USER} --email ${user.email} --noinput
/var/www/webroot/manage.py shell -c "from django.contrib.auth.models import User;user = User.objects.get(username='${globals.ADMIN_USER}');user.set_password('${globals.ADMIN_PASS}');user.save()"
chmod 0775 /var/www/webroot/ROOT
user: jelastic

success: |+
Below you will find your domain name link.
Domain name URL: [${env.protocol}://${env.domain}/](${env.protocol}://${env.domain}/)
Admin panel URL: [${env.protocol}://${env.domain}/admin/](${env.protocol}://${env.domain}/admin/)

Admin name: ${globals.ADMIN_USER}
Password: ${globals.ADMIN_PASS}

To add custom domain name for your DjangoCMS installation follow the steps described in our [documentation](http://docs.jelastic.com/custom-domains)