diff --git a/validate-cloud.groovy b/validate-cloud.groovy
new file mode 100644
index 0000000..6c25071
--- /dev/null
+++ b/validate-cloud.groovy
@@ -0,0 +1,61 @@
+/**
+ *
+ * Launch validation of the cloud
+ *
+ * Expected parameters:
+ *   SALT_MASTER_URL             URL of Salt master
+ *   SALT_MASTER_CREDENTIALS     Credentials to the Salt API
+ *
+ *   TEST_IMAGE                  Docker image link
+ *   TARGET_NODE                 Salt target for tempest node
+ *   TEMPEST_TEST_SET            If not false, run tests matched to pattern only
+ *   RUN_TEMPEST_TESTS           If not false, run Tempest tests
+ *   RUN_RALLY_TESTS             If not false, run Rally tests
+ *
+ */
+
+common = new com.mirantis.mk.Common()
+salt = new com.mirantis.mk.Salt()
+validate = new com.mirantis.mcp.Validate()
+
+def saltMaster
+def artifacts_dir = 'validation_artifacts/'
+
+node() {
+    try{
+        stage('Initialization') {
+            saltMaster = salt.connection(SALT_MASTER_URL, SALT_MASTER_CREDENTIALS)
+        }
+
+        stage('Configure') {
+            validate.installDocker(saltMaster, TARGET_NODE)
+            sh "mkdir -p ${artifacts_dir}"
+            validate.runContainerConfiguration(saltMaster, TEST_IMAGE, TARGET_NODE, artifacts_dir)
+        }
+
+        stage('Run Tempest tests') {
+            if (RUN_TEMPEST_TESTS.toBoolean() == true) {
+                validate.runTempestTests(saltMaster, TARGET_NODE, artifacts_dir, TEMPEST_TEST_SET)
+            } else {
+                common.infoMsg("Skipping Tempest tests")
+            }
+        }
+
+        stage('Run Rally tests') {
+            if (RUN_RALLY_TESTS.toBoolean() == true) {
+                validate.runRallyTests(saltMaster, TARGET_NODE, artifacts_dir)
+            } else {
+                common.infoMsg("Skipping Rally tests")
+            }
+        }
+        stage('Collect results') {
+            archiveArtifacts artifacts: "${artifacts_dir}/*"
+        }
+    } catch (Throwable e) {
+        // If there was an error or exception thrown, the build failed
+        currentBuild.result = "FAILURE"
+        throw e
+    } finally {
+        validate.runCleanup(saltMaster, TARGET_NODE, artifacts_dir)
+    }
+}
