'latest', 'region' => 'sa-east-1', 'endpoint' => 'https://s3.infra.flowdat.com/minio/login', 'use_path_style_endpoint' => true, 'credentials' => [ 'key' => 'iksop', 'secret' => '8htoiwn44g204th', ], ]); //subo al HipChat $ROOM_ID="drone-ci"; $AUTH_TOKEN="umxTgNpdzUS4egXqpZvGmmYrpLWApANHBKUcciMk"; $MESSAGE1="Inicio Commit ID: " . $head; $MESSAGE2="Fin Commit ID: " . $head; shell_exec('curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer qGKQBdZpcRFxPCwoHYZI" -d \'{"body":{"version":1,"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"'.$MESSAGE1.'"}]}]}}\' --url "https://api.atlassian.com/site/9a250d57-9fd5-44d1-b514-e8664f32952e/conversation/7a10296d-521a-4b7b-a927-8bd8275bdf86/message"'); # shell_exec('curl -H "Content-Type: application/json" -X POST -d "{\"color\": \"purple\", \"message_format\": \"text\", \"message\": \"' . $MESSAGE1 . '\" }" https://api.hipchat.com/v2/room/' . $ROOM_ID . '/notification?auth_token=' . $AUTH_TOKEN); $directorioA = array('01_login/','02_base/','03_ftth/','04_map/'); for ($i = 0; $i < 4; $i++) { $dir = $directorioA[$i]; $directorio = opendir("./tests/comp/". $fecha . "_" . $hora . "_" . $head . "/" . $dir); while ($archivo = readdir($directorio)) { if (is_dir($archivo)) { } else { $result = $s3->putObject(array( 'Bucket' => 'comparaciones', 'Key' => $fecha . "_" . $hora . "_" . $head . '/' . $dir . $archivo, 'SourceFile' => './tests/comp/' . $fecha . "_" . $hora . "_" . $head . "/" . $dir . $archivo )); // We can poll the object until it is accessible $s3->waitUntil('ObjectExists', array( 'Bucket' => 'comparaciones', 'Key' => $fecha . "_" . $hora . "_" . $head . '/' . $dir . $archivo )); $token = 'qGKQBdZpcRFxPCwoHYZI'; $cloudId = '9a250d57-9fd5-44d1-b514-e8664f32952e'; $conversationId = '7a10296d-521a-4b7b-a927-8bd8275bdf86'; $filename = 'tests/comp/' . $fecha . '_' . $hora . '_' . $head . '/' . $dir . $archivo; $path = '/home/iksop/Escritorio/te/installer/behat/testScreenshot/'.$filename; $command = "curl --request POST --header 'Authorization: Bearer {$token}' --header 'Accept: application/json' --header 'Content-Type: application/octet-stream' --url 'https://api.atlassian.com/site/{$cloudId}/conversation/{$conversationId}/media?name={$filename}' --data-binary '@{$path}'"; var_dump($command); $upload = shell_exec($command); var_dump($upload); $upload = json_decode($upload, true); $message = shell_exec("curl -X POST -H 'Content-Type: application/json' -H 'Authorization: Bearer {$token}' -d '{\"body\":{\"version\":1,\"type\":\"doc\",\"content\":[{\"type\":\"mediaGroup\",\"content\":[{\"type\":\"media\",\"attrs\":{\"type\":\"file\",\"id\":\"{$upload['data']['id']}\",\"collection\":\"{$conversationId}\"}}]}]}}' --url 'https://api.atlassian.com/site/{$cloudId}/conversation/{$conversationId}/message'"); var_dump($message); } } echo "Directorio de comparación '" . $dir . "' actualizado. Fecha: " . $fecha . "_" . $hora . " Commit: " . $head . "\n" ; } shell_exec('curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer qGKQBdZpcRFxPCwoHYZI" -d \'{"body":{"version":1,"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"'.$MESSAGE2.'"}]}]}}\' --url "https://api.atlassian.com/site/9a250d57-9fd5-44d1-b514-e8664f32952e/conversation/7a10296d-521a-4b7b-a927-8bd8275bdf86/message"'); } }