check_repos_test:
while true:
https_exec := catch --trace:
// Open network
network_interface := net.open
client := http.Client.tls network_interface
--root_certificates=CERTIFICATES
// Set headers for auth
headers/http.Headers := http.Headers
headers.set "PRIVATE-TOKEN" GL_TOKEN
// Make get request
response := client.get "gitlab.com" GL_PATH --headers=headers
// Check response
if response.status_code != 200:
print "FAILED_WITH $response.status_code"
else:
result := json.decode_stream response.body
print "RESULT: $response.status_code :: $result[0]["status"]"
if result[0]["status"] == "success":
print "BUILD_STATUS: SUCCESS"
else:
print "BUILD_STATUS: $result[0]["status"]"
// close network interface
network_interface.close
if https_exec:
print "ERROR: $https_exec"
sleep --ms=CALL_SERVER_TIMEOUT
client.close
net.open
response.body.read
jag pkg uninstall http
jag pkg install --local --name=http ../../path/to/repo