GitLab CI examples?

Recently I started working with GitLab - GitHub self-hosted foss alternative. So far so good, liked the UI,  ease of administration, and available functionality (I was on Phabricator previously,  and still use it for repo mirroring).

GitLab has GitLab CI  (GitLab Continuous Integration) which looks promising (pluggable docker/vm/ds to run code) , but I wondered if someone uses it already and can share scripts for it?

  • + 1
  • 0
  • 3655
  • 3
  • 1

Answers

Good choice, I'm already using gitlab in our company, with closed sources. In our process, I even deploy to our own windows server. Our application on Angular 2.

it is our gitlab-ci.yml, I've removed deploy stage.

image: node:5

stages:
  - test
  - build

cache:
  key: "$CI_PROJECT_NAME/$CI_BUILD_REF_NAME"
  paths:
    - ./node_modules/

before_script:
  - export PATH=$PATH:./node_modules/.bin/
  - npm install

tslint_job:
  stage: test
  tags:
    - linux
    - docker
  script:
    - ng lint

test_job:
  stage: test
  tags:
    - linux
    - docker
  script:
    - karma start --browsers PhantomJS --single-run

build_job:
  stage: build
  tags:
    - linux
    - docker
  artifacts:
    expire_in: 1 week
    paths:
      - dist/*
  script:
    - ng build --aot-prod --bh "./"

Even more interesting that, GitLab has their own docker registry. And you can even build your own image for ci with ci.

We build Ensemble container. You can look at archive of my project ensemble.zip . Simple image with Ensemble, without Samples and Docbook databases with minimal security.

Thank you!

Do you import code from GitHub  repository into Ensemble instance automatically?

In current stage, we do not have any Caché code, yet. But I don't see any troubles here. You may use base Ensemble image, and run it on GitLab environment, or on your own server, via gitlab-runner and preinstalled Ensemble. With GitLab-CI, possible lots of different ways.