Commit 30c5b1c4 authored by cdelort's avatar cdelort
Browse files

CORALCOOL-3081: Replace go script by python script, and .gitlab-ci.yml

parent 6d1c328a
---
variables:
LCG_VERSION: 94
---
build_x86_64-centos7-clang10-dbg_dev3:
variables:
BINARY_TAG: x86_64-centos7-clang10-dbg
artifacts:
when: always
expire_in: "3 mos"
paths:
- logs/qmtestCool/$BINARY_TAG
before_script:
- "echo $BINARY_TAG $CI_COMMIT_REF_NAME"
- "export highest=$(curl --header \"PRIVATE-TOKEN: $PRIVATE_TOKEN\" \"https://gitlab.cern.ch/api/v4/projects/25684/jobs?per_page=100\" | jq \".[] | select(.name == \\\"build_x86_64-centos7-clang10-dbg_dev3\\\") | select(.ref == \\\"${CI_COMMIT_REF_NAME}\\\") | .id\" | sort -n | tail -1)"
- "echo $highest"
- "curl -L --header \"PRIVATE-TOKEN: $PRIVATE_TOKEN\" \"https://gitlab.cern.ch/api/v4/projects/25684/jobs/$highest/artifacts\" > coral-build_x86_64-centos7-clang10-dbg_dev3.zip"
- "ls -l coral-build_x86_64-centos7-clang10-dbg_dev3.zip"
- "unzip coral-build_x86_64-centos7-clang10-dbg_dev3.zip -d ./coral"
script:
- "./cc-build -b $BINARY_TAG -v dev3/latest"
- cd $BINARY_TAG/
- ./cc-sh
- "export CORAL_AUTH_PATH=/home/gitlab-runner/"
- "export CORAL_DBLOOKUP_PATH=/home/gitlab-runner/"
- "export COOL_QMTEST_USER=sftnight"
- "time ./qmtestRun.sh"
- ../logs/qmtestCool/summarizeAll.sh
- "cd ../logs/qmtestCool/"
- "mkdir $BINARY_TAG"
- "cp $BINARY_TAG.summary $BINARY_TAG.xml ./$BINARY_TAG"
- "! grep FAIL $BINARY_TAG.summary"
tags:
- centos7
build_x86_64-centos7-clang10-opt_dev3:
variables:
BINARY_TAG: x86_64-centos7-clang10-opt
artifacts:
when: always
expire_in: "3 mos"
paths:
- logs/qmtestCool/$BINARY_TAG
before_script:
- "echo $BINARY_TAG $CI_COMMIT_REF_NAME"
- "export highest=$(curl --header \"PRIVATE-TOKEN: $PRIVATE_TOKEN\" \"https://gitlab.cern.ch/api/v4/projects/25684/jobs?per_page=100\" | jq \".[] | select(.name == \\\"build_x86_64-centos7-clang10-opt_dev3\\\") | select(.ref == \\\"${CI_COMMIT_REF_NAME}\\\") | .id\" | sort -n | tail -1)"
- "echo $highest"
- "curl -L --header \"PRIVATE-TOKEN: $PRIVATE_TOKEN\" \"https://gitlab.cern.ch/api/v4/projects/25684/jobs/$highest/artifacts\" > coral-build_x86_64-centos7-clang10-opt_dev3.zip"
- "ls -l coral-build_x86_64-centos7-clang10-opt_dev3.zip"
- "unzip coral-build_x86_64-centos7-clang10-opt_dev3.zip -d ./coral"
script:
- "./cc-build -b $BINARY_TAG -v dev3/latest"
- cd $BINARY_TAG/
- ./cc-sh
- "export CORAL_AUTH_PATH=/home/gitlab-runner/"
- "export CORAL_DBLOOKUP_PATH=/home/gitlab-runner/"
- "export COOL_QMTEST_USER=sftnight"
- "time ./qmtestRun.sh"
- ../logs/qmtestCool/summarizeAll.sh
- "cd ../logs/qmtestCool/"
- "mkdir $BINARY_TAG"
- "cp $BINARY_TAG.summary $BINARY_TAG.xml ./$BINARY_TAG"
- "! grep FAIL $BINARY_TAG.summary"
tags:
- centos7
build_x86_64-centos7-gcc10-dbg_dev3:
variables:
BINARY_TAG: x86_64-centos7-gcc10-dbg
artifacts:
when: always
expire_in: "3 mos"
paths:
- logs/qmtestCool/$BINARY_TAG
before_script:
- "echo $BINARY_TAG $CI_COMMIT_REF_NAME"
- "export highest=$(curl --header \"PRIVATE-TOKEN: $PRIVATE_TOKEN\" \"https://gitlab.cern.ch/api/v4/projects/25684/jobs?per_page=100\" | jq \".[] | select(.name == \\\"build_x86_64-centos7-gcc10-dbg_dev3\\\") | select(.ref == \\\"${CI_COMMIT_REF_NAME}\\\") | .id\" | sort -n | tail -1)"
- "echo $highest"
- "curl -L --header \"PRIVATE-TOKEN: $PRIVATE_TOKEN\" \"https://gitlab.cern.ch/api/v4/projects/25684/jobs/$highest/artifacts\" > coral-build_x86_64-centos7-gcc10-dbg_dev3.zip"
- "ls -l coral-build_x86_64-centos7-gcc10-dbg_dev3.zip"
- "unzip coral-build_x86_64-centos7-gcc10-dbg_dev3.zip -d ./coral"
script:
- "./cc-build -b $BINARY_TAG -v dev3/latest"
- cd $BINARY_TAG/
- ./cc-sh
- "export CORAL_AUTH_PATH=/home/gitlab-runner/"
- "export CORAL_DBLOOKUP_PATH=/home/gitlab-runner/"
- "export COOL_QMTEST_USER=sftnight"
- "time ./qmtestRun.sh"
- ../logs/qmtestCool/summarizeAll.sh
- "cd ../logs/qmtestCool/"
- "mkdir $BINARY_TAG"
- "cp $BINARY_TAG.summary $BINARY_TAG.xml ./$BINARY_TAG"
- "! grep FAIL $BINARY_TAG.summary"
tags:
- centos7
build_x86_64-centos7-gcc10-opt_dev3:
variables:
BINARY_TAG: x86_64-centos7-gcc10-opt
artifacts:
when: always
expire_in: "3 mos"
paths:
- logs/qmtestCool/$BINARY_TAG
before_script:
- "echo $BINARY_TAG $CI_COMMIT_REF_NAME"
- "export highest=$(curl --header \"PRIVATE-TOKEN: $PRIVATE_TOKEN\" \"https://gitlab.cern.ch/api/v4/projects/25684/jobs?per_page=100\" | jq \".[] | select(.name == \\\"build_x86_64-centos7-gcc10-opt_dev3\\\") | select(.ref == \\\"${CI_COMMIT_REF_NAME}\\\") | .id\" | sort -n | tail -1)"
- "echo $highest"
- "curl -L --header \"PRIVATE-TOKEN: $PRIVATE_TOKEN\" \"https://gitlab.cern.ch/api/v4/projects/25684/jobs/$highest/artifacts\" > coral-build_x86_64-centos7-gcc10-opt_dev3.zip"
- "ls -l coral-build_x86_64-centos7-gcc10-opt_dev3.zip"
- "unzip coral-build_x86_64-centos7-gcc10-opt_dev3.zip -d ./coral"
script:
- "./cc-build -b $BINARY_TAG -v dev3/latest"
- cd $BINARY_TAG/
- ./cc-sh
- "export CORAL_AUTH_PATH=/home/gitlab-runner/"
- "export CORAL_DBLOOKUP_PATH=/home/gitlab-runner/"
- "export COOL_QMTEST_USER=sftnight"
- "time ./qmtestRun.sh"
- ../logs/qmtestCool/summarizeAll.sh
- "cd ../logs/qmtestCool/"
- "mkdir $BINARY_TAG"
- "cp $BINARY_TAG.summary $BINARY_TAG.xml ./$BINARY_TAG"
- "! grep FAIL $BINARY_TAG.summary"
tags:
- centos7
build_x86_64-centos7-gcc8-dbg_dev3:
variables:
BINARY_TAG: x86_64-centos7-gcc8-dbg
artifacts:
when: always
expire_in: "3 mos"
paths:
- logs/qmtestCool/$BINARY_TAG
before_script:
- "echo $BINARY_TAG $CI_COMMIT_REF_NAME"
- "export highest=$(curl --header \"PRIVATE-TOKEN: $PRIVATE_TOKEN\" \"https://gitlab.cern.ch/api/v4/projects/25684/jobs?per_page=100\" | jq \".[] | select(.name == \\\"build_x86_64-centos7-gcc8-dbg_dev3\\\") | select(.ref == \\\"${CI_COMMIT_REF_NAME}\\\") | .id\" | sort -n | tail -1)"
- "echo $highest"
- "curl -L --header \"PRIVATE-TOKEN: $PRIVATE_TOKEN\" \"https://gitlab.cern.ch/api/v4/projects/25684/jobs/$highest/artifacts\" > coral-build_x86_64-centos7-gcc8-dbg_dev3.zip"
- "ls -l coral-build_x86_64-centos7-gcc8-dbg_dev3.zip"
- "unzip coral-build_x86_64-centos7-gcc8-dbg_dev3.zip -d ./coral"
script:
- "./cc-build -b $BINARY_TAG -v dev3/latest"
- cd $BINARY_TAG/
- ./cc-sh
- "export CORAL_AUTH_PATH=/home/gitlab-runner/"
- "export CORAL_DBLOOKUP_PATH=/home/gitlab-runner/"
- "export COOL_QMTEST_USER=sftnight"
- "time ./qmtestRun.sh"
- ../logs/qmtestCool/summarizeAll.sh
- "cd ../logs/qmtestCool/"
- "mkdir $BINARY_TAG"
- "cp $BINARY_TAG.summary $BINARY_TAG.xml ./$BINARY_TAG"
- "! grep FAIL $BINARY_TAG.summary"
tags:
- centos7
build_x86_64-centos7-gcc8-opt_dev3:
variables:
BINARY_TAG: x86_64-centos7-gcc8-opt
......@@ -11,13 +164,75 @@ build_x86_64-centos7-gcc8-opt_dev3:
- logs/qmtestCool/$BINARY_TAG
before_script:
- "echo $BINARY_TAG $CI_COMMIT_REF_NAME"
- "export highest=`curl --header \"PRIVATE-TOKEN: $PRIVATE_TOKEN\" \"https://gitlab.cern.ch/api/v4/projects/25684/jobs?per_page=100\" | jq \".[] | select(.name == \\\"build_${BINARY_TAG}_dev3\\\") | select(.ref == \\\"${CI_COMMIT_REF_NAME}\\\") | .id\" | sort -n | tail -1`"
- "export highest=$(curl --header \"PRIVATE-TOKEN: $PRIVATE_TOKEN\" \"https://gitlab.cern.ch/api/v4/projects/25684/jobs?per_page=100\" | jq \".[] | select(.name == \\\"build_x86_64-centos7-gcc8-opt_dev3\\\") | select(.ref == \\\"${CI_COMMIT_REF_NAME}\\\") | .id\" | sort -n | tail -1)"
- "echo $highest"
- "curl -L --header \"PRIVATE-TOKEN: $PRIVATE_TOKEN\" \"https://gitlab.cern.ch/api/v4/projects/25684/jobs/$highest/artifacts\" > coral-build_x86_64-centos7-gcc8-opt_dev3.zip"
- "ls -l coral-build_x86_64-centos7-gcc8-opt_dev3.zip"
- "unzip coral-build_x86_64-centos7-gcc8-opt_dev3.zip -d ./coral"
script:
- "./cc-build -b $BINARY_TAG"
- "./cc-build -b $BINARY_TAG -v dev3/latest"
- cd $BINARY_TAG/
- ./cc-sh
- "export CORAL_AUTH_PATH=/home/gitlab-runner/"
- "export CORAL_DBLOOKUP_PATH=/home/gitlab-runner/"
- "export COOL_QMTEST_USER=sftnight"
- "time ./qmtestRun.sh"
- ../logs/qmtestCool/summarizeAll.sh
- "cd ../logs/qmtestCool/"
- "mkdir $BINARY_TAG"
- "cp $BINARY_TAG.summary $BINARY_TAG.xml ./$BINARY_TAG"
- "! grep FAIL $BINARY_TAG.summary"
tags:
- centos7
build_x86_64-centos7-gcc9-dbg_dev3:
variables:
BINARY_TAG: x86_64-centos7-gcc9-dbg
artifacts:
when: always
expire_in: "3 mos"
paths:
- logs/qmtestCool/$BINARY_TAG
before_script:
- "echo $BINARY_TAG $CI_COMMIT_REF_NAME"
- "export highest=$(curl --header \"PRIVATE-TOKEN: $PRIVATE_TOKEN\" \"https://gitlab.cern.ch/api/v4/projects/25684/jobs?per_page=100\" | jq \".[] | select(.name == \\\"build_x86_64-centos7-gcc9-dbg_dev3\\\") | select(.ref == \\\"${CI_COMMIT_REF_NAME}\\\") | .id\" | sort -n | tail -1)"
- "echo $highest"
- "curl -L --header \"PRIVATE-TOKEN: $PRIVATE_TOKEN\" \"https://gitlab.cern.ch/api/v4/projects/25684/jobs/$highest/artifacts\" > coral-build_x86_64-centos7-gcc9-dbg_dev3.zip"
- "ls -l coral-build_x86_64-centos7-gcc9-dbg_dev3.zip"
- "unzip coral-build_x86_64-centos7-gcc9-dbg_dev3.zip -d ./coral"
script:
- "./cc-build -b $BINARY_TAG -v dev3/latest"
- cd $BINARY_TAG/
- ./cc-sh
- "export CORAL_AUTH_PATH=/home/gitlab-runner/"
- "export CORAL_DBLOOKUP_PATH=/home/gitlab-runner/"
- "export COOL_QMTEST_USER=sftnight"
- "time ./qmtestRun.sh"
- ../logs/qmtestCool/summarizeAll.sh
- "cd ../logs/qmtestCool/"
- "mkdir $BINARY_TAG"
- "cp $BINARY_TAG.summary $BINARY_TAG.xml ./$BINARY_TAG"
- "! grep FAIL $BINARY_TAG.summary"
tags:
- centos7
build_x86_64-centos7-gcc9-opt_dev3:
variables:
BINARY_TAG: x86_64-centos7-gcc9-opt
artifacts:
when: always
expire_in: "3 mos"
paths:
- logs/qmtestCool/$BINARY_TAG
before_script:
- "echo $BINARY_TAG $CI_COMMIT_REF_NAME"
- "export highest=$(curl --header \"PRIVATE-TOKEN: $PRIVATE_TOKEN\" \"https://gitlab.cern.ch/api/v4/projects/25684/jobs?per_page=100\" | jq \".[] | select(.name == \\\"build_x86_64-centos7-gcc9-opt_dev3\\\") | select(.ref == \\\"${CI_COMMIT_REF_NAME}\\\") | .id\" | sort -n | tail -1)"
- "echo $highest"
- "curl -L --header \"PRIVATE-TOKEN: $PRIVATE_TOKEN\" \"https://gitlab.cern.ch/api/v4/projects/25684/jobs/$highest/artifacts\" > coral-build_x86_64-centos7-gcc9-opt_dev3.zip"
- "ls -l coral-build_x86_64-centos7-gcc9-opt_dev3.zip"
- "unzip coral-build_x86_64-centos7-gcc9-opt_dev3.zip -d ./coral"
script:
- "./cc-build -b $BINARY_TAG -v dev3/latest"
- cd $BINARY_TAG/
- ./cc-sh
- "export CORAL_AUTH_PATH=/home/gitlab-runner/"
......@@ -32,9 +247,7 @@ build_x86_64-centos7-gcc8-opt_dev3:
tags:
- centos7
variables:
LCG_VERSION: 94
build_x86_64-centos7-gcc8-opt_dev3python3:
build_x86_64-centos7-gcc8-opt_dev3python2:
variables:
BINARY_TAG: x86_64-centos7-gcc8-opt
artifacts:
......@@ -44,13 +257,44 @@ build_x86_64-centos7-gcc8-opt_dev3python3:
- logs/qmtestCool/$BINARY_TAG
before_script:
- "echo $BINARY_TAG $CI_COMMIT_REF_NAME"
- "export highest=`curl --header \"PRIVATE-TOKEN: $PRIVATE_TOKEN\" \"https://gitlab.cern.ch/api/v4/projects/25684/jobs?per_page=100\" | jq \".[] | select(.name == \\\"build_${BINARY_TAG}_dev3python3\\\") | select(.ref == \\\"${CI_COMMIT_REF_NAME}\\\") | .id\" | sort -n | tail -1`"
- "export highest=$(curl --header \"PRIVATE-TOKEN: $PRIVATE_TOKEN\" \"https://gitlab.cern.ch/api/v4/projects/25684/jobs?per_page=100\" | jq \".[] | select(.name == \\\"build_x86_64-centos7-gcc8-opt_dev3python2\\\") | select(.ref == \\\"${CI_COMMIT_REF_NAME}\\\") | .id\" | sort -n | tail -1)"
- "echo $highest"
- "curl -L --header \"PRIVATE-TOKEN: $PRIVATE_TOKEN\" \"https://gitlab.cern.ch/api/v4/projects/25684/jobs/$highest/artifacts\" > coral-build_x86_64-centos7-gcc8-opt_dev3python2.zip"
- "ls -l coral-build_x86_64-centos7-gcc8-opt_dev3python2.zip"
- "unzip coral-build_x86_64-centos7-gcc8-opt_dev3python2.zip -d ./coral"
script:
- "./cc-build -b $BINARY_TAG -v dev3python2/latest"
- cd $BINARY_TAG/
- ./cc-sh
- "export CORAL_AUTH_PATH=/home/gitlab-runner/"
- "export CORAL_DBLOOKUP_PATH=/home/gitlab-runner/"
- "export COOL_QMTEST_USER=sftnight"
- "time ./qmtestRun.sh"
- ../logs/qmtestCool/summarizeAll.sh
- "cd ../logs/qmtestCool/"
- "mkdir $BINARY_TAG"
- "cp $BINARY_TAG.summary $BINARY_TAG.xml ./$BINARY_TAG"
- "! grep FAIL $BINARY_TAG.summary"
tags:
- centos7
build_x86_64-centos7-gcc9-opt_dev3python2:
variables:
BINARY_TAG: x86_64-centos7-gcc9-opt
artifacts:
when: always
expire_in: "3 mos"
paths:
- logs/qmtestCool/$BINARY_TAG
before_script:
- "echo $BINARY_TAG $CI_COMMIT_REF_NAME"
- "export highest=$(curl --header \"PRIVATE-TOKEN: $PRIVATE_TOKEN\" \"https://gitlab.cern.ch/api/v4/projects/25684/jobs?per_page=100\" | jq \".[] | select(.name == \\\"build_x86_64-centos7-gcc9-opt_dev3python2\\\") | select(.ref == \\\"${CI_COMMIT_REF_NAME}\\\") | .id\" | sort -n | tail -1)"
- "echo $highest"
- "curl -L --header \"PRIVATE-TOKEN: $PRIVATE_TOKEN\" \"https://gitlab.cern.ch/api/v4/projects/25684/jobs/$highest/artifacts\" > coral-build_x86_64-centos7-gcc8-opt_dev3python3.zip"
- "ls -l coral-build_x86_64-centos7-gcc8-opt_dev3python3.zip"
- "unzip coral-build_x86_64-centos7-gcc8-opt_dev3python3.zip -d ./coral"
- "curl -L --header \"PRIVATE-TOKEN: $PRIVATE_TOKEN\" \"https://gitlab.cern.ch/api/v4/projects/25684/jobs/$highest/artifacts\" > coral-build_x86_64-centos7-gcc9-opt_dev3python2.zip"
- "ls -l coral-build_x86_64-centos7-gcc9-opt_dev3python2.zip"
- "unzip coral-build_x86_64-centos7-gcc9-opt_dev3python2.zip -d ./coral"
script:
- "./cc-build -b $BINARY_TAG -v dev3python3/latest"
- "./cc-build -b $BINARY_TAG -v dev3python2/latest"
- cd $BINARY_TAG/
- ./cc-sh
- "export CORAL_AUTH_PATH=/home/gitlab-runner/"
......@@ -64,3 +308,4 @@ build_x86_64-centos7-gcc8-opt_dev3python3:
- "! grep FAIL $BINARY_TAG.summary"
tags:
- centos7
//generate gitlab-ci.yaml for coral and cool:
//go run script-gitlab-ci.yml.go
//mv coral.gitlab-ci.yml .gitlab-ci.yml
package main
import (
"io/ioutil"
"regexp"
)
//generate gitlab-ci.yaml for coral for python3: -v dev3python3/latest
func coralGitlab(platforms map[string][]string) string {
//first part of the file
start := `---
variables:
LCG_VERSION: 94
stages:
- build
- test
`
//add accumulates all the build and test parts of all the platforms
var add string
for binaryTag, pythons := range platforms {
for _, pythonVersion := range pythons {
re := regexp.MustCompile("(.*?)-(.*?)-")
tag := re.FindStringSubmatch(binaryTag)[2]
//build part
file := `
artifacts:
when: always
expire_in: "3 mos"
paths:
- $BINARY_TAG/
- logs/
`
if pythonVersion == "python3" {
file = file + ` script: "./cc-build -b $BINARY_TAG -v dev3python3/latest"`
} else {
file = file + ` script: "./cc-build -b $BINARY_TAG"`
}
file = file + `
stage: build
tags:
`
//stringToChange is the part of the file for a given platform
stringToChange := "build_" + binaryTag + "_" + pythonVersion + ":\n variables:\n BINARY_TAG: " + binaryTag + file + " - " + tag + "\n"
// test part
file = ` artifacts:
when: always
expire_in: "3 mos"
paths:
- logs/qmtestCoral/$BINARY_TAG
script:
- cd $BINARY_TAG/
- ./cc-sh
- "export CORAL_AUTH_PATH=/home/gitlab-runner/"
- "export CORAL_DBLOOKUP_PATH=/home/gitlab-runner/"
- "time ./qmtestRun.sh"
- ../logs/qmtestCoral/summarizeAll.sh
- "cd ../logs/qmtestCoral/"
- "mkdir $BINARY_TAG"
- "cp $BINARY_TAG.summary $BINARY_TAG.xml ./$BINARY_TAG"
- "! grep FAIL $BINARY_TAG.summary"
stage: test
when: always
tags:
- `
stringToChange += "test_" + binaryTag + "_" + pythonVersion + ":\n variables:\n BINARY_TAG: " + binaryTag +
"\n dependencies:\n - build_" + binaryTag + "_" + pythonVersion + "\n" + file + tag + "\n"
add += stringToChange
}
}
return start + add
}
func coolGitlab(platforms map[string][]string) string {
start := `---
variables:
LCG_VERSION: 94
stages:
- build
- test
`
//add accumulates all the build and test parts of all the platforms
var add string
for binaryTag, pythons := range platforms {
for _, pythonVersion := range pythons {
re := regexp.MustCompile("(.*?)-(.*?)-")
tag := re.FindStringSubmatch(binaryTag)[2]
//build part
name := "build_" + binaryTag + "_" + pythonVersion
file := `
artifacts:
when: always
expire_in: "3 mos"
paths:
- $BINARY_TAG/
- logs/
before_script:
- "curl -L --header \"PRIVATE-TOKEN: $PRIVATE_TOKEN\" \"https://gitlab.cern.ch/api/v4/projects/25684/jobs/artifacts/master/download?job=` + name + `\" > coral-` + name + `.zip"
- "unzip coral-` + name + `.zip -d ./coral"
script: "./cc-build -b $BINARY_TAG"
stage: build
tags:
`
stringToChange := "build_" + binaryTag + "_" + pythonVersion + ":\n variables:\n BINARY_TAG: " + binaryTag + file + " - " + tag + "\n"
// test part
file = ` artifacts:
when: always
expire_in: "3 mos"
paths:
- logs/qmtestCool/$BINARY_TAG
before_script:
- "curl -L --header \"PRIVATE-TOKEN: $PRIVATE_TOKEN\" \"https://gitlab.cern.ch/api/v4/projects/25684/jobs/artifacts/master/download?job=` + name + `\" > coral-` + name + `.zip"
- "unzip coral-` + name + `.zip -d ./coral"
script:
- cd $BINARY_TAG/
- ./cc-sh
- "export CORAL_AUTH_PATH=/home/gitlab-runner/"
- "export CORAL_DBLOOKUP_PATH=/home/gitlab-runner/"
- "export COOL_QMTEST_USER=sftnight"
- "time ./qmtestRun.sh"
- ../logs/qmtestCool/summarizeAll.sh
- "cd ../logs/qmtestCool/"
- "mkdir $BINARY_TAG"
- "cp $BINARY_TAG.summary $BINARY_TAG.xml ./$BINARY_TAG"
- "! grep FAIL $BINARY_TAG.summary"
stage: test
when: always
tags:
- `
stringToChange += "test_" + binaryTag + "_" + pythonVersion + ":\n variables:\n BINARY_TAG: " + binaryTag +
"\n dependencies:\n - build_" + binaryTag + "_" + pythonVersion + "\n" + file + tag + "\n"
add += stringToChange
}
}
return start + add
}
func main() {
// TODO add ubuntu
platforms := map[string][]string{"x86_64-centos7-gcc62-dbg": []string{"python2"}, "x86_64-centos7-gcc62-opt": []string{"python2", "python3"},
"x86_64-centos7-gcc7-opt": []string{"python2", "python3"}, "x86_64-centos7-gcc8-opt": []string{"python2", "python3"}, "x86_64-centos7-clang60-opt": []string{"python2", "python3"},
"x86_64-slc6-gcc62-dbg": []string{"python2"}, "x86_64-slc6-gcc62-opt": []string{"python2", "python3"}, "x86_64-slc6-gcc7-opt": []string{"python2", "python3"},
"x86_64-slc6-gcc8-opt": []string{"python2", "python3"}, "x86_64-slc6-clang60-opt": []string{"python2", "python3"}}
err := ioutil.WriteFile("coral.gitlab-ci.yml", []byte(coralGitlab(platforms)), 0644)
if err != nil {
panic(err)
}
err = ioutil.WriteFile("cool.gitlab-ci.yml", []byte(coolGitlab(platforms)), 0644)
if err != nil {
panic(err)
}
}
#!/usr/bin/env python3
def build_gitlabci(binary_tag, view, OS):
name = f"build_{binary_tag}_{view}"
return f"""{name}:
variables:
BINARY_TAG: {binary_tag}
artifacts:
when: always
expire_in: "3 mos"
paths:
- logs/qmtestCool/$BINARY_TAG
before_script:
- "echo $BINARY_TAG $CI_COMMIT_REF_NAME"
- "export highest=$(curl --header \\\"PRIVATE-TOKEN: $PRIVATE_TOKEN\\\" \\\"https://gitlab.cern.ch/api/v4/projects/25684/jobs?per_page=100\\\" | jq \\\".[] | select(.name == \\\\\\\"{name}\\\\\\\") | select(.ref == \\\\\\\"${{CI_COMMIT_REF_NAME}}\\\\\\\") | .id\\\" | sort -n | tail -1)"
- "echo $highest"
- "curl -L --header \\\"PRIVATE-TOKEN: $PRIVATE_TOKEN\\\" \\\"https://gitlab.cern.ch/api/v4/projects/25684/jobs/$highest/artifacts\\\" > coral-{name}.zip"
- "ls -l coral-{name}.zip"
- "unzip coral-{name}.zip -d ./coral"
script:
- "./cc-build -b $BINARY_TAG -v {view}/latest"
- cd $BINARY_TAG/
- ./cc-sh
- "export CORAL_AUTH_PATH=/home/gitlab-runner/"
- "export CORAL_DBLOOKUP_PATH=/home/gitlab-runner/"
- "export COOL_QMTEST_USER=sftnight"
- "time ./qmtestRun.sh"
- ../logs/qmtestCool/summarizeAll.sh
- "cd ../logs/qmtestCool/"
- "mkdir $BINARY_TAG"
- "cp $BINARY_TAG.summary $BINARY_TAG.xml ./$BINARY_TAG"
- "! grep FAIL $BINARY_TAG.summary"
tags:
- {OS}
"""
platforms=['dev3-x86_64-centos7-clang10-dbg', 'dev3-x86_64-centos7-clang10-opt', 'dev3-x86_64-centos7-gcc10-dbg', 'dev3-x86_64-centos7-gcc10-opt', 'dev3-x86_64-centos7-gcc8-dbg', 'dev3-x86_64-centos7-gcc8-opt', 'dev3-x86_64-centos7-gcc9-dbg', 'dev3-x86_64-centos7-gcc9-opt', 'dev3python2-x86_64-centos7-gcc8-opt', 'dev3python2-x86_64-centos7-gcc9-opt']
with open('.gitlab-ci.yml', 'w') as f:
f.write("""---
""")
for platform in platforms:
list = platform.split('-')
f.write(build_gitlabci(platform[platform.find('-')+1:], list[0], list[2]))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment