diff --git a/src/ci/mcp/Tools.groovy b/src/ci/mcp/Tools.groovy
index 93f3dd1..19941b4 100644
--- a/src/ci/mcp/Tools.groovy
+++ b/src/ci/mcp/Tools.groovy
@@ -61,3 +61,183 @@
     ).trim()
     return git_commit
 }
+
+/**
+* Get URL to artifact by properties
+* Returns String with URL to found artifact or null if nothing
+*
+* @param artifactoryURL String, an URL to Artifactory
+* @param properties LinkedHashMap, a Hash of properties (key-value) which
+*        which should determine artifact in Artifactory
+*/
+def uriByProperties(String artifactoryURL, LinkedHashMap properties) {
+    def key, value
+    def properties_str = ''
+    for ( int i = 0; i < properties.size(); i++ ) {
+        // avoid serialization errors
+        key = properties.entrySet().toArray()[i].key
+        value = properties.entrySet().toArray()[i].value
+        properties_str += "${key}=${value}&"
+    }
+    def search_url = "${artifactoryURL}/api/search/prop?${properties_str}"
+
+    def result = sh(script: "bash -c \"curl -X GET \'${search_url}\'\"",
+            returnStdout: true).trim()
+    def content = new groovy.json.JsonSlurperClassic().parseText(result)
+    def uri = content.get("results")
+    if ( uri ) {
+        return uri.last().get("uri")
+    } else {
+        return null
+    }
+}
+
+/**
+* Set properties for artifact in Artifactory repo
+*
+* @param artifactUrl String, an URL to artifact in Artifactory repo
+* @param properties LinkedHashMap, a Hash of properties (key-value) which
+*        should be assigned for choosen artifact
+* @param recursive Boolean, if artifact_url is a directory, whether to set
+*        properties recursively or not
+*/
+def setProperties (String artifactUrl, LinkedHashMap properties, Boolean recursive=false) {
+    def properties_str = 'properties='
+    def key,value
+    if (recursive) {
+        recursive = 'recursive=1'
+    } else {
+        recursive = 'recursive=0'
+    }
+    for ( int i = 0; i < properties.size(); i++ ) {
+        // avoid serialization errors
+        key = properties.entrySet().toArray()[i].key
+        value = properties.entrySet().toArray()[i].value
+        properties_str += "${key}=${value}|"
+    }
+    def url = "${artifactUrl}?${properties_str}&${recursive}"
+    withCredentials([
+            [$class: 'UsernamePasswordMultiBinding',
+             credentialsId: 'artifactory',
+             passwordVariable: 'ARTIFACTORY_PASSWORD',
+             usernameVariable: 'ARTIFACTORY_LOGIN']
+    ]) {
+        sh "bash -c \"curl -X PUT -u ${ARTIFACTORY_LOGIN}:${ARTIFACTORY_PASSWORD} \'${url}\'\""
+    }
+}
+
+/**
+* Get properties for specified artifact in Artifactory
+* Returns LinkedHashMap of properties
+*
+* @param artifactUrl String, an URL to artifact in Artifactory repo
+*/
+def getPropertiesForArtifact(String artifactUrl) {
+    def url = "${artifactUrl}?properties"
+    def result
+    withCredentials([
+            [$class: 'UsernamePasswordMultiBinding',
+             credentialsId: 'artifactory',
+             passwordVariable: 'ARTIFACTORY_PASSWORD',
+             usernameVariable: 'ARTIFACTORY_LOGIN']
+    ]) {
+        result = sh(script: "bash -c \"curl -X GET -u ${ARTIFACTORY_LOGIN}:${ARTIFACTORY_PASSWORD} \'${url}\'\"",
+                returnStdout: true).trim()
+    }
+    def properties = new groovy.json.JsonSlurperClassic().parseText(result)
+    return properties.get("properties")
+}
+
+/**
+* Upload docker image to Artifactory
+*
+* @param artifactoryURL String, an URL to Artifactory
+* @param registry String, the name of Docker registry
+* @param image String, Docker image name
+* @param version String, Docker image version
+* @param repository String, The name of Artifactory Docker repository
+*/
+def uploadImageToArtifactory (String artifactoryURL, String registry, String image,
+                              String version, String repository) {
+    // TODO Switch to Artifactoy image' pushing mechanism once we will
+    // prepare automatical way for enabling artifactory build-proxy
+    //def artDocker
+    withCredentials([
+            [$class: 'UsernamePasswordMultiBinding',
+             credentialsId: 'artifactory',
+             passwordVariable: 'ARTIFACTORY_PASSWORD',
+             usernameVariable: 'ARTIFACTORY_LOGIN']
+    ]) {
+        sh ("docker login -u ${ARTIFACTORY_LOGIN} -p ${ARTIFACTORY_PASSWORD} ${registry}")
+        //artDocker = Artifactory.docker("${env.ARTIFACTORY_LOGIN}", "${env.ARTIFACTORY_PASSWORD}")
+    }
+
+    sh ("docker push ${registry}/${image}:${version}")
+    //artDocker.push("${registry}/${image}:${version}", "${repository}")
+    def image_url = "${artifactoryURL}/api/storage/${repository}/${image}/${version}"
+
+    def properties = ['com.mirantis.build_name':"${env.JOB_NAME}",
+                      'com.mirantis.build_id': "${env.BUILD_NUMBER}",
+                      'com.mirantis.changeid': "${env.GERRIT_CHANGE_ID}",
+                      'com.mirantis.patchset_number': "${env.GERRIT_PATCHSET_NUMBER}",
+                      'com.mirantis.target_tag': "${version}"]
+    setProperties(image_url, properties)
+}
+
+/**
+* Upload binaries to Artifactory
+*
+* @param server ArtifactoryServer, the instance of Artifactory server
+* @param buildInfo BuildInfo, the instance of a build-info object which can be published
+* @param uploadSpec String, a spec which is a JSON file that specifies which files should be
+*        uploaded or downloaded and the target path
+* @param publishInfo Boolean, whether publish a build-info object to Artifactory
+*/
+def uploadBinariesToArtifactory (server, buildInfo, String uploadSpec,
+                                 Boolean publishInfo=false) {
+    buildInfo.append(server.upload(uploadSpec))
+
+    if ( publishInfo ) {
+        buildInfo.env.capture = true
+        buildInfo.env.filter.addInclude("*")
+        buildInfo.env.filter.addExclude("*PASSWORD*")
+        buildInfo.env.filter.addExclude("*password*")
+        buildInfo.env.collect()
+        server.publishBuildInfo(buildInfo)
+    }
+}
+
+/**
+* Promote Docker image artifact to release repo
+*
+* @param artifactoryURL String, an URL to Artifactory
+* @param artifactoryDevRepo String, the source dev repository name
+* @param artifactoryProdRepo String, the target repository for the move or copy
+* @param dockerRepo String, the docker repository name to promote
+* @param artifactTag String, an image tag name to promote
+* @param targetTag String, target tag to assign the image after promotion
+* @param copy Boolean, an optional value to set whether to copy instead of move
+*        Default: false
+*/
+def promoteDockerArtifact(String artifactoryURL, String artifactoryDevRepo,
+                          String artifactoryProdRepo, String dockerRepo,
+                          String artifactTag, String targetTag, Boolean copy=false) {
+    def url = "${artifactoryURL}/api/docker/${artifactoryDevRepo}/v2/promote"
+    writeFile file: "query.json",
+              text: """{
+                  \"targetRepo\": \"${artifactoryProdRepo}\",
+                  \"dockerRepository\": \"${dockerRepo}\",
+                  \"tag\": \"${artifactTag}\",
+                  \"targetTag\" : \"${targetTag}\",
+                  \"copy\": \"${copy}\"
+              }""".stripIndent()
+    sh "cat query.json"
+    withCredentials([
+            [$class: 'UsernamePasswordMultiBinding',
+             credentialsId: 'artifactory',
+             passwordVariable: 'ARTIFACTORY_PASSWORD',
+             usernameVariable: 'ARTIFACTORY_LOGIN']
+    ]) {
+        sh "bash -c \"curl  -u ${ARTIFACTORY_LOGIN}:${ARTIFACTORY_PASSWORD} -H \"Content-Type:application/json\" -X POST -d @query.json ${url}\""
+    }
+}
diff --git a/src/ci/mcp/Tools.txt b/src/ci/mcp/Tools.txt
index 12377b1..2c4c1d5 100644
--- a/src/ci/mcp/Tools.txt
+++ b/src/ci/mcp/Tools.txt
@@ -43,3 +43,158 @@
         }"""
     server.upload(uploadSpec, buildInfo)
     server.publishBuildInfo buildInfo
+
+
+uriByProperties
+---------------
+
+1. uriByProperties() should be used to get URL for some artifact
+with specified properties, like:
+
+    "gerritChangeId=${env.GERRIT_CHANGE_ID}",
+    "gerritPatchsetNumber=${env.GERRIT_PATCHSET_NUMBER}"
+
+2. Also can be used custom user' properties.
+
+3. The resulting value will be the string in URL format, e.g:
+
+    "https://ci.mcp-ci.local/artifactory/mcp-k8s-ci/images-info/conformance_image_v1.4.1-5_1476965708283.yaml"
+
+4. How to use:
+
+    def tools = new ci.mcp.Tools()
+    ...
+    def properties = ['com.mirantis.changeid': "${env.GERRIT_CHANGE_ID}",
+                      'com.mirantis.patchset_number': "${env.GERRIT_PATCHSET_NUMBER}" ]
+    def artifact_uri = tools.uriByProperties(properties)
+
+5. Important notes:
+
+    - if specified properties are set for few artifacts will be taken last.
+
+
+setProperties
+-------------
+
+1. setProperties() should be used to set some properties to specified artifact in repo, like:
+
+    "gerritChangeId=${env.GERRIT_CHANGE_ID}",
+    "gerritPatchsetNumber=${env.GERRIT_PATCHSET_NUMBER}"
+
+2. How to use:
+
+    def tools = new ci.mcp.Tools()
+    ...
+    def artifact_url = "${env.ARTIFACTORY_URL}/api/storage/${repository}/${tag}/${version}"
+    // for example: https://ci.mcp-ci.local/artifactory/api/storage/mcp-k8s-local/hyperkube-amd64/v1.4.1-5
+    def properties = ['com.mirantis.build_name':"${env.JOB_NAME}",
+                      'com.mirantis.build_id': "${env.BUILD_NUMBER}",
+                      'com.mirantis.changeid': "${env.GERRIT_CHANGE_ID}",
+                      'com.mirantis.patchset_number': "${env.GERRIT_PATCHSET_NUMBER}"]
+
+    tools.setProperties(artifact_url, properties)
+
+3. As result provided artifact in repo will be tagged by specified properties.
+
+
+getPropertiesForArtifact
+------------------------
+
+1. getPropertiesForArtifact() should be used to get properties for specified artifact in repo, like:
+
+    "https://ci.mcp-ci.local:443/artifactory/api/storage/mcp-k8s-ci/hyperkube-amd64/v1.4.1-5"
+
+2. As a result will be returned LinkedHashMap of properties for specified artifact URL.
+
+3. How to use:
+
+    def tools = new ci.mcp.Tools()
+    ...
+    //
+    def artifact_url = "${env.ARTIFACTORY_URL}/api/storage/${repository}/${tag}"
+    def properties = tools.getPropertiesForArtifact(artifact_url)
+
+4. Important notes:
+
+    - will be returned LinkedHashMap of properties key-value pairs. Each value is an Array by default,
+      because each key can have few values.
+    - each key is available by get() method.
+
+
+uploadImageToArtifactory
+------------------------
+
+1. uploadImageToArtifactory() should be used to upload Docker image to Artifactory.
+
+2. How to use:
+
+    def tools = new ci.mcp.Tools()
+    ...
+    // Docker registry for binaries and images
+    def docker_registry = 'ci.mcp-ci.local:5001'
+    def docker_image_name = 'hyperkube-amd64'
+    def docker_image_version = 'some_version'
+    def docker_repo = 'mcp-ci-local'
+    ...
+    <docker build steps>
+    ...
+    tools.uploadImageToArtifactory(docker_registry, docker_image_name, docker_image_version, docker_repo)
+
+3. As a result specified image will be pushed to artifactory docker repo.
+
+
+uploadBinariesToArtifactory
+---------------------------
+
+1. uploadBinariesToArtifactory() should be used to upload binaries to Artifactory, like:
+
+    - some executive binaries, which were built during job execution;
+    - *.yml files, etc.
+
+2. How to use:
+
+    def tools = new ci.mcp.Tools()
+    ...
+    def server = Artifactory.server('mcp-ci')
+    def buildInfo = Artifactory.BuildInfo()
+    ...
+    def uploadSpec = """{
+        "files": [
+            {
+                "pattern": "hyperkube*.yaml",
+                "target": "${artifactory_dev_repo}/images-info/"
+            },
+            {
+                "pattern": "artifacts/hyperkube**",
+                "target": "${artifactory_dev_repo}/hyperkube-binaries/"
+            }
+        ]
+    }"""
+    tools.uploadBinariesToArtifactory(server, buildInfo, uploadSpec)
+
+
+promoteDockerArtifact
+---------------------
+
+1. promoteDockerArtifact() should be used to promote docker image to production repo,
+because native promotion mechanism is not allow to do it due to Artifactory bug.
+
+2. How to use:
+
+    def tools = new ci.mcp.Tools()
+    ...
+    def artifactory_dev_repo = 'docker-local'
+    def artifactory_prod_repo = 'docker-prod'
+    def docker_repo = 'hyperkube-amd64'
+    ...
+    // functions above shall be used
+    <getting all tag's and artifact's information>
+    ...
+    def artifactImageTag = 'v1.4.0-XXXX'
+    def targetArtifactImageTag = 'v1.4.0'
+    ...
+    tools.promoteDockerArtifact(artifactory_dev_repo,
+                                artifactory_prod_repo,
+                                docker_repo,
+                                artifactImageTag,
+                                targetArtifactImageTag)
\ No newline at end of file
