haven-cypress-integration 1.1.3 → 1.2.0

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/README.md CHANGED
@@ -64,19 +64,33 @@ npx haven-cypress run --automationIds=TC-AUTO-123,TC-AUTO-124
64
64
  ```
65
65
 
66
66
  ### ECR Image Organization
67
- Images are organized in the `haven-test-images` ECR repository with product-based tagging:
67
+ Images are organized in the `haven-test-images` ECR repository with product-based versioning:
68
68
  ```
69
69
  Repository: haven-test-images
70
- ├── BE-latest-2025-09-10T10-52-44
71
- ├── BE-v1.0-2025-09-10T14-30-15
72
- ├── billexplainer-latest-2025-09-10T11-15-30
73
- └── payments-latest-2025-09-10T12-00-45
70
+ ├── BE-v1.0.123456 (latest with build number)
71
+ ├── BE-v2.1.0 (semantic version)
72
+ ├── payments-v1.0.789012
73
+ └── auth-v3.0.0
74
74
  ```
75
75
 
76
- **Tag Format**: `{PRODUCT}-{VERSION}-{TIMESTAMP}`
76
+ **Tag Format**: `{PRODUCT}-{VERSION}`
77
77
  - **Product**: Organizes images by product/team
78
- - **Version**: `latest` (default) or custom tag (e.g., `v1.0`)
79
- - **Timestamp**: Ensures unique tags and prevents overwrites
78
+ - **Version**: Semantic versioning (e.g., `v2.1.0`) or build numbers (e.g., `v1.0.123456`)
79
+
80
+ ### Versioning Examples
81
+ ```bash
82
+ # Build with auto-generated build number
83
+ npx haven-cypress build --product=BE --push
84
+ → ECR tag: BE-v1.0.123456
85
+
86
+ # Build with semantic version
87
+ npx haven-cypress build --product=BE --tag=v2.1.0 --push
88
+ → ECR tag: BE-v2.1.0
89
+
90
+ # Build with custom build number (CI/CD)
91
+ BUILD_NUMBER=456 npx haven-cypress build --product=BE --push
92
+ → ECR tag: BE-v1.0.456
93
+ ```
80
94
 
81
95
  ## What's Included
82
96
 
@@ -22,10 +22,15 @@ Options:
22
22
  --automationIds=ID1,ID2 Run specific test cases
23
23
 
24
24
  Examples:
25
- npx haven-cypress build --product=billexplainer
26
- npx haven-cypress build --product=billexplainer --push
27
- npx haven-cypress build --product=billexplainer --tag=v1.0 --push
25
+ npx haven-cypress build --product=BE
26
+ npx haven-cypress build --product=BE --push
27
+ npx haven-cypress build --product=BE --tag=v2.1.0 --push
28
28
  npx haven-cypress run --automationIds=TC-AUTO-123,TC-AUTO-124
29
+
30
+ Versioning:
31
+ --tag=latest → ECR tag: BE-v1.0.{BUILD_NUMBER}
32
+ --tag=v2.1.0 → ECR tag: BE-v2.1.0
33
+ BUILD_NUMBER env → Custom build number (default: timestamp)
29
34
  `);
30
35
  process.exit(1);
31
36
  }
package/index.js CHANGED
@@ -151,8 +151,21 @@ class HavenCypressIntegration {
151
151
  // ECR repository and image details
152
152
  const ecrRepo = 'haven-test-images';
153
153
  const ecrUri = `${accountId}.dkr.ecr.${region}.amazonaws.com/${ecrRepo}`;
154
- const timestamp = new Date().toISOString().replace(/[:.]/g, '-').slice(0, 19);
155
- const ecrTag = `${product}-${localTag.split(':')[1] || 'latest'}-${timestamp}`;
154
+
155
+ // Extract version from local tag or use 'latest'
156
+ const localVersion = localTag.split(':')[1] || 'latest';
157
+
158
+ // Generate ECR tag with product and version
159
+ let ecrTag;
160
+ if (localVersion === 'latest') {
161
+ // For 'latest', use build number format: product-v1.0.BUILD_NUMBER
162
+ const buildNumber = process.env.BUILD_NUMBER || Date.now().toString().slice(-6);
163
+ ecrTag = `${product}-v1.0.${buildNumber}`;
164
+ } else {
165
+ // For custom versions, use: product-VERSION
166
+ ecrTag = `${product}-${localVersion}`;
167
+ }
168
+
156
169
  const fullEcrUri = `${ecrUri}:${ecrTag}`;
157
170
 
158
171
  console.log(`🏷️ ECR tag: ${ecrTag}`);
@@ -172,7 +185,8 @@ class HavenCypressIntegration {
172
185
 
173
186
  console.log(`✅ Image pushed successfully!`);
174
187
  console.log(`📍 ECR URI: ${fullEcrUri}`);
175
- console.log(`🗂️ Product Organization: ${product} (tag: ${ecrTag})`);
188
+ console.log(`🗂️ Product: ${product}`);
189
+ console.log(`🏷️ Version: ${ecrTag}`);
176
190
 
177
191
  } catch (error) {
178
192
  console.error(`❌ Failed to push to ECR: ${error.message}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "haven-cypress-integration",
3
- "version": "1.1.3",
3
+ "version": "1.2.0",
4
4
  "description": "Seamless Cypress integration with HAVEN test case management",
5
5
  "main": "index.js",
6
6
  "bin": {