{"action":"closed","issue":{"url":"https://api.github.com/repos/pmmp/PocketMine-MP/issues/71","repository_url":"https://api.github.com/repos/pmmp/PocketMine-MP","labels_url":"https://api.github.com/repos/pmmp/PocketMine-MP/issues/71/labels{/name}","comments_url":"https://api.github.com/repos/pmmp/PocketMine-MP/issues/71/comments","events_url":"https://api.github.com/repos/pmmp/PocketMine-MP/issues/71/events","html_url":"https://github.com/pmmp/PocketMine-MP/issues/71","id":186612450,"number":71,"title":"Not an issue: How to automate updates to a repo server","user":{"login":"rivermigue","id":15686443,"avatar_url":"https://avatars.githubusercontent.com/u/15686443?v=3","gravatar_id":"","url":"https://api.github.com/users/rivermigue","html_url":"https://github.com/rivermigue","followers_url":"https://api.github.com/users/rivermigue/followers","following_url":"https://api.github.com/users/rivermigue/following{/other_user}","gists_url":"https://api.github.com/users/rivermigue/gists{/gist_id}","starred_url":"https://api.github.com/users/rivermigue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rivermigue/subscriptions","organizations_url":"https://api.github.com/users/rivermigue/orgs","repos_url":"https://api.github.com/users/rivermigue/repos","events_url":"https://api.github.com/users/rivermigue/events{/privacy}","received_events_url":"https://api.github.com/users/rivermigue/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-01T18:38:54Z","updated_at":"2016-11-01T18:39:48Z","closed_at":"2016-11-01T18:39:48Z","body":"Hello,\r\n\r\nSo, I have this script which was properly working with another build of Pocketmine, however this time I'm not sure how to get it to work in order to download the latest successful build from the jenkins server since the file that is being downloaded has a different series of combinations between letters and numbers.\r\n\r\nHere is the script:\r\n\r\n```\r\n#!/bin/bash\r\nfunction jsonValue() {\r\n  KEY=$1\r\n  num=$2\r\n  awk -F\"[,:}]\" '{for(i=1;i<=NF;i++){if($i~/'$KEY'\\042/){print $(i+1)}}}' | tr -d '\"' | sed -n ${num}p\r\n}\r\nRLS=`curl -sX GET https://jenkins.pmmp.gq/job/PocketMine-MP/api/json | jsonValue number 1`\r\ncd /var/www/html/jar\r\nwget https://jenkins.pmmp.gq/job/PocketMine-MP/lastSuccessfulBuild/artifact/PocketMine-MP_1.6.1dev-$RLS_f50c63a0_API-2.1.0..phar -O pocketmine.phar\r\nchown -R nobody:nobody pocketmine.phar\r\n```\r\n\r\nSo, after the build number on the file's name, on each new build there are extra letters/numbers that are not included in the json file, how can I tweak this in order to automate my repo server to dowload each successful build and rename it to just pocketmine.phar so that I can download it on my other nodes whenever someone deploys a new instance of pocketmine?\r\n\r\nThis script will only grab the build number."}}
{"actor":{"display_login":"dktapps"}}