Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cf-common

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cf-common - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

42

analysis-utils.js

@@ -19,3 +19,3 @@ var crypto = require('crypto');

return Q()
return Q() //jshint ignore:line
.then(function () {

@@ -26,2 +26,3 @@

var useDockerfileFromRepo = false;
var repo = (repoOwner + '/' + repoName).replace(/-/g, '_').toLowerCase();

@@ -34,21 +35,30 @@ if (settings) {

//if we use customer dockerfile, we don't have an image per repo, we have an image per sha.
var revisionInfoIfRelevant = useDockerfileFromRepo ? latestSha : '';
function calcHash(sha) {
var hash = crypto.createHash('sha1');
hash.update(
JSON.stringify(build_sh) +
JSON.stringify(start_sh) +
JSON.stringify(useDockerfileFromRepo) +
revisionInfoIfRelevant);
var hash =
crypto.createHash('sha1')
.update(
JSON.stringify(build_sh) +
JSON.stringify(start_sh) +
JSON.stringify(useDockerfileFromRepo) +
sha)
.digest('hex')
.replace(/-/g, '_').toLowerCase();
var buildHash = hash.digest('hex').replace(/-/g, '_').toLowerCase();
var repo = (repoOwner + '/' + repoName).replace(/-/g, '_').toLowerCase();
return {
build_sh: build_sh,
start_sh: start_sh,
hash: hash,
repo: repo,
imageName: repo + ':' + buildHash
};
}
var forRevision = calcHash(latestSha);
//if we use customer dockerfile, we don't have an image per repo, we have an image per sha.
var forRepo = useDockerfileFromRepo ? withSha : calcHash('');
return {
build_sh: build_sh,
start_sh: start_sh,
hash: buildHash,
repo: repo,
imageName: repo + ':' + buildHash
repo: forRepo,
revision: forRevision
};

@@ -55,0 +65,0 @@ });

{
"name": "cf-common",
"version": "0.0.4",
"version": "0.0.5",
"description": "common modules for codefresh runtime and api",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc