SUMMARY
-
Created the project stamp-devops-poc in OW2 gitLab repository (https://gitlab.ow2.org/stamp/stamp-devops-poc/tree/master) (Daniele Gagliardi Issue stamp/h2020#94)
-
Created a project to tests GitLab CI/CD (Nicola Bertazzo Issue stamp/h2020#95). Installed and configured a docker GitLab Runner (Martin Hamant Issue stamp/h2020#96)
-
Created the file .gitlab-ci.yml to configure the continuous integration delivery process (Nicola Bertazzo Issue stamp/h2020#95).
-
Tested the continuous integration process that contains these steps:
- build: executes
mvn clean compile
command into a container based on maven:3.3.9-jdk-8 image - test: executes
mvn test
command into a container based on maven:3.3.9-jdk-8 image - package: executes
mvn package
into a container based on maven:3.3.9-jdk-8 image - int-test: executes
mvn verify
into a container based on maven:3.3.9-jdk-8 image
- build: executes
-
Tested the CI process localy using this command:
gitlab-runner exec docker package
- Tested CI process remotely.
Troubles solved:
- cache .m2/repository to avoid to download for every steps all the maven dependency (https://gitlab.com/gitlab-org/gitlab-ce/issues/15167). Added this parameter to MAVEN_OPTS variables
MAVEN_OPTS: -Dmaven.repo.local=/cache/maven.repository
Troubles not solved:
- Run docker build in dind: Cannot connect to the Docker daemon problem (https://docs.gitlab.com/ce/ci/docker/using_docker_build.html)
- Store variables from maven execution (p.es. version, etc)
Next steps:
- build and deploy a docker image into a docker registry:
- Define a step to build docker image (https://docs.gitlab.com/ce/ci/docker/using_docker_build.html)
- Define a step to test docker image
- Configure a GitLab Container Registry (https://about.gitlab.com/2016/05/23/gitlab-container-registry/) @mh
- Define a step to deploy the image in the docker registry
- Use the docker image sotred in the docker registry to create a container