summaryrefslogtreecommitdiff
path: root/doc/examples/README.md
blob: 444d68bb425b256199a016be98c87152123c8bb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# How your build script is run

The runner runs the line below before it runs the commands in your build script:

    cd /gitlab-ci-runner/tmp/builds && git clone git@gitlab_server_fqdn:group/project.git project-1 && cd project-1 && git checkout master

# Build script example

    bundle install
    bundle exec rake db:create RAILS_ENV=test
    bundle exec rake db:migrate RAILS_ENV=test
    script/run_all_tests

# Environmental variables

The runner sets the following environmental variables:

```
CI=true
CI_SERVER=true
CI_SERVER_NAME=GitLab CI
GITLAB_CI=true
CI_SERVER_VERSION
CI_SERVER_REVISION
CI_BUILD_REF
CI_BUILD_BEFORE_SHA
CI_BUILD_REF_NAME (branch)
CI_BUILD_ID
CI_BUILD_REPO
CI_PROJECT_DIR
```

# Build script examples

+ [Build script for Omniauth LDAP](build-script-for-omniauth-ldap.md)
+ [Build script GitLab CE](build_script_gitlab_ce.md)
+ [Build script for Sencha deploy PhoneGapBuild](build_script_sencha_deploy_phonegapbuild.md)

# Configuring runner examples

+ [For Ruby](configure/ruby.md)
+ We welcome contributions of examples for other environments.

Please see [cookbook-gitlab-test](https://gitlab.com/gitlab-org/cookbook-gitlab-test/blob/master/README.md)
for instructions how to prepare a server to run CI tests for GitLab.