Skip to content

Commit af9b5ab

Browse files
authored
mv lifecycle to stand-alone directory (labring#5425)
* mv lifecycle to stand-alone directory * fix workflows * fix workflows Signed-off-by: ghostloda <[email protected]> fix workflows * fix e2e workflows Signed-off-by: ghostloda <[email protected]> * fix e2e workflows Signed-off-by: ghostloda <[email protected]> * mv to lifecycle from root dir Signed-off-by: ghostloda <[email protected]> * fix release workflows Signed-off-by: ghostloda <[email protected]> * Move lifecycle-related script files to lifecycle Signed-off-by: ghostloda <[email protected]> * Move to lifecycle Signed-off-by: ghostloda <[email protected]> * fix lifecycle project ptah Signed-off-by: ghostloda <[email protected]> * fix path ptah Signed-off-by: ghostloda <[email protected]> * add lifecycle modules Signed-off-by: ghostloda <[email protected]> * fix format Signed-off-by: ghostloda <[email protected]> * fix format Signed-off-by: ghostloda <[email protected]> --------- Signed-off-by: ghostloda <[email protected]>
1 parent bd94480 commit af9b5ab

File tree

439 files changed

+30
-24
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

439 files changed

+30
-24
lines changed

.github/workflows/check-coverage.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ on:
2222
env:
2323
# Common versions
2424
GO_VERSION: "1.20"
25+
PROJECT_PATH: "./lifecycle"
2526

2627
jobs:
2728
coverage:
@@ -39,7 +40,7 @@ jobs:
3940
run: sudo apt update && sudo apt install -y libgpgme-dev libbtrfs-dev libdevmapper-dev
4041

4142
- name: Run Coverage
42-
run: make coverage
43+
run: cd ${{ env.PROJECT_PATH }} && make coverage
4344

4445
- name: Upload Coverage to Codecov
4546
uses: codecov/codecov-action@v3

.github/workflows/check-format-code.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ on:
2222
env:
2323
# Common versions
2424
GO_VERSION: "1.23"
25+
PROJECT_PATH: "./lifecycle"
2526

2627
jobs:
2728
format-code:
@@ -39,7 +40,7 @@ jobs:
3940
go-version: ${{ env.GO_VERSION }}
4041

4142
- name: Format Code
42-
run: make format
43+
run: cd ${{ env.PROJECT_PATH }} && make format
4344

4445
- name: Commit Changes
4546
uses: stefanzweifel/git-auto-commit-action@v4

.github/workflows/check-license.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ on:
2222
env:
2323
# Common versions
2424
GO_VERSION: "1.20"
25+
PROJECT_PATH: "./lifecycle"
2526

2627
jobs:
2728
check-license:
@@ -38,4 +39,4 @@ jobs:
3839
go-version: ${{ env.GO_VERSION }}
3940

4041
- name: Check License
41-
run: make verify-license
42+
run: cd ${{ env.PROJECT_PATH }} && make verify-license

.github/workflows/import-patch-image.yml

+17-16
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: Import Patch Images Package
33
env:
44
# Common versions
55
GO_VERSION: "1.20"
6+
PROJECT_PATH: "./lifecycle"
67

78
on:
89
workflow_call:
@@ -41,7 +42,7 @@ jobs:
4142
repository: ${{ github.event.pull_request.head.repo.full_name }}
4243
- name: Resolve Modules
4344
id: set-matrix
44-
run: bash ./scripts/resolve-patch-modules.sh ${{ inputs.arch }} "true"
45+
run: bash ./${{ env.PROJECT_PATH }}/scripts/resolve-patch-modules.sh ${{ inputs.arch }} "true"
4546
resolve-modules:
4647
runs-on: ubuntu-24.04
4748
outputs:
@@ -58,7 +59,7 @@ jobs:
5859
repository: ${{ github.event.pull_request.head.repo.full_name }}
5960
- name: Resolve Modules
6061
id: set-matrix
61-
run: bash ./scripts/resolve-patch-modules.sh ${{ inputs.arch }}
62+
run: bash ./${{ env.PROJECT_PATH }}/scripts/resolve-patch-modules.sh ${{ inputs.arch }}
6263
build:
6364
needs: [ resolve-modules ]
6465
runs-on: ubuntu-24.04
@@ -91,12 +92,12 @@ jobs:
9192
9293
- name: Build Binaries
9394
run: |
94-
make build BINS=${{ matrix.binary }} PLATFORM=linux_${{ matrix.arch }}
95+
cd ${{ env.PROJECT_PATH }} && make build BINS=${{ matrix.binary }} PLATFORM=linux_${{ matrix.arch }}
9596
- name: Save Binaries
9697
uses: actions/upload-artifact@v4
9798
with:
9899
name: ${{ matrix.binary }}-${{ matrix.arch }}
99-
path: bin/linux_${{ matrix.arch}}/${{ matrix.binary }}
100+
path: ${{ env.PROJECT_PATH }}/bin/linux_${{ matrix.arch}}/${{ matrix.binary }}
100101
test:
101102
runs-on: ubuntu-24.04
102103
if: ${{ (inputs.e2e == true) }}
@@ -120,13 +121,13 @@ jobs:
120121
run: sudo apt update && sudo apt install -y libgpgme-dev libbtrfs-dev libdevmapper-dev
121122
- name: Build E2e Test
122123
run: |
123-
go install github.com/onsi/ginkgo/v2/ginkgo
124+
cd ${{ env.PROJECT_PATH }} && go install github.com/onsi/ginkgo/v2/ginkgo
124125
cd test/e2e && ginkgo build .
125126
- name: Save E2e Test
126127
uses: actions/upload-artifact@v4
127128
with:
128129
name: e2e.test
129-
path: test/e2e/e2e.test
130+
path: ${{ env.PROJECT_PATH }}/test/e2e/e2e.test
130131
docker:
131132
needs: [ resolve-modules-arch,build ]
132133
runs-on: ubuntu-24.04
@@ -155,25 +156,25 @@ jobs:
155156
uses: actions/download-artifact@v4
156157
with:
157158
name: lvscare-${{ matrix.arch }}
158-
path: docker/lvscare
159+
path: ${{ env.PROJECT_PATH }}/docker/lvscare
159160

160161
- name: Download sealctl
161162
uses: actions/download-artifact@v4
162163
with:
163164
name: sealctl-${{ matrix.arch }}
164-
path: docker/patch
165+
path: ${{ env.PROJECT_PATH }}/docker/patch
165166

166167
- name: Download image-cri-shim
167168
uses: actions/download-artifact@v4
168169
with:
169170
name: image-cri-shim-${{ matrix.arch }}
170-
path: docker/patch
171+
path: ${{ env.PROJECT_PATH }}/docker/patch
171172

172173
- name: Download sealos
173174
uses: actions/download-artifact@v4
174175
with:
175176
name: sealos-${{ matrix.arch }}
176-
path: docker/sealos
177+
path: ${{ env.PROJECT_PATH }}/docker/sealos
177178

178179
- name: Set up Docker Buildx
179180
uses: docker/setup-buildx-action@v3
@@ -182,22 +183,22 @@ jobs:
182183

183184
- name: Chmod a+x for docker
184185
run: |
185-
chmod a+x docker/sealos/*
186-
chmod a+x docker/patch/*
187-
chmod a+x docker/lvscare/*
186+
chmod a+x ${{ env.PROJECT_PATH }}/docker/sealos/*
187+
chmod a+x ${{ env.PROJECT_PATH }}/docker/patch/*
188+
chmod a+x ${{ env.PROJECT_PATH }}/docker/lvscare/*
188189
189190
- name: Build and Push lvscare Image
190191
uses: docker/build-push-action@v6
191192
with:
192-
context: docker/lvscare
193-
file: docker/lvscare/Dockerfile.main
193+
context: ${{ env.PROJECT_PATH }}/docker/lvscare
194+
file: ${{ env.PROJECT_PATH }}/docker/lvscare/Dockerfile.main
194195
push: true
195196
build-args: Bin=lvscare
196197
platforms: linux/${{ matrix.arch }}
197198
tags: localhost:5000/${{ github.repository_owner }}/lvscare:${{ env.GIT_COMMIT_SHORT_SHA }}-${{ matrix.arch }}
198199

199200
- name: Build and Save Cluster Images
200-
run: docker/patch/save-cluster-images.sh
201+
run: ${{ env.PROJECT_PATH }}/docker/patch/save-cluster-images.sh
201202
env:
202203
ARCH: ${{ matrix.arch }}
203204
OWNER: ${{ github.repository_owner }}

.github/workflows/release.yml

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
uses: goreleaser/goreleaser-action@v6
4444
with:
4545
args: release --clean --release-footer-tmpl=scripts/release/footer.md.tmpl --release-header-tmpl=scripts/release/head.md.tmpl
46+
workdir: ./lifecycle
4647
env:
4748
USERNAME: ${{ github.repository_owner }}
4849
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_PAT }}

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ vendor
2121
pkg/registry/save/testdata/registry
2222
.dummy.report.md
2323
deploy/cloud/tars
24-
.vscode/
24+
.vscode/
25+
/lifecycle/tools/
File renamed without changes.

Dockerfile lifecycle/Dockerfile

File renamed without changes.

Makefile lifecycle/Makefile

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

docker/patch/save-cluster-images.sh lifecycle/docker/patch/save-cluster-images.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
IMAGE=localhost:5000/${OWNER}/lvscare:$GIT_COMMIT_SHORT_SHA-$ARCH
44
PATCH=ghcr.io/${OWNER}/sealos-patch:$GIT_COMMIT_SHORT_SHA-$ARCH
5-
PATCH_DIR=docker/patch
5+
PATCH_DIR=lifecycle/docker/patch
66
SEALOS=sudo sealos
77
SEALOS_VERSION=4.1.7
88

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

go.mod lifecycle/go.mod

File renamed without changes.

go.sum lifecycle/go.sum

File renamed without changes.

go.work lifecycle/go.work

File renamed without changes.

go.work.sum lifecycle/go.work.sum

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

scripts/make-rules/common.mk lifecycle/scripts/make-rules/common.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ endif
6060

6161
# Linux command settings
6262
STAGING_DIR := $(ROOT_DIR)/staging/src/github.com/labring
63-
CODE_DIRS := $(ROOT_DIR)/pkg $(ROOT_DIR)/cmd $(ROOT_DIR)/controllers $(STAGING_DIR)/image-cri-shim $(STAGING_DIR)/lvscare
63+
CODE_DIRS := $(ROOT_DIR)/pkg $(ROOT_DIR)/cmd $(STAGING_DIR)/image-cri-shim $(STAGING_DIR)/lvscare
6464
FIND := find $(CODE_DIRS)
6565

6666
# verbose settings
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)