Skip to content

atomfrede/jhipster-gitlab-ci-image

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

moifort/jhipster-gitlab-ci-image:latest

Introduction

It's a docker image. The purpose of this image is to build a JHipster application. The runner of GitlabCI can build/test/generate application inside a docker image.

Source

Current version

Docker Version: 2.26.1 (Based on Jhipster version)

  • Maven: 3.3.9
  • NodeJS: 5.x
  • Yo: 1.5.0
  • Bower: 1.7.1
  • Grunt: 0.1.13
  • Gulp: 3.9.0

Caching

The tag XX.X.X-cache is a specified image with all node_modules and maven dependencies. If you don't want to use cache, take the the tag XX.X.X. By default latest tag is configured with the cache.

Why use cache?

  • Avoid network problems: JHipster download a lot dependencies and some time some dependency didn't work (403 error). And it's stop the build.
  • Build/Test/Package a JHipster application faster.

If they are other dependencies (other than JHipster)?

Don't worry if you configure your .gitlab-ci.yml file like below, the missing dependencies will download automatically.

Gitlab Runner

Use my image moifort/docker-gitlab-ci-multi-runner with docker-compose:

docker-compose.yml

gitlabmultirunner:
  image: moifort/docker-gitlab-ci-multi-runner:latest
  volumes:
    - ./data:/home/gitlab_ci_multi_runner/data
    - /var/run/docker.sock:/var/run/docker.sock
  environment:
    - CI_SERVER_URL=
    - RUNNER_TOKEN=
    - RUNNER_DESCRIPTION=jhipster
    - RUNNER_EXECUTOR=docker
  restart: always

JHipster project

.gitlab-ci.yml

At the root to your JHipster application .gitlab-ci.yml file. When you push your commit, Gitlab automaticaly run the test.

image: moifort/jhipster-gitlab-ci-image:latest

before_script:
  - cp -r /root/node_modules .
  - npm install

stages:
  - build
  - test
  - deploy

test-grunt:
  stage: test
  script: "grunt test"

test-maven:
  stage: test
  script: "mvn test"

Remove cp -r /root/node_modules . if you not use cache.

.bowerrc

I don't solve the problem yet, if you want to run the generation/test/build of your JHipster project you will need to add "allow_root": true to your .bowerrc.

{
    "directory": "src/main/webapp/bower_components",
    "allow_root": true
}

About

JHipster image for GitlabCI runner.

Resources

License

Stars

Watchers

Forks

Packages

No packages published