Skip to content
Snippets Groups Projects
Commit 2289f8c9 authored by Marco Lorini's avatar Marco Lorini
Browse files

2021-05-28 ML: add version file and .gitlab-ci.yaml

parent 6c0f57c4
No related branches found
No related tags found
No related merge requests found
Pipeline #190 failed
stages:
- build
- test
- package
- deploy
build:
stage: build
image: maven:3.6.3-jdk-11
only:
- master
script:
- mvn package
artifacts:
paths:
- target/*.jar
expire_in: 1 hours
tags:
- kubernetes
- fdp-api
- test
test:
stage: test
image: maven:3.6.3-jdk-11
only:
- master
script:
- mvn test
tags:
- kubernetes
- fdp-api
- test
package:
stage: package
image: docker:latest
only:
- master
services:
- docker:dind
before_script:
- version=`cat version`
- echo $version
- docker info
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_TOKEN $CI_REGISTRY
script:
- docker build -t $CI_REGISTRY/$CI_REGISTRY_IMAGE:$version -t $CI_REGISTRY/$CI_REGISTRY_IMAGE:$CI_REGISTRY_IMAGE_TAG .
- docker push --all-tags $CI_REGISTRY/$CI_REGISTRY_IMAGE
tags:
- kubernetes
- fdp-api
- test
deploy:
stage: deploy
image: bitnami/kubectl:latest
only:
- master
before_script:
# the following commands are needed only in the test environment
- mkdir -p .kube/bin
- cd .kube/bin
- curl -L https://github.com/kubernetes/cloud-provider-openstack/releases/download/v1.19.0/client-keystone-auth -o kubectl-keystone-auth
- chmod +x kubectl-keystone-auth
- cd ../..
# this command is always required in the before_script field
#- mkdir .kube/
- echo -n $KUBE_CONFIG | base64 -d > .kube/config
script:
# - kubectl --kubeconfig .kube/config --namespace $KUBE_NAMESPACE set image deployment/$KUBE_DEPLOYMENT $KUBE_CONTAINER=$CI_REGISTRY/$CI_REGISTRY_IMAGE:$CI_REGISTRY_IMAGE_TAG
- kubectl --kubeconfig .kube/config --namespace $KUBE_NAMESPACE rollout restart deployment/$KUBE_DEPLOYMENT
tags:
- kubernetes
- fdp-api
- test
v27
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment