Skip to content

Commit

Permalink
Improve werft job build speed and make honeycomb more accurate
Browse files Browse the repository at this point in the history
  • Loading branch information
mustard-mh authored and roboquat committed Mar 4, 2022
1 parent 3b07473 commit 010e7f6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .werft/jobs/build/deploy-to-preview-environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ async function deployToDevWithInstaller(werft: Werft, jobConfig: JobConfig, depl
let registryNodePortMeta = findLastHostPort(namespace, 'registry-facade', metaEnv({ slice: installerSlices.FIND_FREE_HOST_PORTS, silent: true }))
let nodeExporterPort = findLastHostPort(namespace, 'node-exporter', metaEnv({ slice: installerSlices.FIND_FREE_HOST_PORTS, silent: true }))

if (isNaN(wsdaemonPortMeta) || isNaN(wsdaemonPortMeta) || isNaN(nodeExporterPort)) {
if (isNaN(wsdaemonPortMeta) || isNaN(wsdaemonPortMeta) || (isNaN(nodeExporterPort) && !withVM && withObservability)) {
werft.log(installerSlices.FIND_FREE_HOST_PORTS, "Can't reuse, check for some free ports.");
[wsdaemonPortMeta, registryNodePortMeta, nodeExporterPort] = findFreeHostPorts([
{ start: 10000, end: 11000 },
Expand Down Expand Up @@ -261,7 +261,6 @@ async function deployToDevWithInstaller(werft: Werft, jobConfig: JobConfig, depl
const dockerConfig = { auths: { "eu.gcr.io": { auth: deploymentConfig.imagePullAuth }, "europe-docker.pkg.dev": { auth: deploymentConfig.imagePullAuth } } };
fs.writeFileSync(`./${IMAGE_PULL_SECRET_NAME}`, JSON.stringify(dockerConfig));
exec(`kubectl create secret docker-registry ${IMAGE_PULL_SECRET_NAME} -n ${namespace} --from-file=.dockerconfigjson=./${IMAGE_PULL_SECRET_NAME}`);
werft.done(installerSlices.IMAGE_PULL_SECRET);
}
catch (err) {
if (!jobConfig.mainBuild) {
Expand All @@ -270,6 +269,7 @@ async function deployToDevWithInstaller(werft: Werft, jobConfig: JobConfig, depl
exec('exit 0')
}
}
werft.done(installerSlices.IMAGE_PULL_SECRET);

// download and init with the installer
try {
Expand Down

0 comments on commit 010e7f6

Please sign in to comment.