init
This commit is contained in:
parent
f87c675025
commit
b2a4a8a1f6
@ -13,6 +13,11 @@ spec:
|
|||||||
Accepts space-separated project pairs for bulk operations.
|
Accepts space-separated project pairs for bulk operations.
|
||||||
|
|
||||||
params:
|
params:
|
||||||
|
- name: context
|
||||||
|
type: string
|
||||||
|
description: context directory
|
||||||
|
default: ""
|
||||||
|
|
||||||
- name: targetProjects
|
- name: targetProjects
|
||||||
type: string
|
type: string
|
||||||
description: "Space-separated target project paths in monorepo (e.g., 'libs/auth libs/payment')"
|
description: "Space-separated target project paths in monorepo (e.g., 'libs/auth libs/payment')"
|
||||||
@ -32,15 +37,15 @@ spec:
|
|||||||
default: "unbox-x"
|
default: "unbox-x"
|
||||||
|
|
||||||
workspaces:
|
workspaces:
|
||||||
- name: source
|
- name: base
|
||||||
description: Workspace containing source projects
|
|
||||||
- name: repo
|
|
||||||
description: Git repository workspace
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: import-projects
|
- name: import-projects
|
||||||
image: node:18-alpine
|
image: node:18-alpine
|
||||||
workingDir: $(workspaces.repo.path)
|
workingDir: /workspace/base/$(params.context)/source
|
||||||
|
env:
|
||||||
|
- name: HOME
|
||||||
|
value: /workspace/base/$(params.context)/home
|
||||||
script: |
|
script: |
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -ex
|
set -ex
|
||||||
@ -59,11 +64,12 @@ spec:
|
|||||||
|
|
||||||
# Process each project pair
|
# Process each project pair
|
||||||
for i in $(seq 0 $((${#TARGETS[@]}-1))); do
|
for i in $(seq 0 $((${#TARGETS[@]}-1))); do
|
||||||
SRC="$(workspaces.source.path)/${SOURCES[$i]}"
|
SRC="${SOURCES[$i]}"
|
||||||
TARGET="${TARGETS[$i]}"
|
TARGET="${TARGETS[$i]}"
|
||||||
|
|
||||||
echo "Importing: ${SRC} → ${TARGET}"
|
echo "Importing: ${SRC} → ${TARGET}"
|
||||||
nx import "${SRC}" --destination="${TARGET}" --importPath=$(basename "${TARGET}")
|
# nx import "${SRC}" --destination="${TARGET}" --importPath=$(basename "${TARGET}")
|
||||||
|
nx import "${SRC}" "${TARGET}"
|
||||||
|
|
||||||
echo "Updating version to $(params.version)"
|
echo "Updating version to $(params.version)"
|
||||||
sed -i.bak "s/^version = .*/version = \"$(params.version)\"/" "${TARGET}/Cargo.toml"
|
sed -i.bak "s/^version = .*/version = \"$(params.version)\"/" "${TARGET}/Cargo.toml"
|
||||||
@ -72,12 +78,13 @@ spec:
|
|||||||
|
|
||||||
- name: git-commit
|
- name: git-commit
|
||||||
image: alpine/git:latest
|
image: alpine/git:latest
|
||||||
workingDir: $(workspaces.repo.path)
|
workingDir: /workspace/base/$(params.context)/source
|
||||||
|
env:
|
||||||
|
- name: HOME
|
||||||
|
value: /workspace/base/$(params.context)/home
|
||||||
script: |
|
script: |
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
git config --global user.name "tekton-bot"
|
|
||||||
git config --global user.email "tekton@example.com"
|
|
||||||
git add .
|
git add .
|
||||||
git commit -m "chore: merge projects (version $(params.version))" || exit 0
|
git commit -m "chore: merge projects (version $(params.version))" || exit 0
|
||||||
git push origin HEAD:main
|
git push origin HEAD:main
|
||||||
|
Loading…
x
Reference in New Issue
Block a user