diff --git a/ci/ci.sh b/ci/ci.sh index 5577dec..50beb55 100755 --- a/ci/ci.sh +++ b/ci/ci.sh @@ -48,10 +48,6 @@ else fi exit_code=$?; -if [ "$EXPORT_LOGS" = true ]; then - node export-logs.js -fi - if [ $exit_code != 0 ] && [ "$REPORT_STATUS" = true ]; then node report-exit.js; fi diff --git a/ci/export-logs.js b/ci/export-logs.js deleted file mode 100644 index 324640c..0000000 --- a/ci/export-logs.js +++ /dev/null @@ -1,49 +0,0 @@ -import AWS from 'aws-sdk' -import * as fs from 'fs' -import * as path from 'path' - -AWS.config.update({ - accessKeyId: process.env.AWS_ACCESS_KEY_ID, - secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY, - region: process.env.AWS_REGION -}) -const s3 = new AWS.S3({ apiVersion: '2006-03-01' }) - -const directoryPath = '/root/.ceramic/logs' - -function main() { - fs.readdir(directoryPath, (err, files) => { - if (err) { - return console.log('Unable to scan directory: ' + err) - } - files.forEach(function(file) { - uploadToS3(path.join(directoryPath, file)) - }) - }) -} - -function uploadToS3(file) { - const fileStream = fs.createReadStream(file) - - fileStream.on('error', err => { - console.log('File Error', err) - }) - - const prefix = process.env.S3_DIRECTORY_NAME ? `${process.env.S3_DIRECTORY_NAME}/` : '' - const uploadParams = { - Bucket: 'ceramic-qa-tests', - Key: `${prefix}${path.basename(file)}`, - Body: fileStream - } - - s3.upload(uploadParams, (err, data) => { - if (err) { - console.log('Error', err) - } - if (data) { - console.log('Upload Success', data.Location) - } - }) -} - -main()