@docupace/pipeline 1.0.2 โ†’ 1.0.3

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.2",
3
+ "version": "1.0.3",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -77,6 +77,15 @@ async function versionCommand() {
77
77
  }
78
78
 
79
79
  async function commitTagCommand() {
80
+ console.log('๐Ÿ“Œ Checking for updates to commit...');
81
+
82
+ // Check if there are changes to commit
83
+ const status = (await $`git status --porcelain`).stdout.trim();
84
+ if (!status) {
85
+ console.log('โœ… No changes to commit. Exiting.');
86
+ return;
87
+ }
88
+
80
89
  console.log('๐Ÿ“Œ Committing and tagging the new version...');
81
90
  await setGitInfo();
82
91
  await $`git add .`;
@@ -88,6 +97,7 @@ async function commitTagCommand() {
88
97
  console.log(`โœ… Version ${newVersion} tagged and pushed.`);
89
98
  }
90
99
 
100
+
91
101
  // Command: validate
92
102
  program
93
103
  .command('validate <path>')
@@ -60,22 +60,32 @@ export function setTag(deployConfig, tag) {
60
60
  export async function writeDeployConfig(repoPath, deployConfigFilePath, deployConfig) {
61
61
  try {
62
62
  fs.writeFileSync(deployConfigFilePath, yaml.dump(deployConfig), 'utf8');
63
- console.log(`Updated YAML file saved at: ${deployConfigFilePath}`);
63
+ console.log(`โœ… Updated YAML file saved at: ${deployConfigFilePath}`);
64
64
  } catch (error) {
65
- console.error(`Error writing YAML file: ${error.message}`);
65
+ console.error(`โŒ Error writing YAML file: ${error.message}`);
66
66
  process.exit(1);
67
67
  }
68
68
 
69
- console.log('Committing changes to the repository...');
69
+ console.log('๐Ÿ“Œ Checking for updates to commit...');
70
+ // Check if there are any changes to commit
71
+ const status = (await $`cd ${repoPath} && git status --porcelain`).stdout.trim();
72
+ if (!status) {
73
+ console.log('โœ… No changes to commit. Exiting.');
74
+ await $`rm -rf ${repoPath}`;
75
+ console.log('๐Ÿงน Cleanup complete.');
76
+ return;
77
+ }
78
+
79
+ console.log('๐Ÿ“Œ Committing changes to the repository...');
70
80
  await $`cd ${repoPath} && git config user.email "gitops@docupace.com"`;
71
81
  await $`cd ${repoPath} && git add ${deployConfigFilePath}`;
72
82
  await $`cd ${repoPath} && git commit -m "Update image tag to ${deployConfig.image.tag}"`;
73
83
  await $`cd ${repoPath} && git push origin ${GITOPS_BRANCH}`;
74
- console.log('Changes pushed to the remote repository.');
84
+ console.log('โœ… Changes pushed to the remote repository.');
75
85
 
76
- console.log('Cleaning up...');
86
+ console.log('๐Ÿงน Cleaning up...');
77
87
  await $`rm -rf ${repoPath}`;
78
- console.log('Cleanup complete.');
88
+ console.log('โœ… Cleanup complete.');
79
89
  }
80
90
 
81
91
  /**