7
7
8
8
before_script :
9
9
- export CLUSTER_NAME=cvmfs-validation-$(echo $CI_COMMIT_SHA | head -c 6)
10
+ - export BASE_CLUSTER_TEMPLATE="kubernetes-1.17.2-3"
10
11
- export OS_AUTH_URL="https://keystone.cern.ch/main/v3"
11
12
- export OS_IDENTITY_API_VERSION="3"
12
13
- export OS_USERNAME="svcbuild"
@@ -19,84 +20,88 @@ before_script:
19
20
20
21
build :
21
22
stage : build
22
- image : gitlab-registry.cern.ch/cloud/ciadm
23
+ image : gitlab-registry.cern.ch/cloud/ciadm:v0.3.6
23
24
script :
24
- - rpm --import https://mirror.go-repo.io/centos/RPM-GPG-KEY-GO-REPO
25
- - curl -s https://mirror.go-repo.io/centos/go-repo.repo | tee /etc/yum.repos.d/go-repo.repo
26
- - echo 'priority=1' >> /etc/yum.repos.d/go-repo.repo
27
- - yum install -y gcc git golang make
28
- - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN gitlab-registry.cern.ch
29
25
- make
30
26
- make test
31
27
artifacts :
32
- expire_in : ' 10 days '
28
+ expire_in : ' 30 minutes '
33
29
paths :
34
- - _output /csi-cvmfsplugin
30
+ - bin /csi-cvmfsplugin
35
31
except :
36
32
- qa
37
33
- master
38
- tags :
39
- - docker-privileged
40
34
41
- build image :
35
+ buildimg :
42
36
stage : image
43
- image : gitlab-registry.cern.ch/cloud/ciadm
44
- script :
45
- - cp _output/csi-cvmfsplugin deploy/docker
46
- - yum install -y make
47
- - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN gitlab-registry.cern.ch
48
- - docker build -t gitlab-registry.cern.ch/cloud-infrastructure/cvmfs-csi/cvmfsplugin:$CI_COMMIT_SHA deploy/docker
49
- - docker push gitlab-registry.cern.ch/cloud-infrastructure/cvmfs-csi/cvmfsplugin:$CI_COMMIT_SHA
37
+ variables :
38
+ TO : " ${CI_REGISTRY_IMAGE}/cvmfs-csi:${CI_COMMIT_SHORT_SHA} "
39
+ CONTEXT_DIR : " ./ "
40
+ DOCKER_FILE : " deployments/docker/Dockerfile "
41
+ tags :
42
+ - docker-image-build
43
+ script : " echo "
50
44
dependencies :
51
45
- build
46
+ only :
47
+ - branches
52
48
except :
53
49
- master
54
- - qa
55
- tags :
56
- - docker-privileged
57
50
58
- test k8s :
51
+ testk8s :
59
52
stage : test
60
- image : gitlab-registry.cern.ch/cloud/ciadm
61
- script :
62
- - openstack coe cluster create $CLUSTER_NAME --cluster-template kubernetes-preview --keypair lxplus --node-count 1 --master-count 1 --flavor m2.small --labels influx_grafana_dashboard_enabled=True --labels cephfs_csi_enabled=True --labels manila_enabled=True --labels kube_tag=v1.14.1 --labels kube_csi_enabled=True --labels kube_csi_version=cern-csi-1.0-1 --labels heat_container_agent_tag=stein-dev-1 --labels cgroup_driver=cgroupfs --labels container_infra_prefix=gitlab-registry.cern.ch/cloud/atomic-system-containers/ --labels flannel_backend=vxlan --labels cvmfs_csi_version=$CI_COMMIT_SHA --labels admission_control_list=NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota,Priority --labels ingress_controller=traefik --labels manila_version=v0.3.0 --labels cvmfs_csi_enabled=True --labels cvmfs_tag=qa --labels cephfs_csi_version=cern-csi-1.0-1
63
- - sleep 10
64
- - STATUS=$(openstack coe cluster show $CLUSTER_NAME -c status | grep 'status ' | awk '{print $4}')
65
- - while [ "$STATUS" != "CREATE_COMPLETE" ] && [ "$STATUS" != "CREATE_FAILED" ]; do STATUS=$(openstack coe cluster show $CLUSTER_NAME -c status | grep 'status ' | awk '{print $4}'); done
66
- - openstack coe cluster show $CLUSTER_NAME
67
- - openstack coe cluster config $CLUSTER_NAME
68
- - export KUBECONFIG=config
69
- - kubectl create --validate=false -f magnum-cvmfs.yaml
70
- - until kubectl rollout status deployment/cvmfs; do kubectl get all; kubectl describe pvc; done
71
- - POD=$(kubectl get pod | grep cvmfs | awk '{print $1}')
72
- - kubectl exec $POD -c atlas cat /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/README.INSTALL
73
- - kubectl exec $POD -c cms cat /cvmfs/cms.cern.ch/README
53
+ image : gitlab-registry.cern.ch/cloud/ciadm:v0.3.6
54
+ script : |
55
+ LABELS=$(openstack coe cluster template show -f json $BASE_CLUSTER_TEMPLATE | jq --raw-output '.labels | to_entries | map("--labels \(.key)=\(.value)") | join(" ")')
56
+ openstack coe cluster create $CLUSTER_NAME --cluster-template $BASE_CLUSTER_TEMPLATE --keypair lxplus --node-count 1 --master-count 1 --flavor m2.small $LABELS
57
+ sleep 10
58
+ STATUS=$(openstack coe cluster show $CLUSTER_NAME -c status -f value)
59
+ while [ "${STATUS}" != "CREATE_COMPLETE" ] && [ "${STATUS}" != "CREATE_FAILED" ]
60
+ do
61
+ STATUS=$(openstack coe cluster show $CLUSTER_NAME -c status -f value)
62
+ echo "Current cluster status ... $STATUS $(date)"
63
+ sleep 10
64
+ done
65
+
66
+ openstack coe cluster show $CLUSTER_NAME
67
+ openstack coe cluster config $CLUSTER_NAME
68
+ export KUBECONFIG=config
69
+
70
+ for m in $(ls test)
71
+ do
72
+ kubectl create --validate=false -f test/${m}
73
+ done
74
+ for m in $(ls test)
75
+ do
76
+ kubectl wait --for=condition=complete --timeout=600s -l ci=true --all-namespaces job
77
+ done
74
78
dependencies :
75
- - build
79
+ - buildimg
76
80
except :
77
81
- master
78
82
- qa
79
83
80
84
cleanup test clusters :
81
85
stage : cleanup
82
- image : gitlab-registry.cern.ch/cloud/ciadm
83
- script :
84
- - openstack coe cluster show ${CLUSTER_NAME}; if [ $? -eq 0 ]; then openstack coe cluster delete ${CLUSTER_NAME} || true; fi
85
- - sleep 5
86
- - while openstack coe cluster show ${CLUSTER_NAME}; [ $? -eq 0 ]; do sleep 3; done
86
+ image : gitlab-registry.cern.ch/cloud/ciadm:v0.3.6
87
+ script : |
88
+ STATUS=$(openstack coe cluster show $CLUSTER_NAME -c status -f value)
89
+ while true
90
+ do
91
+ if [ "${STATUS}" != "DELETE_IN_PROGRESS" ]
92
+ then
93
+ openstack coe cluster delete $CLUSTER_NAME || true
94
+ fi
95
+ sleep 10
96
+ if STATUS=$(openstack coe cluster show $CLUSTER_NAME -c status -f value)
97
+ then
98
+ echo "Current cluster status ... $STATUS $(date)"
99
+ else
100
+ echo "done"
101
+ break
102
+ fi
103
+ done
87
104
when : always
88
105
except :
89
106
- master
90
107
- qa
91
-
92
- deploy tag :
93
- stage : deploy
94
- image : gitlab-registry.cern.ch/cloud/ciadm
95
- script :
96
- - docker pull gitlab-registry.cern.ch/cloud-infrastructure/cvmfs-csi/cvmfsplugin:$CI_COMMIT_SHA
97
- - docker tag gitlab-registry.cern.ch/cloud-infrastructure/cvmfs-csi/cvmfsplugin:$CI_COMMIT_SHA gitlab-registry.cern.ch/cloud-infrastructure/cvmfs-csi/cvmfsplugin:$CI_COMMIT_TAG
98
- - docker push gitlab-registry.cern.ch/cloud-infrastructure/cvmfs-csi/cvmfsplugin:$CI_COMMIT_TAG
99
- only :
100
- - tags
101
- tags :
102
- - docker-privileged
0 commit comments