sts-sponsors team mailing list archive
-
sts-sponsors team
-
Mailing list archive
-
Message #07586
[Merge] ~ack/maas-ci/+git/maas-ci-internal:update-kpis-job into ~maas-committers/maas-ci/+git/maas-ci-internal:main
Alberto Donato has proposed merging ~ack/maas-ci/+git/maas-ci-internal:update-kpis-job into ~maas-committers/maas-ci/+git/maas-ci-internal:main.
Commit message:
add update-kpis job (migrated from multibranch pipeline)
Requested reviews:
MAAS Lander (maas-lander): unittests
MAAS Committers (maas-committers)
For more details, see:
https://code.launchpad.net/~ack/maas-ci/+git/maas-ci-internal/+merge/441876
--
Your team MAAS Committers is requested to review the proposed merge of ~ack/maas-ci/+git/maas-ci-internal:update-kpis-job into ~maas-committers/maas-ci/+git/maas-ci-internal:main.
diff --git a/jobs/update-kpis.groovy b/jobs/update-kpis.groovy
new file mode 100644
index 0000000..1142cd3
--- /dev/null
+++ b/jobs/update-kpis.groovy
@@ -0,0 +1,70 @@
+pipeline {
+ agent {
+ docker {
+ image 'ubuntu:{{ series }}'
+ registryUrl '{{ docker_registry }}'
+ registryCredentialsId '{{ docker_registry_cred }}'
+ label 'maas-tester'
+ args '-u 0:0'
+ reuseNode true
+ }
+ }
+
+ stages {
+ stage('Checkout') {
+ steps {
+ git credentialsId: 'launchpad-ci-ssh-key', url: 'git+ssh://git.launchpad.net/maas-kpi'
+ }
+ }
+ stage('System setup') {
+ steps {
+ script {
+ sh '''
+ if [ ! -z $http_proxy ]; then
+ echo "Acquire::http::proxy \\"$http_proxy\\"\\;" > /etc/apt/apt.conf.d/launchpad-ci-proxy
+ echo "Acquire::https::proxy \\"$http_proxy\\"\\;" >> /etc/apt/apt.conf.d/launchpad-ci-proxy
+ fi
+ export DEBIAN_FRONTEND=noninteractive
+ apt update
+ apt -y install make sudo
+ make deps
+ '''
+ }
+ }
+ }
+ stage('Python setup') {
+ steps {
+ script {
+ sh "make clean apps"
+ }
+ }
+ }
+ stage('Gather') {
+ steps {
+ withCredentials([
+ file(credentialsId: 'lp-lander-credentials', variable: 'LP_CREDENTIALS'),
+ file(credentialsId: 'maas-ro-prodstack-5', variable: 'SWIFT_KEY'),
+ ]) {
+ script {
+ sh "https_proxy= make metrics"
+ }
+ }
+ }
+ }
+ stage('Push') {
+ steps {
+ withCredentials([file(credentialsId: 'maas-influxdb', variable: 'INFLUXDB_CREDENTIALS')]) {
+ script {
+ sh "make push"
+ }
+ }
+ }
+ }
+ }
+
+ post {
+ always {
+ archiveArtifacts artifacts: 'generated/*.metrics'
+ }
+ }
+}
diff --git a/jobs/update-kpis.yaml b/jobs/update-kpis.yaml
new file mode 100644
index 0000000..4ac06fa
--- /dev/null
+++ b/jobs/update-kpis.yaml
@@ -0,0 +1,22 @@
+- project:
+ name: update-kpis
+ jobs:
+ - update-kpis
+
+- job-template:
+ name: update-kpis
+ parameters:
+ - string:
+ name: INFLUXDB_HOST
+ description: Hostname of the InfluxDB
+ default: maas-influxdb.cloud.kpi.internal
+ - string:
+ name: INFLUXDB_DBNAME
+ description: The name of the database to use
+ default: maas
+ triggers:
+ - timed: '@hourly'
+ properties:
+ - build-discarder:
+ artifact-num-to-keep: 100
+ dsl: !include-jinja2: update-kpis.groovy