Fix global variables
Remove terraform-validate job
Disable using jeepyb cache
Fix namespace
Disable using JJB cache

Related-PROD: RE-336

Change-Id: I2a5d6791dc1b0d182b9d08a6b6f061aefb793678
diff --git a/common/pipelines/update-jenkins-jobs.groovy b/common/pipelines/update-jenkins-jobs.groovy
index 4bb3702..26c6ee5 100644
--- a/common/pipelines/update-jenkins-jobs.groovy
+++ b/common/pipelines/update-jenkins-jobs.groovy
@@ -47,7 +47,7 @@
         }
     }
 
-    stage('Get JJB cache') {
+    /*stage('Get JJB cache') {
         dir(cacheHome) {
             response = httpRequest \
                 url: artCacheUrl,
@@ -61,7 +61,7 @@
                    dir: '.cache'
             }
         }
-    }
+    }*/
 
     stage('Update JJB jobs') {
         if (env.MAINTAIN_MODE.toLowerCase() == 'false') {
@@ -149,7 +149,7 @@
         }
     }
 
-    stage('Save JJB cache') {
+    /*stage('Save JJB cache') {
         dir(cacheHome) {
             sh "rm -f ${artCacheFile}"
             zip \
@@ -163,7 +163,7 @@
                 multipartName: 'file',
                 uploadFile: artCacheFile
         }
-    }
+    }*/
 }
 
 String podTpl = """
diff --git a/common/test-jenkins-jobs.yaml b/common/test-jenkins-jobs.yaml
index 80f71e8..ca12f53 100644
--- a/common/test-jenkins-jobs.yaml
+++ b/common/test-jenkins-jobs.yaml
@@ -26,7 +26,7 @@
         server-name: '{gerrit-server}'
         projects:
         - project-compare-type: PLAIN
-          project-pattern: mcp-ci/jenkins-jobs
+          project-pattern: infra/jenkins-jobs
           branches:
           - branch-pattern: 'master'
           file-paths:
diff --git a/common/update-jenkins-config.yaml b/common/update-jenkins-config.yaml
index 9be1f85..cf16a53 100644
--- a/common/update-jenkins-config.yaml
+++ b/common/update-jenkins-config.yaml
@@ -27,7 +27,7 @@
         #    comment-contains-value: '(?i)^(Patch Set [0-9]+:)?( [\w\\+-]*)*(\n\n)?\s*(rebuild|recheck|retest|reverify)'
         projects:
         - project-compare-type: 'PLAIN'
-          project-pattern: 'mcp-ci/jenkins-config'
+          project-pattern: 'infra/jenkins-config'
           branches:
           - branch-compare-type: 'PLAIN'
             branch-pattern: '{jcasc_branch}'
diff --git a/common/update-jenkins-jobs.yaml b/common/update-jenkins-jobs.yaml
index fdb6a03..50529b2 100644
--- a/common/update-jenkins-jobs.yaml
+++ b/common/update-jenkins-jobs.yaml
@@ -12,7 +12,7 @@
       <p>Requires python-tox package and user credentials stored as JJB_USER and JJB_PASSWORD</p>
     concurrent: false
 
-    jjb_project: 'mcp-ci/jenkins-jobs'
+    jjb_project: 'infra/jenkins-jobs'
 
     properties:
     - build-discarder:
diff --git a/servers/sandbox-ci/global.yaml b/servers/sandbox-ci/global.yaml
index 34b29d3..b4b3145 100644
--- a/servers/sandbox-ci/global.yaml
+++ b/servers/sandbox-ci/global.yaml
@@ -13,22 +13,24 @@
     job_description: Do not edit this job through the web UI!
 
     ci_name: 'sandbox-ci'
-    jcasc_branch: '{ci_name}'
+    jcasc_branch: 'master'
     k8s_cluster: unset
     jjb_update_label: unset
     jjb_credentials_id: jjb-update
 
-    gerrit-server: 'mcp-gerrit'
-    gerrit-host: 'gerrit.mcp.mirantis.net'
+    gerrit-server: 'sandbox-gerrit'
+    gerrit-host: 'sandbox-gerrit'
     gerrit-port: '29418'
-    gerrit-url:  'https://gerrit.mcp.mirantis.net'
+    gerrit-url:  'https://sandbox-gerrit'
     gerrit-git-url: 'ssh://{gerrit-host}:{gerrit-port}'
     gerrit-custom-url: '* $JOB_NAME $BUILD_URL/consoleText'
+    gerrit-projects-project: 'infra/gerrit-projects'
 
     artifactory-url:    'https://artifactory.mcp.mirantis.net'
     artifactory_credentials_id: artifactory
 
-    git-credentials-id: '{ci_name}'
+    git-credentials-id: 'sandbox-jenkins'
     docker-prod-virtual: 'docker-prod-virtual.docker.mirantis.net'
     docker-dev-local: 'docker-dev-local.docker.mirantis.net'
     docker-dev-virtual:  'docker-dev-virtual.docker.mirantis.net'
+    docker-infra-agent: 'docker-prod-local.docker.mirantis.net/infra/infra-agent:latest'
diff --git a/servers/sandbox-ci/infra/codenarc.yaml b/servers/sandbox-ci/infra/codenarc.yaml
index cd1b985..739615c 100644
--- a/servers/sandbox-ci/infra/codenarc.yaml
+++ b/servers/sandbox-ci/infra/codenarc.yaml
@@ -5,7 +5,7 @@
     jobs:
     - common/codenarc:
         projects:
-        - project-pattern: mcp-ci/jenkins-jobs
+        - project-pattern: infra/jenkins-jobs
           branches:
           - branch-pattern: 'master'
           file-paths:
diff --git a/servers/sandbox-ci/infra/gerrit-projects.yaml b/servers/sandbox-ci/infra/gerrit-projects.yaml
index d7560a9..ca0d49a 100644
--- a/servers/sandbox-ci/infra/gerrit-projects.yaml
+++ b/servers/sandbox-ci/infra/gerrit-projects.yaml
@@ -30,9 +30,9 @@
           GIT_CREDENTIALS_ID={git-credentials-id}
           REFSPEC={refspec}
           JEEPYB_GERRIT_HOST={gerrit-host}
-          JEEPYB_USER=mcp-gerrit
-          JEEPYB_COMMITTER=Gerrit MCP <mcp-gerrit@mirantis.com>
-          JEEPYB_CREDENTIALS_ID=gerrit
+          JEEPYB_USER=sandbox
+          JEEPYB_COMMITTER=sandbox <sandbox@mirantis.net>
+          JEEPYB_CREDENTIALS_ID={git-credentials-id}
           ARTIFACTORY_URL={artifactory-url}
           ART_CREDENTIALS_ID={artifactory_credentials_id}
 
diff --git a/servers/sandbox-ci/infra/pipelines/gerrit-projects.groovy b/servers/sandbox-ci/infra/pipelines/gerrit-projects.groovy
index 3835ceb..8ab38d6 100644
--- a/servers/sandbox-ci/infra/pipelines/gerrit-projects.groovy
+++ b/servers/sandbox-ci/infra/pipelines/gerrit-projects.groovy
@@ -28,7 +28,7 @@
         }
     }
 
-    stage('Get jeepyb cache') {
+    /*stage('Get jeepyb cache') {
         dir(cacheHome) {
             response = httpRequest \
                 url: artCacheUrl,
@@ -41,7 +41,7 @@
                    zipFile: artCacheFile
             }
         }
-    }
+    }*/
 
     stage("Jeepyb-${TOX_ENV}") {
         if (env.MAINTAIN_MODE.toLowerCase() == 'false') {
@@ -58,7 +58,7 @@
                 message: 'Sleeping for maintainance'
         }
     }
-    stage('Save jeepyb cache') {
+    /*stage('Save jeepyb cache') {
         dir(cacheHome) {
             sh "rm -f ${artCacheFile}"
             zip \
@@ -71,7 +71,7 @@
                 multipartName: 'file',
                 uploadFile: artCacheFile
         }
-    }
+    }*/
 }
 
 String podTpl = """
diff --git a/servers/sandbox-ci/infra/pipelines/terraform-validate.groovy b/servers/sandbox-ci/infra/pipelines/terraform-validate.groovy
deleted file mode 100644
index 13e0a6f..0000000
--- a/servers/sandbox-ci/infra/pipelines/terraform-validate.groovy
+++ /dev/null
@@ -1,92 +0,0 @@
-#!groovy
-
-def main() {
-    // Get & prepare source code
-    stage('SCM checkout') {
-        String gitUrl = "${env.GERRIT_SCHEME}://${env.GERRIT_HOST}:${env.GERRIT_PORT}/${env.GERRIT_PROJECT}"
-        String gitRef = env.GERRIT_REFSPEC
-
-        checkout \
-            $class: 'GitSCM',
-            branches: [[
-                name: 'FETCH_HEAD'
-            ]],
-            userRemoteConfigs: [[
-                url: gitUrl,
-                refspec: gitRef,
-                credentialsId: env.GIT_CREDENTIALS_ID
-            ]],
-            extensions: [[
-                $class: 'WipeWorkspace'
-            ]]
-    }
-
-    stage('Terraform-lint') {
-        String changedFolders = sh \
-            script: '''
-                git show \
-                    --name-only \
-                    --diff-filter=AM \
-                    | grep '.tf\$' \
-                    | awk -F'/' '{print $1"/"$2}' \
-                    | uniq
-            ''',
-            returnStdout: true
-
-        Integer result = 0
-        changedFolders.tokenize('\n').each {
-            dir(it) {
-                withCredentials([
-                    usernamePassword(
-                        credentialsId: env.AWS_CREDENTIALS_ID,
-                        usernameVariable: 'AWS_ACCESS_KEY_ID',
-                        passwordVariable: 'AWS_SECRET_ACCESS_KEY'
-                    )
-                ]) {
-                    result += sh \
-                        script: 'terraform init',
-                        returnStatus: true
-                    result += sh \
-                        script: 'terraform validate',
-                        returnStatus: true
-                    result += sh \
-                        script: 'terraform fmt -diff -recursive -check',
-                        returnStatus: true
-                }
-            }
-        }
-        if (result > 0) {
-            currentBuild.result = 'FAILURE'
-        }
-    }
-}
-
-String podTpl = """
-    apiVersion: "v1"
-    kind: "Pod"
-    spec:
-      securityContext:
-          runAsUser: 1000
-      containers:
-      - name: "terraform-test"
-        image: "${env.DOCKER_IMAGE}"
-        command:
-        - "cat"
-        securityContext:
-          privileged: false
-        tty: true
-"""
-
-podTemplate(
-        cloud: env.K8S_CLUSTER,
-        yaml: podTpl,
-        showRawYaml: false
-    ) {
-        node(POD_LABEL) {
-        container('terraform-test') {
-            ansiColor {
-                main()
-            }
-        }
-    }
-}
diff --git a/servers/sandbox-ci/infra/shellcheck.yaml b/servers/sandbox-ci/infra/shellcheck.yaml
index 336ff85..34541b6 100644
--- a/servers/sandbox-ci/infra/shellcheck.yaml
+++ b/servers/sandbox-ci/infra/shellcheck.yaml
@@ -4,7 +4,7 @@
     jobs:
     - common/shellcheck:
         projects:
-        - project-pattern: mcp-ci/jenkins-jobs
+        - project-pattern: infra/jenkins-jobs
           branches:
           - branch-pattern: 'master'
           file-paths:
diff --git a/servers/sandbox-ci/infra/terraform-validate.yaml b/servers/sandbox-ci/infra/terraform-validate.yaml
deleted file mode 100644
index d79b45e..0000000
--- a/servers/sandbox-ci/infra/terraform-validate.yaml
+++ /dev/null
@@ -1,42 +0,0 @@
----
-- project:
-    name: terraform-validate
-    jobs:
-    - infra/terraform-validate
-
-- job-template:
-    name: infra.terraform-validate
-    id: infra/terraform-validate
-    project-type: pipeline
-    description: Check terraform files by terraform validate and terraform fmt
-    concurrent: true
-
-    properties:
-    - build-discarder:
-        days-to-keep: 14
-    - inject:
-        properties-content: |
-          DOCKER_IMAGE={docker-dev-virtual}/mirantis/openstack-ci/jenkins-job-tests:latest
-          GIT_CREDENTIALS_ID={git-credentials-id}
-          AWS_CREDENTIALS_ID={aws-credentials-id}
-
-    triggers:
-    - gerrit:
-        server-name: '{gerrit-server}'
-        projects:
-        - project-compare-type: PLAIN
-          project-pattern: mcp-ci/infra
-          branches:
-          - branch-pattern: 'master'
-          file-paths:
-          - compare-type: ANT
-            pattern: 'terraform/**'
-        trigger-on:
-        - patchset-created-event:
-            exclude-drafts: True
-        custom-url: '- ${{JOB_NAME}} ${{BUILD_URL}}console'
-        skip-vote:
-          failed: false
-          notbuilt: false
-
-    dsl: !include-raw-escape: pipelines/terraform-validate.groovy
diff --git a/servers/sandbox-ci/infra/tox.yaml b/servers/sandbox-ci/infra/tox.yaml
index 78e3270..39a0e75 100644
--- a/servers/sandbox-ci/infra/tox.yaml
+++ b/servers/sandbox-ci/infra/tox.yaml
@@ -6,7 +6,7 @@
     - common/tox:
         projects:
         - project-compare-type: PLAIN
-          project-pattern: mcp-ci/infra
+          project-pattern: infra/infra
           branches:
           - branch-compare-type: PLAIN
             branch-pattern: master
diff --git a/servers/sandbox-ci/infra/yamllint.yaml b/servers/sandbox-ci/infra/yamllint.yaml
index fdf0ac1..de6434a 100644
--- a/servers/sandbox-ci/infra/yamllint.yaml
+++ b/servers/sandbox-ci/infra/yamllint.yaml
@@ -9,7 +9,7 @@
     - common/yamllint:
         projects:
         - project-compare-type: PLAIN
-          project-pattern: mcp-ci/jenkins-config
+          project-pattern: infra/jenkins-config
           branches:
           - branch-compare-type: PLAIN
             branch-pattern: '{ci_name}'