README.md 1.83 KB
Newer Older
Mark Pundsack's avatar
Mark Pundsack committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# This is an example project that shows how to use Review Apps

This is a very basic project that has one static page, but it shows how to use
the environments feature of GitLab and the recently introduced dynamic
environments which can be used for Review Apps.

Review Apps allow you to create a new environment for each of your branches.
This review app is then visible as a link when you visit the merge request
for the branch. That way you are able to see all changes
introduced by the merge request changes, running live.

The example here uses a set of 3 environments:

1. `production`: you trigger deploys to production manually, by clicking the **Production**
   action under the **Pipelines** tab of your project.
1. `staging`: staging is deployed automatically when changes to `master` get
   merged.
1. `review/*`: the review app is created for any other branch that is pushed to GitLab.

## Access the example

This project can be accessed under these addresses:

Mark Pundsack's avatar
Mark Pundsack committed
24
25
1. `production`: http://review-apps-openshift.tanukionline.com
1. `staging`: http://review-apps-openshift-staging.tanukionline.com
Mark Pundsack's avatar
Mark Pundsack committed
26
1. `review` for merge request !1: http://myfeature.tanukionline.com
Mark Pundsack's avatar
Mark Pundsack committed
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

## Use it for your projects

This is a very simple example, but you can adapt it for your needs and have a
page that is deployed dynamically.

To do that you have to follow these few simple steps.

1. [Optional] Install GitLab on Openshift (version 1.3.1)

    ```
    oc login
    oc new-project gitlab
    wget https://gitlab.com/gitlab-org/omnibus-gitlab/raw/openshift-template/docker/openshift-template.json
    oc create -f openshift-template.json
    ```

1. Add a Secure Variable with your Openshift token, server address, and app domain

Mark Pundsack's avatar
Mark Pundsack committed
46
    Add a `OPENSHIFT_TOKEN`, `OPENSHIFT_SERVER`, and `OPENSHIFT_DOMAIN` to Secure Variables
Mark Pundsack's avatar
Mark Pundsack committed
47
48

You can now start pushing your changes and see them live!