@docupace/pipeline 1.0.0-alpha.56 → 1.0.0-alpha.57

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.
@@ -4,4 +4,5 @@
4
4
  DIR="$(cd "$(dirname "$0")" && pwd)/../@docupace/pipeline"
5
5
 
6
6
  # Pass all arguments to the actual script
7
- bash $DIR/next/changeset.sh validate $2
7
+
8
+ bash $DIR/next/changeset.sh validate $2
@@ -0,0 +1,75 @@
1
+ #!/bin/bash
2
+ set -e
3
+
4
+
5
+ DIR="$(cd "$(dirname "$0")" && pwd)"
6
+
7
+ # Function: Validate changeset presence
8
+ validate_changesets() {
9
+ if [ ! -z "$PR_ID" ]; then
10
+ echo "🔍 Validating changesets..."
11
+ pnpm node $DIR/validateChangeset.cjs $1 || {
12
+ if [ $? -eq 1 ]; then
13
+ echo "❌ No changeset found. Please add a changeset to this PR. Please see more information at https://docupacellc.atlassian.net/wiki/spaces/PM/pages/1350893571/Creating+changesets+for+Docupace+Next"
14
+ exit 1
15
+ else
16
+ echo "✅ Changeset validation passed."
17
+ fi
18
+ }
19
+ fi
20
+ }
21
+
22
+ setGitInfo() {
23
+ git config --global user.email "gitops@docupace.com"
24
+ git config --global user.name "Gitops"
25
+ git remote set-url origin https://x-token-auth:${BITBUCKET_TOKEN}@bitbucket.org/dp-cloud/docupace-graphql-server.git
26
+ }
27
+
28
+ # Function: Handle versioning and changelog generation
29
+ version_application() {
30
+ setGitInfo
31
+ echo "📦 Running Changeset versioning..."
32
+ pnpm changeset version
33
+ echo "Complete"
34
+ }
35
+
36
+ # Function: Commit and tag the new version
37
+ commit_and_tag() {
38
+ setGitInfo
39
+ echo "📌 Committing and tagging the new version..."
40
+ git add .
41
+ git commit -m "chore: version bump and changelog"
42
+ git push origin
43
+
44
+ # Create and push a new tag
45
+ local new_version
46
+ new_version=$(node -p "require('./package.json').version")
47
+ git tag "v$new_version"
48
+ git push origin --tags
49
+ echo "✅ Version $new_version tagged and pushed."
50
+ }
51
+
52
+ # Parse the provided command
53
+ case "$1" in
54
+ validate)
55
+ validate_changesets $2
56
+ ;;
57
+ build)
58
+ build_application
59
+ ;;
60
+ version)
61
+ version_application
62
+ ;;
63
+ commit-and-tag)
64
+ commit_and_tag
65
+ ;;
66
+ all)
67
+ version_application
68
+ commit_and_tag
69
+ ;;
70
+ *)
71
+ echo "❓ Unknown command: $1"
72
+ echo "Available commands: validate, build, version, commit-and-tag, all"
73
+ exit 1
74
+ ;;
75
+ esac
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docupace/pipeline",
3
- "version": "1.0.0-alpha.56",
3
+ "version": "1.0.0-alpha.57",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",