diff --git a/src/com/mirantis/mk/Common.groovy b/src/com/mirantis/mk/Common.groovy
index b5760da..9a350c2 100644
--- a/src/com/mirantis/mk/Common.groovy
+++ b/src/com/mirantis/mk/Common.groovy
@@ -1006,3 +1006,16 @@
 Date parseDate(String date, String format) {
     return Date.parse(format, date)
 }
+
+/**
+ * Generate Random Hash string
+ * @param n Hash length
+ * @param pool Pool to use for hash generation
+*/
+def generateRandomHashString(int n, ArrayList pool = []) {
+    if (!pool) {
+        pool = ['a'..'z','A'..'Z',0..9,'_','+','='].flatten()
+    }
+    Random rand = new Random(System.currentTimeMillis())
+    return (1..n).collect { pool[rand.nextInt(pool.size())] }.join()
+}
diff --git a/src/com/mirantis/mk/GoogleCloudStorage.groovy b/src/com/mirantis/mk/GoogleCloudStorage.groovy
new file mode 100644
index 0000000..5bf5ad7
--- /dev/null
+++ b/src/com/mirantis/mk/GoogleCloudStorage.groovy
@@ -0,0 +1,126 @@
+package com.mirantis.mk
+
+/**
+    Work with Google Cloud Storage
+**/
+
+/** Exists or not gcloud binary file
+ *
+ * @param gcloudBinDir Path to check
+*/
+def checkGcloudBinary(String gcloudBinDir) {
+    def status = sh(script: "${gcloudBinDir}/google-cloud-sdk/bin/gcloud info > /dev/null", returnStatus: true)
+    return "${status}" == "0"
+}
+
+/** Download gcloud archive with binarties
+ *
+ * @param gcloudBinDir Path to save binaries
+ * @param url Specific URL to use to download
+*/
+def downloadGcloudUtil(String gcloudBinDir, String url="") {
+    if (!url) {
+        url="https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-253.0.0-linux-x86_64.tar.gz"
+    }
+    dir(gcloudBinDir) {
+        def archiveName='google-cloud-sdk'
+        sh """
+            wget -O ${archiveName}.tar.gz ${url}
+            tar -xf ${archiveName}.tar.gz
+        """
+    }
+}
+
+/** Auth gcloud util with provided creds
+ *
+ * @param gcloudBinDir Path to save binaries
+ * @param creds Creds name to use, saved as secret file
+ * @param projectName Project name to use
+*/
+def authGcloud(String gcloudBinDir, String creds, String projectName) {
+    ws {
+        withCredentials([
+            file(credentialsId: creds,
+                variable: 'key_file')
+        ]) {
+            sh "${gcloudBinDir}/google-cloud-sdk/bin/gcloud auth activate-service-account --key-file $key_file --project ${projectName}"
+        }
+    }
+}
+
+/** Revoke gcloud auth account
+ *
+ * @param gcloudBinDir Path to save binaries
+*/
+def revokeGcloud(String gcloudBinDir) {
+    sh "${gcloudBinDir}/google-cloud-sdk/bin/gcloud auth revoke"
+}
+
+/** Copy file to Google Storage Bucket
+ *
+ * @param gcloudBinDir Path to save binaries
+ * @param src Source file
+ * @param dst Destination path in storage
+ * @param entireTree Copy entire directory tree
+*/
+def cpFile(String gcloudBinDir, String src, String dst, Boolean entireTree=false) {
+    def fileURL = ''
+    if (entireTree) {
+        sh "${gcloudBinDir}/google-cloud-sdk/bin/gsutil cp -r ${src} ${dst}"
+        return dst
+    } else {
+        def fileBaseName = sh(script:"basename ${src}", returnStdout: true).trim()
+        sh "${gcloudBinDir}/google-cloud-sdk/bin/gsutil cp ${src} ${dst}/${fileBaseName}"
+        return "${dst}/${fileBaseName}"
+    }
+}
+
+/** Set ACL on files in bucket
+ *
+ * @param gcloudBinDir Path to save binaries
+ * @param path Path to file in bucket
+ * @param acls ACLs to be set for file
+*/
+def setAcl(String gcloudBinDir, String path, ArrayList acls) {
+    for(String acl in acls) {
+        sh "${gcloudBinDir}/google-cloud-sdk/bin/gsutil acl ch -u ${acl} ${path}"
+    }
+}
+
+/** Upload files to Google Cloud Storage Bucket
+ *
+ * @param config LinkedHashMap with next parameters:
+ *   @param gcloudBinDir Path to save binaries
+ *   @param creds Creds name to use, saved as secret file
+ *   @param projectName Project name to use
+ *   @param sources List of file to upload
+ *   @param dest Destination path in Google Storage, in format: gs://<path>
+ *   @param acls ACLs for uploaded files
+ *   @param entireTree Copy entire directory to bucket
+ *
+ * Returns URLs list of uploaded files
+*/
+def uploadArtifactToGoogleStorageBucket(Map config) {
+    def gcloudDir = config.get('gcloudDir', '/tmp/gcloud')
+    def creds = config.get('creds')
+    def project = config.get('project')
+    def acls = config.get('acls', ['AllUsers:R'])
+    def sources = config.get('sources')
+    def dest = config.get('dest')
+    def entireTree = config.get('entireTree', false)
+    def fileURLs = []
+    if (!checkGcloudBinary(gcloudDir)) {
+        downloadGcloudUtil(gcloudDir)
+    }
+    try {
+        authGcloud(gcloudDir, creds, project)
+        for(String src in sources) {
+            def fileURL = cpFile(gcloudDir, src, dest, entireTree)
+            setAcl(gcloudDir, fileURL, acls)
+            fileURLs << fileURL
+        }
+    } finally {
+        revokeGcloud(gcloudDir)
+    }
+    return fileURLs
+}
\ No newline at end of file
