forked from cncf/landscape
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
107 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import rp from 'request-promise'; | ||
|
||
const url = `https://hooks.slack.com/services/${process.env.SLACK_CHANNEL}`; | ||
console.info(process.env.ERROR_STATUS); | ||
const errorStatus = process.env.ERROR_STATUS === '0' ? 'SUCCESS' : 'FAILURE' | ||
const payload = { | ||
text: `Update from ${new Date().toISOString()} finished with ${errorStatus}`, | ||
attachments: [{ | ||
title: 'Log File: (update.log)', | ||
text: require('fs').readFileSync(process.env.LOGFILE_PATH, 'utf-8') | ||
}] | ||
}; | ||
|
||
async function main() { | ||
const result = await rp({ | ||
method: 'POST', | ||
json: payload, | ||
url: url | ||
}); | ||
console.info(result); | ||
|
||
} | ||
main(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import rp from 'request-promise'; | ||
|
||
const url = `https://hooks.slack.com/services/${process.env.SLACK_CHANNEL}`; | ||
const payload = { | ||
text: 'Test', | ||
attachments: [{ | ||
title: 'Example log file', | ||
fields: [{ | ||
title: 'Status', | ||
value: 'Warning' | ||
}, { | ||
title: 'Crunchbase warnings: ', | ||
value: '5' | ||
}, { | ||
title: 'Github warnings: ', | ||
value: '-' | ||
}, { | ||
title: 'Badge warnings: ', | ||
value: '-' | ||
}], | ||
text: ` | ||
Fetching crunchbase entries | ||
***E**E************************************************E***********************************************************************************E*************************************************E************ | ||
********************************************************************************************************************************************************************************************************** | ||
*************************************************************************E********************************************************************************** | ||
Using cached entry, because can not fetch: accenture Can't resolve stock ticker ACNN; please manually a 0 [ 'Using cached entry, because can not fetch: accenture Can\'t resolve stock ticker ACNN; please | ||
manually a', | ||
'Using cached entry, because can not fetch: accenture Can\'t resolve stock ticker ACNN; please manually a', | ||
'Using cached entry, because can not fetch: tencent Can\'t resolve stock ticker 0700; please manually a', | ||
'Using cached entry, because can not fetch: rackspace Cannot read property \'raw\' of undefined', | ||
'Using cached entry, because can not fetch: octo-technology Can\'t resolve stock ticker ALOCT; please manually ', | ||
'Using cached entry, because can not fetch: callidus-software Cannot read property \'raw\' of undefined' ] | ||
Using cached entry, because can not fetch: accenture Can't resolve stock ticker ACNN; please manually a 1 [ 'Using cached entry, because can not fetch: accenture Can\'t resolve stock ticker ACNN; please | ||
manually a', | ||
'Using cached entry, because can not fetch: accenture Can\'t resolve stock ticker ACNN; please manually a', | ||
'Using cached entry, because can not fetch: tencent Can\'t resolve stock ticker 0700; please manually a', | ||
'Using cached entry, because can not fetch: rackspace Cannot read property \'raw\' of undefined', | ||
'Using cached entry, because can not fetch: octo-technology Can\'t resolve stock ticker ALOCT; please manually ', | ||
'Using cached entry, because can not fetch: callidus-software Cannot read property \'raw\' of undefined' ] | ||
Using cached entry, because can not fetch: tencent Can't resolve stock ticker 0700; please manually a 2 [ 'Using cached entry, because can not fetch: accenture Can\'t resolve stock ticker ACNN; please m | ||
anually a', | ||
'Using cached entry, because can not fetch: accenture Can\'t resolve stock ticker ACNN; please manually a', | ||
'Using cached entry, because can not fetch: tencent Can\'t resolve stock ticker 0700; please manually a', | ||
'Using cached entry, because can not fetch: rackspace Cannot read property \'raw\' of undefined', | ||
'Using cached entry, because can not fetch: octo-technology Can\'t resolve stock ticker ALOCT; please manually ', | ||
'Using cached entry, because can not fetch: callidus-software Cannot read property \'raw\' of undefined' ] | ||
Using cached entry, because can not fetch: rackspace Cannot read property 'raw' of undefined 3 [ 'Using cached entry, because can not fetch: accenture Can\'t resolve stock ticker ACNN; please manually a | ||
', | ||
'Using cached entry, because can not fetch: accenture Can\'t resolve stock ticker ACNN; please manually a', | ||
'Using cached entry, because can not fetch: tencent Can\'t resolve stock ticker 0700; please manually a', | ||
'Using cached entry, because can not fetch: rackspace Cannot read property \'raw\' of undefined', | ||
'Using cached entry, because can not fetch: octo-technology Can\'t resolve stock ticker ALOCT; please manually ', | ||
'Using cached entry, because can not fetch: callidus-software Cannot read property \'raw\' of undefined' ] | ||
Using cached entry, because can not fetch: octo-technology Can't resolve stock ticker ALOCT; please manually 4 [ 'Using cached entry, because can not fetch: accenture Can\'t resolve stock ticker ACNN; | ||
please manually a', | ||
'Using cached entry, because can not fetch: accenture Can\'t resolve stock ticker ACNN; please manually a', | ||
'Using cached entry, because can not fetch: tencent Can\'t resolve stock ticker 0700; please manually a', | ||
'Using cached entry, because can not fetch: rackspace Cannot read property \'raw\' of undefined', | ||
'Using cached entry, because can not fetch: octo-technology Can\'t resolve stock ticker ALOCT; please manually ', | ||
'Using cached entry, because can not fetch: callidus-software Cannot read property \'raw\' of undefined' ] | ||
Using cached entry, because can not fetch: callidus-software Cannot read property 'raw' of undefined 5 [ 'Using cached entry, because can not fetch: accenture Can\'t resolve stock ticker ACNN; please ma | ||
nually a', | ||
'Using cached entry, because can not fetch: accenture Can\'t resolve stock ticker ACNN; please manually a', | ||
'Using cached entry, because can not fetch: tencent Can\'t resolve stock ticker 0700; please manually a', | ||
'Using cached entry, because can not fetch: rackspace Cannot read property \'raw\' of undefined', | ||
'Using cached entry, because can not fetch: octo-technology Can\'t resolve stock ticker ALOCT; please manually ', | ||
'Using cached entry, because can not fetch: callidus-software Cannot read property \'raw\' of undefined' ] | ||
` | ||
}] | ||
}; | ||
|
||
async function main() { | ||
const result = await rp({ | ||
method: 'POST', | ||
json: payload, | ||
url: url | ||
}); | ||
console.info(result); | ||
|
||
} | ||
main(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters