Refactor jenkins jobs structure
Change-Id: Ia54cc5a76e3de06f16fd602b78891826d73a4c01
diff --git a/jenkins/client/job/deploy/update/config.yml b/jenkins/client/job/deploy/update/config.yml
new file mode 100644
index 0000000..9beabfb
--- /dev/null
+++ b/jenkins/client/job/deploy/update/config.yml
@@ -0,0 +1,45 @@
+#
+# Jobs to run given states on given Salt master environment's
+#
+parameters:
+ _param:
+ jenkins_salt_api_url: "http://${_param:salt_master_host}:6969"
+ jenkins:
+ client:
+ job:
+ deploy-update-service-config:
+ type: workflow-scm
+ concurrent: true
+ display_name: "Deploy - update service(s) config"
+ scm:
+ type: git
+ url: "${_param:jenkins_gerrit_url}/mk/mk-pipelines"
+ credentials: "gerrit"
+ script: change-config.groovy
+ param:
+ SALT_MASTER_URL:
+ type: string
+ default: "${_param:jenkins_salt_api_url}"
+ description: Full Salt API address [https://10.10.10.1:8000].
+ SALT_MASTER_CREDENTIALS:
+ type: string
+ default: "salt"
+ description: Credentials to the Salt API.
+ TARGET_SERVERS:
+ type: string
+ default: "*"
+ description: Salt compound target to match nodes to be updated [*, G@osfamily:debian].
+ TARGET_STATES:
+ type: string
+ description: Config changes to be applied, empty string means running highstate [linux, linux,openssh, salt.minion.grains].
+ TARGET_SUBSET_TEST:
+ type: string
+ description: Number of nodes to test config changes, empty string means all targetted nodes.
+ TARGET_SUBSET_LIVE:
+ type: string
+ default: '1'
+ description: Number of selected noded to live apply selected config changes.
+ TARGET_BATCH_LIVE:
+ type: string
+ description: Batch size for the complete live config changes on all nodes, empty string means apply to all targetted nodes.
+
diff --git a/jenkins/client/job/deploy/update/init.yml b/jenkins/client/job/deploy/update/init.yml
new file mode 100644
index 0000000..af87dcf
--- /dev/null
+++ b/jenkins/client/job/deploy/update/init.yml
@@ -0,0 +1,4 @@
+classes:
+ - system.jenkins.client.job.deploy.update.package
+ - system.jenkins.client.job.deploy.update.config
+ - system.jenkins.client.job.deploy.update.saltenv
diff --git a/jenkins/client/job/deploy/update/package.yml b/jenkins/client/job/deploy/update/package.yml
new file mode 100644
index 0000000..273796c
--- /dev/null
+++ b/jenkins/client/job/deploy/update/package.yml
@@ -0,0 +1,42 @@
+#
+# Jobs to update packages on given Salt master environment
+#
+parameters:
+ _param:
+ jenkins_salt_api_url: "http://${_param:salt_master_host}:6969"
+ jenkins:
+ client:
+ job:
+ deploy-update-package:
+ type: workflow-scm
+ concurrent: true
+ display_name: "Deploy - update system package(s)"
+ scm:
+ type: git
+ url: "${_param:jenkins_gerrit_url}/mk/mk-pipelines"
+ credentials: "gerrit"
+ script: update-package.groovy
+ param:
+ SALT_MASTER_URL:
+ type: string
+ default: "${_param:jenkins_salt_api_url}"
+ SALT_MASTER_CREDENTIALS:
+ type: string
+ default: "salt"
+ TARGET_SERVERS:
+ type: string
+ default: "*"
+ description: Salt compound target to match nodes to be updated [*, G@osfamily:debian].
+ TARGET_PACKAGES:
+ type: string
+ description: Space delimited list of packages to be updates [package1=version package2=version], empty string means all updating all packages to the latest version.
+ TARGET_SUBSET_TEST:
+ type: string
+ description: Number of nodes to list package updates, empty string means all targetted nodes.
+ TARGET_SUBSET_LIVE:
+ type: string
+ default: '1'
+ description: Number of selected noded to live apply selected package update.
+ TARGET_BATCH_LIVE:
+ type: string
+ description: Batch size for the complete live package update on all nodes, empty string means apply to all targetted nodes.
diff --git a/jenkins/client/job/deploy/update/saltenv.yml b/jenkins/client/job/deploy/update/saltenv.yml
new file mode 100644
index 0000000..5b55f82
--- /dev/null
+++ b/jenkins/client/job/deploy/update/saltenv.yml
@@ -0,0 +1,32 @@
+#
+# Following job is about to simply execute Jenkinsfile of given Reclass model
+#
+parameters:
+ _param:
+ jenkins_salt_api_url: "http://${_param:salt_master_host}:6969"
+ jenkins_salt_model_name: "salt"
+ jenkins:
+ client:
+ job_template:
+ update_salt_env:
+ name: deploy-update-{{name}}
+ jobs:
+ - name: ${_param:jenkins_salt_env_name}
+ salt_url: "${_param:jenkins_salt_api_url}"
+ salt_credentials: salt
+ template:
+ display_name: "Deploy - update {{name}} environment"
+ type: workflow-scm
+ concurrent: false
+ scm:
+ type: git
+ url: "${_param:jenkins_gerrit_url}/salt-models/{{name}}"
+ credentials: "gerrit"
+ script: Jenkinsfile
+ param:
+ SALT_MASTER_URL:
+ type: string
+ default: "{{salt_url}}"
+ SALT_MASTER_CREDENTIALS:
+ type: string
+ default: "{{salt_credentials}}"