Skip to content

Instantly share code, notes, and snippets.

@khanghoang
Last active November 13, 2015 16:31
Show Gist options
  • Save khanghoang/d248d4c282275f83c89f to your computer and use it in GitHub Desktop.
Save khanghoang/d248d4c282275f83c89f to your computer and use it in GitHub Desktop.
CI

##GitLab + Jenkins + Auto Deployment. ###Install GitLab Follow GitLab installation guide

Or via IAM EC2 but it's ver7.x so you would update it to get GitLab CI.
https://about.gitlab.com/upgrade-to-package-repository/
####Install gitlab-ci-runner https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/blob/master/docs/install/linux-repository.md

####Gitlab Config file vi /etc/gitlab/gitlab.rb ####Reconfigure Gitlab sudo gitlab-ctl reconfigure

####Gitlab CI yml file.

  • You can define image that you wish to use, this is the yml for nodejs
image: nodesource/wheezy:4.2.1

services:
    - mongo

before_script:
    - npm install mocha -g
    - npm install co-mocha --save-dev
    - npm install
  
test:
    script:
        - npm test

####MongoDB

  • Use MongoDB as another container or service.
  • You need to run it (recommend to run it in background) and expose the its port
  • To connect mongodb in code, use something like this mongodb://<name/of/docker/mongo/container>:<port/it/exposes>/test_database

###Rememter

  • To run sudo gitlab-ci-multi-runner run to run CI runners
  • Note, run all with sudo or it won't work
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment