Skip to content

Commit

Permalink
test(sealos): e2e test for sealos
Browse files Browse the repository at this point in the history
Signed-off-by: cuisongliu <cuisongliu@qq.com>
  • Loading branch information
cuisongliu committed Oct 3, 2024
1 parent 06ed27f commit fa2eb90
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 2 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,39 @@ jobs:
DOCKER_REPO: ghcr.io/${{ github.repository_owner }}/automq-operator
run: |
IMG=${DOCKER_REPO}:latest make docker-buildx
job1:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@master

- name: Set up Go
uses: actions/setup-go@master
with:
go-version: 1.23.x

- name: Verify sealos
run: |
wget -q https://github.com/labring/sealos/releases/download/v4.3.7/sealos_4.3.7_linux_amd64.tar.gz
tar -zxvf sealos_4.3.7_linux_amd64.tar.gz sealos
sudo chmod a+x sealos
sudo mv sealos /usr/bin/
sudo sealos version
- name: build
run: |
go run gen/gen.go ghcr.io/${{ github.repository_owner }}/automq-operator:latest && make info
cd deploy
sudo sealos login -u ${{ github.repository_owner }} -p ${{ secrets.GH_TOKEN }} --debug ghcr.io
IMAGE_NAME="ghcr.io/${{ github.repository_owner }}/automq-operator-sealos:latest"
sudo sealos build -t "${IMAGE_NAME}"-amd64 --platform linux/amd64 .
sudo sealos build -t "${IMAGE_NAME}"-arm64 --platform linux/arm64 .
sudo sealos push "${IMAGE_NAME}"-amd64
sudo sealos push "${IMAGE_NAME}"-arm64
sudo sealos images
sudo sealos manifest create "${IMAGE_NAME}"
sudo sealos manifest add "$IMAGE_NAME" docker://"$IMAGE_NAME-amd64"
sudo sealos manifest add "$IMAGE_NAME" docker://"$IMAGE_NAME-arm64"
sudo sealos manifest push --all "$IMAGE_NAME" docker://"$IMAGE_NAME" && echo "$IMAGE_NAME push success"
sudo sealos images
26 changes: 25 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:

- name: Verify sealos
run: |
wget https://github.com/labring/sealos/releases/download/v4.3.7/sealos_4.3.7_linux_amd64.tar.gz
wget -q https://github.com/labring/sealos/releases/download/v4.3.7/sealos_4.3.7_linux_amd64.tar.gz
tar -zxvf sealos_4.3.7_linux_amd64.tar.gz sealos
sudo chmod a+x sealos
sudo mv sealos /usr/bin/
Expand All @@ -55,3 +55,27 @@ jobs:
- name: build
run: |
sudo make e2e
job2:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@master

- name: Set up Go
uses: actions/setup-go@master
with:
go-version: 1.23.x

- name: Verify sealos
run: |
wget -q https://github.com/labring/sealos/releases/download/v4.3.7/sealos_4.3.7_linux_amd64.tar.gz
tar -zxvf sealos_4.3.7_linux_amd64.tar.gz sealos
sudo chmod a+x sealos
sudo mv sealos /usr/bin/
sudo sealos version
- name: build
run: |
go run gen/gen.go ghcr.io/${{ github.repository_owner }}/automq-operator:latest && make info
cd deploy
sudo sealos build -t ghcr.io/${{ github.repository_owner }}/automq-operator-sealos:latest .
2 changes: 1 addition & 1 deletion .github/workflows/update_version_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
vPrefix = true
releaseBranch = main
versionFile = .tagpr
command = go run gen/gen.go ghcr.io/cuisongliu/automq-operator:${{ github.event.inputs.version }} && make info
command = go run gen/gen.go ghcr.io/${{ github.repository_owner }}/automq-operator:${{ github.event.inputs.version }} && make info
release = false
changelog = true
EOF
Expand Down
3 changes: 3 additions & 0 deletions gen/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ func main() {
os.Exit(1)
}
shotVersion := strings.ReplaceAll(version[1], "v", "")
if shotVersion == "latest" {
shotVersion = "0.0.0"
}
cmd2 := fmt.Sprintf("sed -i '/#replace_by_makefile/!b;n;c\\version: %s' deploy/charts/automq-operator/Chart.yaml", shotVersion)
if err := execCmd("bash", "-c", cmd2); err != nil {
fmt.Printf("execCmd error %v", err)
Expand Down

0 comments on commit fa2eb90

Please # to comment.