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.3 to 0.0.4

38

analysis-utils.js

@@ -17,28 +17,20 @@ var crypto = require('crypto');

var prepareHashInfo = function(repoOwner, repoName, branch, settings, user) {
var prepareHashInfo = function(repoOwner, repoName, branch, latestSha, settings) {
var build_sh = "";
var start_sh = "";
var useDockerfileFromRepo = false;
return Q()
.then(function () {
if (settings) {
build_sh = settings.build_sh || build_sh;
start_sh = settings.start_sh || start_sh;
useDockerfileFromRepo = settings.useDockerfileFromRepo;
}
var build_sh = "";
var start_sh = "";
var useDockerfileFromRepo = false;
//the revision marker may or may not include information... that depends on the use case.
//if we don't use the dockerfile from the repo - we have a single image per repo.
//no need to create a sha for every branch.
//if we do use the dockerfile from the repo - we can't optimize, we have to build each time.
//we need a sha for every branch.
var revisionMarkerPromise = Q(''); //jshint ignore:line
if (useDockerfileFromRepo) {
revisionMarkerPromise = revisionMarkerPromise.then(function () {
return getLatestSha(user, repoOwner, repoName, branch);
});
}
if (settings) {
build_sh = settings.build_sh || build_sh;
start_sh = settings.start_sh || start_sh;
useDockerfileFromRepo = settings.useDockerfileFromRepo;
}
return revisionMarkerPromise
.then(function (revisionMarker) {
//if we use customer dockerfile, we don't have an image per repo, we have an image per sha.
var revisionInfoIfRelevant = useDockerfileFromRepo ? latestSha : '';
var hash = crypto.createHash('sha1');

@@ -49,3 +41,3 @@ hash.update(

JSON.stringify(useDockerfileFromRepo) +
revisionMarker);
revisionInfoIfRelevant);

@@ -52,0 +44,0 @@ var buildHash = hash.digest('hex').replace(/-/g, '_').toLowerCase();

{
"name": "cf-common",
"version": "0.0.3",
"version": "0.0.4",
"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