| 9 | |
| 10 | // upload the build.log file to the logger service |
| 11 | const uploadBuildLog = async () => { |
| 12 | if (!LOGGER_API_KEY || !LOGGER_API_URL) { |
| 13 | console.error('LOGGER_API_KEY or LOGGER_API_URL is not set') |
| 14 | return ''; |
| 15 | } |
| 16 | const response = await fetch(LOGGER_API_URL, { |
| 17 | method: 'POST', |
| 18 | headers: { |
| 19 | 'Content-Type': 'application/json', |
| 20 | apikey: LOGGER_API_KEY |
| 21 | }, |
| 22 | body: JSON.stringify({ |
| 23 | data: buildLogBase64, |
| 24 | contentType: BUILD_LOG_CONTENT_TYPE |
| 25 | }) |
| 26 | }) |
| 27 | const res = await response.text() |
| 28 | return res |
| 29 | } |
| 30 | |
| 31 | // convert the bash script above to JS |
| 32 | const LLAMAS_LIST = process.env.LLAMAS_LIST || '' |