@docupace/pipeline 1.0.7-7.micro-cli10 → 1.0.7-7.micro-cli12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docupace/pipeline",
3
- "version": "1.0.77.micro-cli10",
3
+ "version": "1.0.77.micro-cli12",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "bin": {
@@ -292,18 +292,18 @@ export async function microserviceBuildPushImage(repoName, options = {}) {
292
292
  console.log(`Registry: ${config.registryUrl}/${repoName}`);
293
293
  console.log('==========================================');
294
294
 
295
- const registryPath = `${config.registryUrl}/${repoName}`;
295
+ const registryPath = `${config.registryUrl}/${repoName}-dev-docker-local`;
296
296
  // Docker login
297
297
  await $`echo ${config.password} | docker login --username ${config.username} --password-stdin ${config.registryUrl}`;
298
298
 
299
299
  try {
300
300
  // Build the image if it doesn't exist locally
301
- const TAG_IMAGE_NAME = `${config.imageName}:${options.tag}`;
301
+ const TAG_IMAGE_NAME = `${registryPath}/${serviceName}:${options.tag}`;
302
302
  const imageExists = await checkLocalImage(TAG_IMAGE_NAME);
303
-
303
+ let SHA_IMAGE_NAME = '';
304
304
  if (!imageExists) {
305
305
  const repoUrl = `https://${process.env.BITBUCKET_USERNAME}:${process.env.BITBUCKET_APP_PASSWORD}@bitbucket.org/dp-cloud/${repoName}.git`;
306
- await $`git clone --depth 1 ${repoUrl} ${repoName}`;
306
+ await $`git clone --branch ${options.tag} --depth 1 ${repoUrl} ${repoName}`;
307
307
 
308
308
  console.log('Checking if directory exists...');
309
309
  await $`ls -la ${repoName}`;
@@ -315,12 +315,11 @@ export async function microserviceBuildPushImage(repoName, options = {}) {
315
315
  await $`cd ${repoName} && git config user.name "Bitbucket Pipeline"`;
316
316
 
317
317
  console.log(`Attempting to checkout branch: ${options.tag}`);
318
- await $`cd ${repoName} && git checkout ${options.tag}`;
319
318
 
320
319
  const gitSha = (
321
320
  await $`cd ${repoName} && git log ${options.tag} --pretty=format:'%h' -n 1 `
322
321
  ).stdout.trim();
323
- const SHA_IMAGE_NAME = `${config.imageName}:sha-${gitSha}`;
322
+ SHA_IMAGE_NAME = `${config.imageName}:sha-${gitSha}`;
324
323
 
325
324
  console.log(`Building Docker image ${SHA_IMAGE_NAME}...`);
326
325
  await $`cd ${repoName} && docker build -t ${SHA_IMAGE_NAME} .`;