{"action":"closed","issue":{"url":"https://api.github.com/repos/Lingvokot/gitlab-ci-scripts/issues/14","repository_url":"https://api.github.com/repos/Lingvokot/gitlab-ci-scripts","labels_url":"https://api.github.com/repos/Lingvokot/gitlab-ci-scripts/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/Lingvokot/gitlab-ci-scripts/issues/14/comments","events_url":"https://api.github.com/repos/Lingvokot/gitlab-ci-scripts/issues/14/events","html_url":"https://github.com/Lingvokot/gitlab-ci-scripts/issues/14","id":141032368,"number":14,"title":"Fix wrong copying","user":{"login":"ColCh","id":599439,"avatar_url":"https://avatars.githubusercontent.com/u/599439?v=3","gravatar_id":"","url":"https://api.github.com/users/ColCh","html_url":"https://github.com/ColCh","followers_url":"https://api.github.com/users/ColCh/followers","following_url":"https://api.github.com/users/ColCh/following{/other_user}","gists_url":"https://api.github.com/users/ColCh/gists{/gist_id}","starred_url":"https://api.github.com/users/ColCh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ColCh/subscriptions","organizations_url":"https://api.github.com/users/ColCh/orgs","repos_url":"https://api.github.com/users/ColCh/repos","events_url":"https://api.github.com/users/ColCh/events{/privacy}","received_events_url":"https://api.github.com/users/ColCh/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-15T16:44:11Z","updated_at":"2016-04-05T17:57:09Z","closed_at":"2016-04-05T17:57:09Z","body":"# WTF\r\nbuilds are located inside or prev build\r\n![image](https://cloud.githubusercontent.com/assets/599439/13785836/1873fbb0-eae6-11e5-925f-8308add7d9c9.png)\r\n\r\n## To fix:\r\nReplace `ln -sf` with `unlink` and `ln -s` commands\r\nWorking version:\r\n```bash\r\n# REPLACE LATEST LINKS\r\nif [ \"$BUILD_EXPORT_REMOTE_USER\" ] && [ \"$BUILD_EXPORT_REMOTE_HOST\" ]; then\r\n  echo \"Replacing link on latest build to $BUILD_ID at $BUILD_EXPORT_REMOTE_HOST...\"\r\n  ssh $BUILD_EXPORT_REMOTE_USER@$BUILD_EXPORT_REMOTE_HOST \"unlink \\\"$STATIC_PROJECT_DIR/latess\r\nt\\\"\"\r\n  ssh $BUILD_EXPORT_REMOTE_USER@$BUILD_EXPORT_REMOTE_HOST \"ln -s \\\"$STATIC_BUILD_DIR\\\" \\\"$STAA\r\nTIC_PROJECT_DIR/latest\\\"\"\r\nelse\r\n  echo \"Replacing link on latest build to $BUILD_ID...\"\r\n  unlink \"$STATIC_PROJECT_DIR/latest\"\r\n  ln -s \"$STATIC_BUILD_DIR\" \"$STATIC_PROJECT_DIR/latest\"\r\nfi\r\n```"}}