title: Git lab preparing CI scripts to deploy automatically to server in yii2?
body: <p>Here is my <code>readme</code> file to installation.I want to merge it on  server using Ci in gitlab.</p>
  
  <h2>Installation</h2>
  
  <ul>
  <li>Clone project from Gitlab</li>
  </ul>
  
  <pre class="lang-sh prettyprint-override"><code>git clone --single-branch --branch branchname https://gitlab.com/project/project.git
  </code></pre>
  
  <ul>
  <li>Update needed libraries</li>
  </ul>
  
  <pre class="lang-sh prettyprint-override"><code>cd project
  composer update
  </code></pre>
  
  <ul>
  <li>Go to project root directory cloned above and initialize all the configuration files which will be added to the application with a specific environment.  Enter <code>Yes</code> to all the overwrite files (<code>[Yes|No|All|Quit]</code>)</li>
  </ul>
  
  <pre class="lang-sh prettyprint-override"><code>php init --env=Development
  </code></pre>
  
  <ul>
  <li>Create a new database, copy the file named <code>common/config/main-local.example</code> to <code>common/config/main-local.php</code> and adjust the <code>components['db']</code> configuration in <code>common/config/main-local.php</code> accordingly.</li>
  </ul>
  
  <pre class="lang-sh prettyprint-override"><code>cp common/config/main-local.example common/config/main-local.php
  nano common/config/main-local.php
  </code></pre>
  
  <ul>
  <li>Change mail configuration inside <code>common/config/main-local.php</code></li>
  <li><p>Get <code>Recaptcha</code> keys (v2) from <a href="https://www.google.com/recaptcha/admin" rel="nofollow noreferrer">https://www.google.com/recaptcha/admin</a></p></li>
  <li><p>Copy the param file named <code>common/config/params.example</code> to <code>common/config/params.php</code> and adjust the configuration in <code>common/config/params.php</code> accordingly.</p></li>
  </ul>
  
  <pre class="lang-sh prettyprint-override"><code>cp common/config/params.example common/config/params.php
  nano common/config/params.php
  </code></pre>
  
  <ul>
  <li>Apply migrations which will create tables needed for the application to work. Enter <code>Yes</code> to all prompts to dev environment but take extra care on the production environment (so it run the migrations and add the database tables to your db)</li>
  </ul>
  
  <pre class="lang-sh prettyprint-override"><code>php yii migrate
  </code></pre>
  
  <ul>
  <li>Create assets folder under backend/web , allow group users to change the content and make the directory owned by apache user</li>
  </ul>
  
  <pre class="lang-sh prettyprint-override"><code>mkdir -p backend/web/assets
  chmod 775 backend/web/assets
  sudo chown www-data:www-data backend/web/assets
  </code></pre>
  
  <blockquote>
    <p>What should be in the .gitlab-ci.yml file and ci/docker_install.sh
    ,ci/shell-scripts-dev.sh,ci/shell-scripts-prod.sh. Please also explain
    how it work?</p>
  </blockquote>