Our gitlab server has a CI node which is available for you to use to build your projects. If you want it to build your project for you, you need to tell it know to build it.
In the root of your project, create a file named
.gitlab-ci.yml, when you push commits to gitlab it will look for the file and if it exists it'll try to build the project. For full documentation see the Gitlab CI documentation.
There are a couple of reasons you might want to do this over using something like Travis CI on a github project:
- The whole thing is Free Software
- Its free to use our CI builder (even for private projects like uni modules)
- You can have it output artefacts that you can download from your project page
- Much more control of the build process.
- Maven builds aren't broken on our build server
If you have a Java Maven project the following will build against openjdk-7 and automatically create artefacts for tagged builds. If your like Piers (or are Piers) and you need Java 8 support change the first line to:
script: "mvn test -B -U"
script: "mvn package -B -U"
script: "mvn clean -B"
Improvements welcome .
Django Example (Python 2.7)
This one is a bit different because you need to install the dependencies. This one can probably be improved quite a bit but it works as a base.
- apt-get update
- apt-get install -y gcc gettext postgresql-client libpq-dev sqlite3
- apt-get install -y python-dev libjpeg-dev libfreetype6-dev zlib1g-dev
- pip install -r requirements.txt
- python manage.py test