mirror of
https://github.com/evennia/evennia.git
synced 2026-03-18 13:56:30 +01:00
Updated HTML docs
This commit is contained in:
parent
c81a30b229
commit
3165f49b4c
968 changed files with 23111 additions and 14203 deletions
|
|
@ -14,11 +14,11 @@
|
|||
<script src="../_static/underscore.js"></script>
|
||||
<script src="../_static/doctools.js"></script>
|
||||
<script src="../_static/language_data.js"></script>
|
||||
<script async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
|
||||
<script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"processClass": "tex2jax_process|mathjax_process|math|output_area"}})</script>
|
||||
<link rel="shortcut icon" href="../_static/favicon.ico"/>
|
||||
<link rel="index" title="Index" href="../genindex.html" />
|
||||
<link rel="search" title="Search" href="../search.html" />
|
||||
<link rel="search" title="Search" href="../search.html" />
|
||||
<link rel="next" title="Continuous integration with Travis" href="Continuous-Integration-Travis.html" />
|
||||
<link rel="prev" title="Changelog" href="Changelog.html" />
|
||||
</head><body>
|
||||
<div class="related" role="navigation" aria-label="related navigation">
|
||||
<h3>Navigation</h3>
|
||||
|
|
@ -29,7 +29,14 @@
|
|||
<li class="right" >
|
||||
<a href="../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li class="right" >
|
||||
<a href="Continuous-Integration-Travis.html" title="Continuous integration with Travis"
|
||||
accesskey="N">next</a> |</li>
|
||||
<li class="right" >
|
||||
<a href="Changelog.html" title="Changelog"
|
||||
accesskey="P">previous</a> |</li>
|
||||
<li class="nav-item nav-item-0"><a href="../index.html">Evennia 1.0-dev</a> »</li>
|
||||
<li class="nav-item nav-item-1"><a href="Coding-Overview.html" accesskey="U">Coding and development help</a> »</li>
|
||||
<li class="nav-item nav-item-this"><a href="">Continuous Integration</a></li>
|
||||
</ul>
|
||||
<div class="develop">develop branch</div>
|
||||
|
|
@ -42,15 +49,14 @@
|
|||
|
||||
<section class="tex2jax_ignore mathjax_ignore" id="continuous-integration">
|
||||
<h1>Continuous Integration<a class="headerlink" href="#continuous-integration" title="Permalink to this headline">¶</a></h1>
|
||||
<p>One of the advantages of Evennia over traditional MUSH development systems is that Evennia is
|
||||
capable of integrating into enterprise level integration environments and source control. Because of
|
||||
this, it can also be the subject of automation for additional convenience, allowing a more
|
||||
streamlined development environment.</p>
|
||||
<section id="what-is-continuous-integration">
|
||||
<h2>What is Continuous Integration?<a class="headerlink" href="#what-is-continuous-integration" title="Permalink to this headline">¶</a></h2>
|
||||
<p>One of the advantages of Evennia over traditional MU* development systems is that Evennia can
|
||||
integrate into enterprise-level integration environments and source control.</p>
|
||||
<section id="what-is-continuous-integration-ci">
|
||||
<h2>What is Continuous Integration (CI)?<a class="headerlink" href="#what-is-continuous-integration-ci" title="Permalink to this headline">¶</a></h2>
|
||||
<p><a class="reference external" href="https://www.thoughtworks.com/continuous-integration">Continuous Integration (CI)</a> is a development
|
||||
practice that requires developers to integrate code into a shared repository several times a day.
|
||||
Each check-in is then verified by an automated build, allowing teams to detect problems early.</p>
|
||||
practice that requires developers to integrate code into a shared repository.
|
||||
Each check-in is then verified by an automated build, allowing teams to detect problems early. This
|
||||
can be set up to safely deploy data to a production server only after tests have passed, for example.</p>
|
||||
<p>For Evennia, continuous integration allows an automated build process to:</p>
|
||||
<ul class="simple">
|
||||
<li><p>Pull down a latest build from Source Control.</p></li>
|
||||
|
|
@ -61,238 +67,18 @@ Each check-in is then verified by an automated build, allowing teams to detect p
|
|||
<li><p>Reload the game.</p></li>
|
||||
</ul>
|
||||
</section>
|
||||
<section id="preparation">
|
||||
<h2>Preparation<a class="headerlink" href="#preparation" title="Permalink to this headline">¶</a></h2>
|
||||
<p>To prepare a CI environment for your <code class="docutils literal notranslate"><span class="pre">MU*</span></code>, it will be necessary to set up some prerequisite
|
||||
software for your server.</p>
|
||||
<p>Among those you will need:</p>
|
||||
<ul class="simple">
|
||||
<li><p>A Continuous Integration Environment.</p>
|
||||
<section id="list-of-continuous-integration-tools">
|
||||
<h2>List of continuous integration tools<a class="headerlink" href="#list-of-continuous-integration-tools" title="Permalink to this headline">¶</a></h2>
|
||||
<p>There are a lot of tools and services providing CI functionality. Here are a few that people have used
|
||||
with Evennia:</p>
|
||||
<div class="toctree-wrapper compound">
|
||||
<ul>
|
||||
<li><p>I recommend <a class="reference external" href="https://www.jetbrains.com/teamcity/">TeamCity</a> which has an in-depth <a class="reference external" href="https://confluence.jetbrains.com/display/TCD8/Installing+and+Configuring+the+TeamCity+Server">Setup
|
||||
Guide</a></p></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Continuous-Integration-Travis.html">Continuous integration with Travis</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Continuous-Integration-TeamCity.html">Continuous Integration - TeamCity (linux)</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p><a class="reference internal" href="Version-Control.html"><span class="doc std std-doc">Source Control</span></a></p>
|
||||
<ul>
|
||||
<li><p>This could be Git or SVN or any other available SC.</p></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section id="linux-teamcity-setup">
|
||||
<h2>Linux TeamCity Setup<a class="headerlink" href="#linux-teamcity-setup" title="Permalink to this headline">¶</a></h2>
|
||||
<p>For this part of the guide, an example setup will be provided for administrators running a TeamCity
|
||||
build integration environment on Linux.</p>
|
||||
<p>After meeting the preparation steps for your specific environment, log on to your teamcity interface
|
||||
at <code class="docutils literal notranslate"><span class="pre">http://<your</span> <span class="pre">server>:8111/</span></code>.</p>
|
||||
<p>Create a new project named “Evennia” and in it construct a new template called continuous-
|
||||
integration.</p>
|
||||
<section id="a-quick-overview">
|
||||
<h3>A Quick Overview<a class="headerlink" href="#a-quick-overview" title="Permalink to this headline">¶</a></h3>
|
||||
<p>Templates are fancy objects in TeamCity that allow an administrator to define build steps that are
|
||||
shared between one or more build projects. Assigning a VCS Root (Source Control) is unnecessary at
|
||||
this stage, primarily you’ll be worrying about the build steps and your default parameters (both
|
||||
visible on the tabs to the left.)</p>
|
||||
</section>
|
||||
<section id="template-setup">
|
||||
<h3>Template Setup<a class="headerlink" href="#template-setup" title="Permalink to this headline">¶</a></h3>
|
||||
<p>In this template, you’ll be outlining the steps necessary to build your specific game. (A number of
|
||||
sample scripts are provided under this section below!) Click Build Steps and prepare your general
|
||||
flow. For this example, we will be doing a few basic example steps:</p>
|
||||
<ul class="simple">
|
||||
<li><p>Transforming the <a class="reference external" href="http://Settings.py">Settings.py</a> file</p>
|
||||
<ul>
|
||||
<li><p>We do this to update ports or other information that make your production environment unique
|
||||
from your development environment.</p></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p>Making migrations and migrating the game database.</p></li>
|
||||
<li><p>Publishing the game files.</p></li>
|
||||
<li><p>Reloading the server.</p></li>
|
||||
</ul>
|
||||
<p>For each step we’ll being use the “Command Line Runner” (a fancy name for a shell script executor).</p>
|
||||
<ul>
|
||||
<li><p>Create a build step with the name: Transform Configuration</p></li>
|
||||
<li><p>For the script add:</p>
|
||||
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="ch">#!/bin/bash</span>
|
||||
<span class="c1"># Replaces the game configuration with one </span>
|
||||
<span class="c1"># appropriate for this deployment.</span>
|
||||
|
||||
<span class="nv">CONFIG</span><span class="o">=</span><span class="s2">"%system.teamcity.build.checkoutDir%/server/conf/settings.py"</span>
|
||||
<span class="nv">MYCONF</span><span class="o">=</span><span class="s2">"%system.teamcity.build.checkoutDir%/server/conf/my.cnf"</span>
|
||||
|
||||
sed -e <span class="s1">'s/TELNET_PORTS = [4000]/TELNET_PORTS = [%game.ports%]/g'</span> <span class="s2">"</span><span class="nv">$CONFIG</span><span class="s2">"</span> > <span class="s2">"</span><span class="nv">$CONFIG</span><span class="s2">"</span>.tmp <span class="o">&&</span> mv
|
||||
</pre></div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<p>“<span class="math notranslate nohighlight">\(CONFIG".tmp "\)</span>CONFIG”
|
||||
sed -e ‘s/WEBSERVER_PORTS = [(4001, 4002)]/WEBSERVER_PORTS = [%game.webports%]/g’ “<span class="math notranslate nohighlight">\(CONFIG" >
|
||||
"\)</span>CONFIG”.tmp && mv “<span class="math notranslate nohighlight">\(CONFIG".tmp "\)</span>CONFIG”</p>
|
||||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span># settings.py MySQL DB configuration
|
||||
echo Configuring Game Database...
|
||||
echo "" >> "$CONFIG"
|
||||
echo "######################################################################" >> "$CONFIG"
|
||||
echo "# MySQL Database Configuration" >> "$CONFIG"
|
||||
echo "######################################################################" >> "$CONFIG"
|
||||
|
||||
echo "DATABASES = {" >> "$CONFIG"
|
||||
echo " 'default': {" >> "$CONFIG"
|
||||
echo " 'ENGINE': 'django.db.backends.mysql'," >> "$CONFIG"
|
||||
echo " 'OPTIONS': {" >> "$CONFIG"
|
||||
echo " 'read_default_file': 'server/conf/my.cnf'," >> "$CONFIG"
|
||||
echo " }," >> "$CONFIG"
|
||||
echo " }" >> "$CONFIG"
|
||||
echo "}" >> "$CONFIG"
|
||||
|
||||
# Create the My.CNF file.
|
||||
echo "[client]" >> "$MYCONF"
|
||||
echo "database = %mysql.db%" >> "$MYCONF"
|
||||
echo "user = %mysql.user%" >> "$MYCONF"
|
||||
echo "password = %mysql.pass%" >> "$MYCONF"
|
||||
echo "default-character-set = utf8" >> "$MYCONF"
|
||||
```
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>If you look at the parameters side of the page after saving this script, you’ll notice that some new
|
||||
parameters have been populated for you. This is because we’ve included new teamcity configuration
|
||||
parameters that are populated when the build itself is ran. When creating projects that inherit this
|
||||
template, we’ll be able to fill in or override those parameters for project-specific configuration.</p>
|
||||
<ul>
|
||||
<li><p>Go ahead and create another build step called “Make Database Migration”</p>
|
||||
<ul class="simple">
|
||||
<li><p>If you’re using SQLLite on your game, it will be prudent to change working directory on this
|
||||
step to: %game.dir%</p></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p>In this script include:</p>
|
||||
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="ch">#!/bin/bash</span>
|
||||
<span class="c1"># Update the DB migration</span>
|
||||
|
||||
<span class="nv">LOGDIR</span><span class="o">=</span><span class="s2">"server/logs"</span>
|
||||
|
||||
. %evenv.dir%/bin/activate
|
||||
|
||||
<span class="c1"># Check that the logs directory exists.</span>
|
||||
<span class="k">if</span> <span class="o">[</span> ! -d <span class="s2">"</span><span class="nv">$LOGDIR</span><span class="s2">"</span> <span class="o">]</span><span class="p">;</span> <span class="k">then</span>
|
||||
<span class="c1"># Control will enter here if $LOGDIR doesn't exist.</span>
|
||||
mkdir <span class="s2">"</span><span class="nv">$LOGDIR</span><span class="s2">"</span>
|
||||
<span class="k">fi</span>
|
||||
|
||||
evennia makemigrations
|
||||
</pre></div>
|
||||
</div>
|
||||
</li>
|
||||
<li><p>Create yet another build step, this time named: “Execute Database Migration”:</p>
|
||||
<ul>
|
||||
<li><p>If you’re using SQLLite on your game, it will be prudent to change working directory on this
|
||||
step to: %game.dir%</p>
|
||||
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="ch">#!/bin/bash</span>
|
||||
<span class="c1"># Apply the database migration.</span>
|
||||
|
||||
<span class="nv">LOGDIR</span><span class="o">=</span><span class="s2">"server/logs"</span>
|
||||
|
||||
. %evenv.dir%/bin/activate
|
||||
|
||||
<span class="c1"># Check that the logs directory exists.</span>
|
||||
<span class="k">if</span> <span class="o">[</span> ! -d <span class="s2">"</span><span class="nv">$LOGDIR</span><span class="s2">"</span> <span class="o">]</span><span class="p">;</span> <span class="k">then</span>
|
||||
<span class="c1"># Control will enter here if $LOGDIR doesn't exist.</span>
|
||||
mkdir <span class="s2">"</span><span class="nv">$LOGDIR</span><span class="s2">"</span>
|
||||
<span class="k">fi</span>
|
||||
|
||||
evennia migrate
|
||||
</pre></div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<p>Our next build step is where we actually publish our build. Up until now, all work on game has been
|
||||
done in a ‘work’ directory on TeamCity’s build agent. From that directory we will now copy our files
|
||||
to where our game actually exists on the local server.</p>
|
||||
<ul>
|
||||
<li><p>Create a new build step called “Publish Build”:</p>
|
||||
<ul>
|
||||
<li><p>If you’re using SQLLite on your game, be sure to order this step ABOVE the Database Migration
|
||||
steps. The build order will matter!</p>
|
||||
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="ch">#!/bin/bash</span>
|
||||
<span class="c1"># Publishes the build to the proper build directory.</span>
|
||||
|
||||
<span class="nv">DIRECTORY</span><span class="o">=</span><span class="s2">"%game.dir%"</span>
|
||||
|
||||
<span class="k">if</span> <span class="o">[</span> ! -d <span class="s2">"</span><span class="nv">$DIRECTORY</span><span class="s2">"</span> <span class="o">]</span><span class="p">;</span> <span class="k">then</span>
|
||||
<span class="c1"># Control will enter here if $DIRECTORY doesn't exist.</span>
|
||||
mkdir <span class="s2">"</span><span class="nv">$DIRECTORY</span><span class="s2">"</span>
|
||||
<span class="k">fi</span>
|
||||
|
||||
<span class="c1"># Copy all the files.</span>
|
||||
cp -ruv %teamcity.build.checkoutDir%/* <span class="s2">"</span><span class="nv">$DIRECTORY</span><span class="s2">"</span>
|
||||
chmod -R <span class="m">775</span> <span class="s2">"</span><span class="nv">$DIRECTORY</span><span class="s2">"</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<p>Finally the last script will reload our game for us.</p>
|
||||
<ul>
|
||||
<li><p>Create a new script called “Reload Game”:</p>
|
||||
<ul>
|
||||
<li><p>The working directory on this build step will be: %game.dir%</p>
|
||||
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="ch">#!/bin/bash</span>
|
||||
<span class="c1"># Apply the database migration.</span>
|
||||
|
||||
<span class="nv">LOGDIR</span><span class="o">=</span><span class="s2">"server/logs"</span>
|
||||
<span class="nv">PIDDIR</span><span class="o">=</span><span class="s2">"server/server.pid"</span>
|
||||
|
||||
. %evenv.dir%/bin/activate
|
||||
|
||||
<span class="c1"># Check that the logs directory exists.</span>
|
||||
<span class="k">if</span> <span class="o">[</span> ! -d <span class="s2">"</span><span class="nv">$LOGDIR</span><span class="s2">"</span> <span class="o">]</span><span class="p">;</span> <span class="k">then</span>
|
||||
<span class="c1"># Control will enter here if $LOGDIR doesn't exist.</span>
|
||||
mkdir <span class="s2">"</span><span class="nv">$LOGDIR</span><span class="s2">"</span>
|
||||
<span class="k">fi</span>
|
||||
|
||||
<span class="c1"># Check that the server is running.</span>
|
||||
<span class="k">if</span> <span class="o">[</span> -d <span class="s2">"</span><span class="nv">$PIDDIR</span><span class="s2">"</span> <span class="o">]</span><span class="p">;</span> <span class="k">then</span>
|
||||
<span class="c1"># Control will enter here if the game is running.</span>
|
||||
evennia reload
|
||||
<span class="k">fi</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<p>Now the template is ready for use! It would be useful this time to revisit the parameters page and
|
||||
set the evenv parameter to the directory where your virtualenv exists: IE “/srv/mush/evenv”.</p>
|
||||
</section>
|
||||
<section id="creating-the-project">
|
||||
<h3>Creating the Project<a class="headerlink" href="#creating-the-project" title="Permalink to this headline">¶</a></h3>
|
||||
<p>Now it’s time for the last few steps to set up a CI environment.</p>
|
||||
<ul class="simple">
|
||||
<li><p>Return to the Evennia Project overview/administration page.</p></li>
|
||||
<li><p>Create a new Sub-Project called “Production”</p>
|
||||
<ul>
|
||||
<li><p>This will be the category that holds our actual game.</p></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p>Create a new Build Configuration in Production with the name of your MUSH.</p>
|
||||
<ul>
|
||||
<li><p>Base this configuration off of the continuous-integration template we made earlier.</p></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p>In the build configuration, enter VCS roots and create a new VCS root that points to the
|
||||
branch/version control that you are using.</p></li>
|
||||
<li><p>Go to the parameters page and fill in the undefined parameters for your specific configuration.</p></li>
|
||||
<li><p>If you wish for the CI to run every time a commit is made, go to the VCS triggers and add one for
|
||||
“On Every Commit”.</p></li>
|
||||
</ul>
|
||||
<p>And you’re done! At this point, you can return to the project overview page and queue a new build
|
||||
for your game. If everything was set up correctly, the build will complete successfully. Additional
|
||||
build steps could be added or removed at this point, adding some features like Unit Testing or more!</p>
|
||||
</section>
|
||||
<p><a class="reference external" href="https://www.atlassian.com/continuous-delivery/continuous-integration/tools">This is an overview of other tools</a>
|
||||
(external link).</p>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
|
|
@ -319,18 +105,18 @@ build steps could be added or removed at this point, adding some features like U
|
|||
<p><h3><a href="../index.html">Table of Contents</a></h3>
|
||||
<ul>
|
||||
<li><a class="reference internal" href="#">Continuous Integration</a><ul>
|
||||
<li><a class="reference internal" href="#what-is-continuous-integration">What is Continuous Integration?</a></li>
|
||||
<li><a class="reference internal" href="#preparation">Preparation</a></li>
|
||||
<li><a class="reference internal" href="#linux-teamcity-setup">Linux TeamCity Setup</a><ul>
|
||||
<li><a class="reference internal" href="#a-quick-overview">A Quick Overview</a></li>
|
||||
<li><a class="reference internal" href="#template-setup">Template Setup</a></li>
|
||||
<li><a class="reference internal" href="#creating-the-project">Creating the Project</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a class="reference internal" href="#what-is-continuous-integration-ci">What is Continuous Integration (CI)?</a></li>
|
||||
<li><a class="reference internal" href="#list-of-continuous-integration-tools">List of continuous integration tools</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h4>Previous topic</h4>
|
||||
<p class="topless"><a href="Changelog.html"
|
||||
title="previous chapter">Changelog</a></p>
|
||||
<h4>Next topic</h4>
|
||||
<p class="topless"><a href="Continuous-Integration-Travis.html"
|
||||
title="next chapter">Continuous integration with Travis</a></p>
|
||||
<div role="note" aria-label="source link">
|
||||
<!--h3>This Page</h3-->
|
||||
<ul class="this-page-menu">
|
||||
|
|
@ -367,7 +153,14 @@ build steps could be added or removed at this point, adding some features like U
|
|||
<li class="right" >
|
||||
<a href="../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li class="right" >
|
||||
<a href="Continuous-Integration-Travis.html" title="Continuous integration with Travis"
|
||||
>next</a> |</li>
|
||||
<li class="right" >
|
||||
<a href="Changelog.html" title="Changelog"
|
||||
>previous</a> |</li>
|
||||
<li class="nav-item nav-item-0"><a href="../index.html">Evennia 1.0-dev</a> »</li>
|
||||
<li class="nav-item nav-item-1"><a href="Coding-Overview.html" >Coding and development help</a> »</li>
|
||||
<li class="nav-item nav-item-this"><a href="">Continuous Integration</a></li>
|
||||
</ul>
|
||||
<div class="develop">develop branch</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue