diff options
Diffstat (limited to 'jjb/functest/functest-kubernetes-ng.yaml')
-rw-r--r-- | jjb/functest/functest-kubernetes-ng.yaml | 426 |
1 files changed, 426 insertions, 0 deletions
diff --git a/jjb/functest/functest-kubernetes-ng.yaml b/jjb/functest/functest-kubernetes-ng.yaml new file mode 100644 index 000000000..c447d5398 --- /dev/null +++ b/jjb/functest/functest-kubernetes-ng.yaml @@ -0,0 +1,426 @@ +--- +- functest-kubernetes-ng-containers: &functest-kubernetes-ng-containers + name: 'functest-kubernetes-ng-containers' + repo: '{repo}' + port: '{port}' + container: '{container}' + tag: '{tag}' + +- functest-kubernetes-ng-params: &functest-kubernetes-ng-params + name: 'functest-kubernetes-ng-params' + repo: 'opnfv' + port: + tag: + - v1.20: + buildargs: + branch: stable/leguer + slave: lf-virtual1 + dependency: 3.12 + from: s/:leguer$/:v1.20/g + - v1.19: + buildargs: + branch: stable/kali + slave: lf-virtual1 + dependency: 3.11 + from: s/:kali$/:v1.19/g + - v1.18: + branch: stable/kali + slave: lf-virtual1 + dependency: 3.11 + buildargs: --build-arg K8S_TAG=1.18 + from: s/:kali$/:v1.18/g + - v1.17: + buildargs: + branch: stable/jerma + slave: lf-virtual1 + dependency: 3.10 + from: s/:jerma$/:v1.17/g + - v1.16: + branch: stable/jerma + slave: lf-virtual1 + dependency: 3.10 + buildargs: --build-arg K8S_TAG=1.16 + from: s/:jerma$/:v1.16/g + - v1.15: + buildargs: + branch: stable/iruya + slave: lf-virtual1 + dependency: 3.9 + from: s/:iruya$/:v1.15/g + - v1.14: + branch: stable/iruya + slave: lf-virtual1 + dependency: 3.9 + buildargs: --build-arg K8S_TAG=1.14 + from: s/:iruya$/:v1.14/g + - v1.13: + buildargs: + branch: stable/hunter + slave: lf-virtual1 + dependency: 3.9 + from: s/:hunter$/:v1.13/g + +- functest-kubernetes-ng-jobs: &functest-kubernetes-ng-jobs + name: 'functest-kubernetes-ng-jobs' + current-parameters: true + +- parameter: + name: functest-kubernetes-ng-slave + parameters: + - label: + name: slave + default: '{slave}' + + +- functest-kubernetes-ng-build-containers: &functest-kubernetes-ng-build-containers + name: 'functest-kubernetes-ng-build-containers' + <<: *functest-kubernetes-ng-containers + ref_arg: '{ref_arg}' + path: '{path}' + buildargs: '{buildargs}' + from: '{from}' + +- builder: + name: functest-kubernetes-ng-build-containers + builders: + - shell: | + set +x + if [ "{repo}" = "_" ]; then + image={container}:{tag} + elif [ "{port}" = "None" ]; then + image={repo}/{container}:{tag} + else + image={repo}:{port}/{container}:{tag} + fi + build_args="" + if [ "{buildargs}" != "None" ]; then + build_args="{buildargs}" + fi + if [ "{ref_arg}" != "None" ]; then + build_args="$build_args --build-arg {ref_arg}={ref}" + fi + cd {path} + if [ "{from}" != "None" ]; then + sed -i {from} Dockerfile + fi + sudo docker build $build_args \ + --pull=false --no-cache --force-rm=true \ + -t $image . + +- scm: + name: functest-kubernetes-ng-scm + scm: + - git: + url: 'https://gerrit.opnfv.org/gerrit/functest-kubernetes' + refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*' + branches: + - '{ref}' + +- functest-kubernetes-ng-dep: &functest-kubernetes-ng-dep + name: 'functest-kubernetes-ng-containers' + repo: '{repo}' + port: '{port}' + tag: '{tag}' + dependency: '{dependency}' + +- builder: + name: functest-kubernetes-ng-pull-dep-images + builders: + - shell: | + set +x + if [ "_" = "_" ]; then + image=alpine:{dependency} + elif [ "_" = "None" ]; then + image=_/alpine:{dependency} + else + image=_:/alpine{dependency} + fi + sudo docker pull $image || true + +- builder: + name: functest-kubernetes-ng-remove-dep-images + builders: + - shell: | + set +x + if [ "_" = "_" ]; then + image=alpine:{dependency} + elif [ "_" = "None" ]; then + image=_/alpine:{dependency} + else + image=_:/alpine{dependency} + fi + sudo docker rmi $image || true + +- job-template: + name: 'functest-kubernetes-ng-{repo}-{tag}-dep-pull' + parameters: + - functest-kubernetes-ng-slave: + slave: '{slave}' + builders: + - functest-kubernetes-ng-pull-dep-images: + <<: *functest-kubernetes-ng-dep + +- project: + name: 'functest-kubernetes-ng-{repo}-{tag}-dep-pull' + <<: *functest-kubernetes-ng-params + jobs: + - 'functest-kubernetes-ng-{repo}-{tag}-dep-pull' + +- job-template: + name: 'functest-kubernetes-ng-{repo}-{tag}-dep-rmi' + parameters: + - functest-kubernetes-ng-slave: + slave: '{slave}' + builders: + - functest-kubernetes-ng-remove-dep-images: + <<: *functest-kubernetes-ng-dep + +- project: + name: 'functest-kubernetes-ng-{repo}-{tag}-dep-rmi' + <<: *functest-kubernetes-ng-params + jobs: + - 'functest-kubernetes-ng-{repo}-{tag}-dep-rmi' + + +- builder: + name: functest-kubernetes-ng-push-containers + builders: + - shell: | + set +x + if [ "{repo}" = "_" ]; then + image={container}:{tag} + elif [ "{port}" = "None" ]; then + image={repo}/{container}:{tag} + else + image={repo}:{port}/{container}:{tag} + fi + sudo docker push $image + +- trigger: + name: functest-kubernetes-ng-commit + triggers: + - pollscm: + cron: "*/30 * * * *" + +- job-template: + name: 'functest-kubernetes-ng-{repo}-{container}-{tag}-build' + parameters: + - functest-kubernetes-ng-slave: + slave: '{slave}' + scm: + - functest-kubernetes-ng-scm: + ref: '{branch}' + builders: + - functest-kubernetes-ng-build-containers: + <<: *functest-kubernetes-ng-build-containers + ref: '{branch}' + buildargs: '{buildargs}' + - functest-kubernetes-ng-push-containers: + <<: *functest-kubernetes-ng-build-containers + ref: '{branch}' + +- project: + name: functest-kubernetes-ng-opnfv-functest-kubernetes-core-{tag}-build + <<: *functest-kubernetes-ng-params + container: functest-kubernetes-core + ref_arg: BRANCH + path: docker/core + jobs: + - 'functest-kubernetes-ng-{repo}-{container}-{tag}-build' + +- project: + name: functest-kubernetes-ng-opnfv-functest-kubernetes-healthcheck-{tag}-build + <<: *functest-kubernetes-ng-params + container: functest-kubernetes-healthcheck + ref_arg: + path: docker/healthcheck + jobs: + - 'functest-kubernetes-ng-{repo}-{container}-{tag}-build' + +- project: + name: functest-kubernetes-ng-opnfv-functest-kubernetes-cnf-{tag}-build + <<: *functest-kubernetes-ng-params + container: functest-kubernetes-cnf + ref_arg: BRANCH + path: docker/cnf + jobs: + - 'functest-kubernetes-ng-{repo}-{container}-{tag}-build' + +- project: + name: functest-kubernetes-ng-opnfv-functest-kubernetes-security-{tag}-build + <<: *functest-kubernetes-ng-params + container: functest-kubernetes-security + ref_arg: BRANCH + path: docker/security + jobs: + - 'functest-kubernetes-ng-{repo}-{container}-{tag}-build' + +- project: + name: functest-kubernetes-ng-opnfv-functest-kubernetes-smoke-{tag}-build + <<: *functest-kubernetes-ng-params + container: functest-kubernetes-smoke + ref_arg: + path: docker/smoke + jobs: + - 'functest-kubernetes-ng-{repo}-{container}-{tag}-build' + +- project: + name: functest-kubernetes-ng-opnfv-functest-kubernetes-benchmarking-{tag}-build + <<: *functest-kubernetes-ng-params + container: functest-kubernetes-benchmarking + ref_arg: + path: docker/benchmarking + jobs: + - 'functest-kubernetes-ng-{repo}-{container}-{tag}-build' + + +- job-template: + name: 'functest-kubernetes-ng-{tag}-docker' + project-type: multijob + triggers: + - functest-kubernetes-ng-commit + scm: + - functest-kubernetes-ng-scm: + ref: '{branch}' + parameters: + - functest-kubernetes-ng-slave: + slave: '{slave}' + properties: + - build-blocker: + use-build-blocker: true + blocking-level: 'NODE' + blocking-jobs: + - '^functest-kubernetes-ng-{tag}-(daily|docker|review)$' + builders: + - multijob: + name: remove dependency + projects: + - name: 'functest-kubernetes-ng-{repo}-{tag}-dep-rmi' + <<: *functest-kubernetes-ng-jobs + - multijob: + name: pull dependency + projects: + - name: 'functest-kubernetes-ng-{repo}-{tag}-dep-pull' + <<: *functest-kubernetes-ng-jobs + - multijob: + name: build opnfv/functest-kubernetes-core + projects: + - name: 'functest-kubernetes-ng-opnfv-functest-kubernetes-core-{tag}-build' + <<: *functest-kubernetes-ng-jobs + - multijob: + name: build containers + projects: + - name: 'functest-kubernetes-ng-opnfv-functest-kubernetes-healthcheck-{tag}-build' + <<: *functest-kubernetes-ng-jobs + - name: 'functest-kubernetes-ng-opnfv-functest-kubernetes-cnf-{tag}-build' + <<: *functest-kubernetes-ng-jobs + - name: 'functest-kubernetes-ng-opnfv-functest-kubernetes-security-{tag}-build' + <<: *functest-kubernetes-ng-jobs + - multijob: + name: build opnfv/functest-kubernetes-smoke + projects: + - name: 'functest-kubernetes-ng-opnfv-functest-kubernetes-smoke-{tag}-build' + <<: *functest-kubernetes-ng-jobs + - multijob: + name: build opnfv/functest-kubernetes-benchmarking + projects: + - name: 'functest-kubernetes-ng-opnfv-functest-kubernetes-benchmarking-{tag}-build' + <<: *functest-kubernetes-ng-jobs + +- builder: + name: functest-kubernetes-ng-trivy + builders: + - shell: | + sudo apt-get update && sudo apt-get install curl -y + curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b . + if [ "{repo}" = "_" ]; then + image={container}:{tag} + elif [ "{port}" = "None" ]; then + image={repo}/{container}:{tag} + else + image={repo}:{port}/{container}:{tag} + fi + ./trivy --exit-code 1 $image + +- job-template: + name: 'functest-kubernetes-ng-{repo}-{container}-{tag}-trivy' + triggers: + - timed: '@daily' + parameters: + - functest-kubernetes-ng-slave: + slave: '{slave}' + builders: + - functest-kubernetes-ng-trivy: + <<: *functest-kubernetes-ng-containers + +- project: + name: 'functest-kubernetes-ng-opnfv-functest-kubernetes-core-trivy' + <<: *functest-kubernetes-ng-params + container: 'functest-kubernetes-core' + jobs: + - 'functest-kubernetes-ng-{repo}-{container}-{tag}-trivy' + +- project: + name: 'functest-kubernetes-ng-opnfv-functest-kubernetes-healthcheck-trivy' + <<: *functest-kubernetes-ng-params + container: 'functest-kubernetes-healthcheck' + jobs: + - 'functest-kubernetes-ng-{repo}-{container}-{tag}-trivy' + +- project: + name: 'functest-kubernetes-ng-opnfv-functest-kubernetes-cnf-trivy' + <<: *functest-kubernetes-ng-params + container: 'functest-kubernetes-cnf' + jobs: + - 'functest-kubernetes-ng-{repo}-{container}-{tag}-trivy' + +- project: + name: 'functest-kubernetes-ng-opnfv-functest-kubernetes-security-trivy' + <<: *functest-kubernetes-ng-params + container: 'functest-kubernetes-security' + jobs: + - 'functest-kubernetes-ng-{repo}-{container}-{tag}-trivy' + +- project: + name: 'functest-kubernetes-ng-opnfv-functest-kubernetes-smoke-trivy' + <<: *functest-kubernetes-ng-params + container: 'functest-kubernetes-smoke' + jobs: + - 'functest-kubernetes-ng-{repo}-{container}-{tag}-trivy' + +- project: + name: 'functest-kubernetes-ng-opnfv-functest-kubernetes-benchmarking-trivy' + <<: *functest-kubernetes-ng-params + container: 'functest-kubernetes-benchmarking' + jobs: + - 'functest-kubernetes-ng-{repo}-{container}-{tag}-trivy' + +- project: + name: 'functest-kubernetes-ng' + <<: *functest-kubernetes-ng-params + jobs: + - 'functest-kubernetes-ng-{tag}-docker' + +- view: + name: functest-kubernetes-ng-docker + view-type: list + columns: + - status + - weather + - job + - last-success + - last-failure + - last-duration + regex: ^functest-kubernetes-ng-[a-z0-9.]+-docker$ + +- view: + name: functest-kubernetes-ng-trivy + view-type: list + columns: + - status + - weather + - job + - last-success + - last-failure + - last-duration + regex: ^functest-kubernetes-ng-[a-z0-9-.]+-trivy$ |