Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
"node": "14.18.1"
},
"devDependencies": {
"@codefresh-io/docker-reference": "^0.0.11",
"graphql": "^16.1.0",
"graphql-request": "^3.7.0",
"lodash": "^4.17.21",
"nodegistry": "^1.1.0"
},
"dependencies": {
"joi": "^17.6.0"
"joi": "^17.6.0",
"@codefresh-io/docker-reference": "^0.0.11"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// registering error handler
require('./outputs')

const { parseQualifiedNameOptimized, parseFamiliarName } = require('@codefresh-io/docker-reference')
const { GraphQLClient, gql, ClientError } = require('graphql-request')
const _ = require('lodash')

Expand Down Expand Up @@ -32,6 +32,9 @@ async function main() {
// store in FS to use as an output param later (in argo workflow)
storeOutputParam(OUTPUTS.IMAGE_NAME, image)
storeOutputParam(OUTPUTS.IMAGE_SHA, manifest.config.digest)
const repositoryName = _.get(parseFamiliarName(image, parseQualifiedNameOptimized), 'repository')
const imageLink = `${inputs.codefresh.host}/2.0/images/${encodeURIComponent(repositoryName)}/${manifest.config.digest}/${encodeURIComponent(image)}`
storeOutputParam(OUTPUTS.IMAGE_LINK, imageLink)

const size = manifest.config.size + _.reduce(manifest.layers, (sum, layer) => {
return sum + layer.size;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ const ensureOutputFilesExists = () => {
const OUTPUTS = {
IMAGE_NAME: 'image_name',
IMAGE_SHA: 'image_sha',
EXIT_ERROR: 'exit_error'
EXIT_ERROR: 'exit_error',
IMAGE_LINK: 'image_link'
}

ensureOutputFilesExists()
Expand Down