diff --git a/src/com/mirantis/mk/Common.groovy b/src/com/mirantis/mk/Common.groovy
index 401f4f0..031bf6f 100644
--- a/src/com/mirantis/mk/Common.groovy
+++ b/src/com/mirantis/mk/Common.groovy
@@ -40,6 +40,17 @@
 }
 
 /**
+ * Get absolute path via 'realink'
+ *   -m, --canonicalize-missing
+ *     canonicalize by following every symlink in every component of the given name recursively,
+ *     without requirements on components existence
+ */
+def getAbsolutePath(String path) {
+    def absPath = sh script: "readlink -m ${path}", returnStdout: true
+    return absPath.trim()
+}
+
+/**
  * Get UID of jenkins user.
  * Must be run from context of node
  */
diff --git a/src/com/mirantis/mk/ReleaseWorkflow.groovy b/src/com/mirantis/mk/ReleaseWorkflow.groovy
index bfb1155..5858be3 100644
--- a/src/com/mirantis/mk/ReleaseWorkflow.groovy
+++ b/src/com/mirantis/mk/ReleaseWorkflow.groovy
@@ -1,4 +1,5 @@
 package com.mirantis.mk
+
 /**
  * Checkout release metadata repo with clone or without, if cloneRepo parameter is set
  *
@@ -11,13 +12,15 @@
  */
 def checkoutReleaseMetadataRepo(Map params = [:]) {
     def git = new com.mirantis.mk.Git()
+    def common = new com.mirantis.mk.Common()
 
     String gitCredentialsId = params.get('metadataCredentialsId', 'mcp-ci-gerrit')
     String gitUrl           = params.get('metadataGitRepoUrl', "ssh://${gitCredentialsId}@gerrit.mcp.mirantis.net:29418/mcp/artifact-metadata")
     String gitBranch        = params.get('metadataGitRepoBranch', 'master')
     String gitRef           = params.get('metadataGitRepoRef', '')
-    String repoDir          = params.get('repoDir', 'artifact-metadata')
+    String repoDir          = common.getAbsolutePath(params.get('repoDir', 'artifact-metadata'))
     Boolean cloneRepo       = params.get('cloneRepo', true)
+
     if (cloneRepo) {
         stage('Cleanup repo dir') {
             dir(repoDir) {
@@ -42,14 +45,14 @@
  *    - repoDir
  */
 def getReleaseMetadataValue(String key, Map params = [:]) {
+    // Libs
+    def common = new com.mirantis.mk.Common()
+
     String result
     // Get params
     String toxDockerImage   = params.get('toxDockerImage', 'docker-prod-virtual.docker.mirantis.net/mirantis/external/tox')
     String outputFormat     = params.get('outputFormat', 'json')
-    String repoDir          = params.get('repoDir', 'artifact-metadata')
-
-    // Libs
-    def common = new com.mirantis.mk.Common()
+    String repoDir          = common.getAbsolutePath(params.get('repoDir', 'artifact-metadata'))
 
     String opts = ''
     if (outputFormat && !outputFormat.isEmpty()) {
@@ -107,21 +110,21 @@
  */
 
 def updateReleaseMetadata(String key, String value, Map params, Integer dirdepth = 0) {
-    String gitCredentialsId     = params.get('metadataCredentialsId', 'mcp-ci-gerrit')
-    String metadataRepoUrl      = params.get('metadataGitRepoUrl', "ssh://${gitCredentialsId}@gerrit.mcp.mirantis.net:29418/mcp/artifact-metadata")
-    String metadataGerritBranch = params.get('metadataGitRepoBranch', 'master')
-    String toxDockerImage       = params.get('toxDockerImage', 'docker-prod-virtual.docker.mirantis.net/mirantis/external/tox')
-    String repoDir              = params.get('repoDir', 'artifact-metadata')
-    String comment              = params.get('comment', '')
-    String crTopic              = params.get('crTopic', '')
-    String changeAuthorName     = params.get('crAuthorName', 'MCP-CI')
-    String changeAuthorEmail    = params.get('crAuthorEmail', 'mcp-ci-jenkins@ci.mcp.mirantis.net')
-
     def common = new com.mirantis.mk.Common()
     def python = new com.mirantis.mk.Python()
     def gerrit = new com.mirantis.mk.Gerrit()
     def git    = new com.mirantis.mk.Git()
 
+    String gitCredentialsId     = params.get('metadataCredentialsId', 'mcp-ci-gerrit')
+    String metadataRepoUrl      = params.get('metadataGitRepoUrl', "ssh://${gitCredentialsId}@gerrit.mcp.mirantis.net:29418/mcp/artifact-metadata")
+    String metadataGerritBranch = params.get('metadataGitRepoBranch', 'master')
+    String toxDockerImage       = params.get('toxDockerImage', 'docker-prod-virtual.docker.mirantis.net/mirantis/external/tox')
+    String repoDir              = common.getAbsolutePath(params.get('repoDir', 'artifact-metadata'))
+    String comment              = params.get('comment', '')
+    String crTopic              = params.get('crTopic', '')
+    String changeAuthorName     = params.get('crAuthorName', 'MCP-CI')
+    String changeAuthorEmail    = params.get('crAuthorEmail', 'mcp-ci-jenkins@ci.mcp.mirantis.net')
+
     def cred = common.getCredentials(gitCredentialsId, 'key')
     String gerritUser = cred.username
     String gerritHost = metadataRepoUrl.tokenize('@')[-1].tokenize(':')[0]
