forked from kubeovn/kube-ovn
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: zhangzujian <[email protected]>
- Loading branch information
1 parent
459e2d6
commit 3903506
Showing
5 changed files
with
91 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,7 @@ jobs: | |
name: Build kube-ovn-base | ||
runs-on: ubuntu-22.04 | ||
outputs: | ||
build-base: ${{ steps.build.outputs.build-base }} | ||
build-base: ${{ steps.check.outputs.build-base }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
|
@@ -42,41 +42,68 @@ jobs: | |
if [ ${{ github.event_name }} != 'pull_request' ]; then | ||
exit | ||
fi | ||
if git diff --name-only HEAD^ HEAD | grep -q ^dist/images/Dockerfile.base; then | ||
echo buildx=1 >> "$GITHUB_OUTPUT" | ||
if git diff --name-only HEAD^ HEAD | grep -q ^dist/images/Dockerfile.base$; then | ||
echo build-base=1 >> "$GITHUB_OUTPUT" | ||
fi | ||
- uses: docker/setup-buildx-action@v2 | ||
if: steps.check.outputs.buildx == 1 | ||
- uses: docker/setup-buildx-action@v3 | ||
if: steps.check.outputs.build-base == 1 | ||
|
||
- name: Build kube-ovn-base image | ||
id: build | ||
if: steps.check.outputs.buildx == 1 | ||
if: steps.check.outputs.build-base == 1 | ||
run: | | ||
if git diff --name-only HEAD^ HEAD | grep -q ^dist/images/Dockerfile.base$; then | ||
make base-amd64 | ||
make base-tar-amd64 | ||
echo build-base=1 >> "$GITHUB_OUTPUT" | ||
fi | ||
- name: Upload base images to artifact | ||
if: steps.build.outputs.build-base == 1 | ||
if: steps.check.outputs.build-base == 1 | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: kube-ovn-base | ||
path: image-amd64.tar | ||
|
||
- name: Build kube-ovn-base-dpdk image | ||
id: build | ||
if: steps.check.outputs.buildx == 1 | ||
build-kube-ovn-dpdk-base: | ||
name: Build kube-ovn-dpdk-base | ||
runs-on: ubuntu-22.04 | ||
outputs: | ||
build-dpdk-base: ${{ steps.check.outputs.build-dpdk-base }} | ||
steps: | ||
- uses: jlumbroso/[email protected] | ||
with: | ||
android: true | ||
dotnet: true | ||
haskell: true | ||
docker-images: false | ||
large-packages: false | ||
tool-cache: false | ||
swap-storage: false | ||
|
||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 2 | ||
|
||
- id: check | ||
run: | | ||
if [ ${{ github.event_name }} != 'pull_request' ]; then | ||
exit | ||
fi | ||
if git diff --name-only HEAD^ HEAD | grep -q ^dist/images/Dockerfile.base-dpdk$; then | ||
make base-amd64-dpdk | ||
echo build-base-dpdk=1 >> "$GITHUB_OUTPUT" | ||
echo build-dpdk-base=1 >> "$GITHUB_OUTPUT" | ||
fi | ||
- name: Upload base-dpdk images to artifact | ||
if: steps.build.outputs.build-base-dpdk == 1 | ||
- uses: docker/setup-buildx-action@v3 | ||
if: steps.check.outputs.build-dpdk-base == 1 | ||
|
||
- name: Build kube-ovn-dpdk-base image | ||
id: build | ||
if: steps.check.outputs.build-dpdk-base == 1 | ||
run: | | ||
make base-amd64-dpdk | ||
make base-tar-amd64-dpdk | ||
- name: Upload dpdk base images to artifact | ||
if: steps.check.outputs.build-dpdk-base == 1 | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: kube-ovn-base-dpdk | ||
|
@@ -86,7 +113,9 @@ jobs: | |
build-kube-ovn: | ||
name: Build kube-ovn | ||
runs-on: ubuntu-22.04 | ||
needs: build-kube-ovn-base | ||
needs: | ||
- build-kube-ovn-base | ||
- build-kube-ovn-dpdk-base | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: docker/setup-buildx-action@v2 | ||
|
@@ -152,19 +181,36 @@ jobs: | |
TAG=$(cat VERSION) | ||
docker tag kubeovn/kube-ovn-base:$TAG-amd64 kubeovn/kube-ovn-base:$TAG | ||
docker tag kubeovn/kube-ovn-base:$TAG-debug-amd64 kubeovn/kube-ovn-base:$TAG-debug | ||
docker tag kubeovn/kube-ovn-base:$TAG-amd64-dpdk kubeovn/kube-ovn-base:$TAG-dpdk | ||
make build-kube-ovn | ||
else | ||
make image-kube-ovn | ||
fi | ||
make tar-kube-ovn | ||
- name: Build dpdk | ||
run: | | ||
if [ ${{ needs.build-kube-ovn-dpdk-base.outputs.build-dpdk-base || 0 }} = 1 ]; then | ||
TAG=$(cat VERSION) | ||
docker tag kubeovn/kube-ovn-base:$TAG-amd64-dpdk kubeovn/kube-ovn-base:$TAG-dpdk | ||
make build-kube-ovn-dpdk | ||
else | ||
make image-kube-ovn-dpdk | ||
fi | ||
make tar-kube-ovn-dpdk | ||
- name: Upload images to artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: kube-ovn | ||
path: kube-ovn.tar | ||
|
||
- name: Upload dpdk images to artifact | ||
uses: actions/upload-artifact@v3 | ||
if: github.event_name != 'pull_request' | ||
with: | ||
name: kube-ovn-dpdk | ||
path: kube-ovn-dpdk.tar | ||
|
||
build-vpc-nat-gateway: | ||
name: Build vpc-nat-gateway | ||
runs-on: ubuntu-22.04 | ||
|
@@ -2099,6 +2145,12 @@ jobs: | |
with: | ||
name: kube-ovn | ||
|
||
- name: Download kube-ovn-dpdk image | ||
uses: actions/download-artifact@v3 | ||
if: github.event_name != 'pull_request' | ||
with: | ||
name: kube-ovn-dpdk | ||
|
||
- name: Download vpc-nat-gateway image | ||
uses: actions/download-artifact@v3 | ||
with: | ||
|
@@ -2120,6 +2172,9 @@ jobs: | |
docker load --input vpc-nat-gateway.tar | ||
docker load --input centos7-compile.tar | ||
# docker load --input centos8-compile.tar | ||
if [ '${{ github.event_name }}' != 'pull_request' ]; then | ||
docker load --input kube-ovn-dpdk.tar | ||
fi | ||
- name: Security Scan | ||
run: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.