Skip to content

Commit b4e524b

Browse files
committed
CI test
1 parent c30e2f6 commit b4e524b

File tree

1 file changed

+19
-72
lines changed

1 file changed

+19
-72
lines changed

.github/workflows/fork-ci.yaml

+19-72
Original file line numberDiff line numberDiff line change
@@ -8,99 +8,45 @@ on:
88
- network-operator-*
99

1010
jobs:
11-
# determine_docker_registry_and_tag:
12-
# runs-on: ubuntu-latest
13-
# env:
14-
# REGISTRY_INTERNAL: nvcr.io/nvstaging/mellanox
15-
# REGISTRY_PUBLIC: nvcr.io/nvidia/mellanox
16-
# steps:
17-
# - uses: actions/checkout@v4
18-
# with:
19-
# sparse-checkout: .
20-
# - if: github.ref_type == 'branch'
21-
# name: Determine docker registry and tag (when git branch)
22-
# run: |
23-
# echo DOCKER_REGISTRY=$REGISTRY_INTERNAL >> $GITHUB_ENV
24-
# echo DOCKER_TAG=$(git rev-parse --short HEAD) >> $GITHUB_ENV # short git commit hash
25-
# - if: github.ref_type == 'tag'
26-
# name: Determine docker registry and tag (when git tag)
27-
# run: |
28-
# echo DOCKER_REGISTRY=$(echo ${{ github.ref_name }} | sed 's/network-operator-//' | grep -q '-' && echo $REGISTRY_INTERNAL || echo $REGISTRY_PUBLIC) >> $GITHUB_ENV # use public registry only when release tag has no '-beta*' or '-rc*' suffix
29-
# echo DOCKER_TAG=${{ github.ref_name }} >> $GITHUB_ENV
30-
# - name: Store docker registry and tag for following jobs
31-
# id: store-docker-registry-and-tag
32-
# run: |
33-
# echo DOCKER_REGISTRY=$DOCKER_REGISTRY >> $GITHUB_OUTPUT
34-
# echo DOCKER_TAG=$DOCKER_TAG >> $GITHUB_OUTPUT
35-
# outputs:
36-
# docker_registry: ${{ steps.store-docker-registry-and-tag.outputs.DOCKER_REGISTRY }}
37-
# docker_tag: ${{ steps.store-docker-registry-and-tag.outputs.DOCKER_TAG }}
38-
#
39-
# build_and_push_images:
40-
# needs: determine_docker_registry_and_tag
41-
# runs-on: ubuntu-latest
42-
# env:
43-
# BUILD_PLATFORMS: linux/amd64,linux/arm64,linux/ppc64le
44-
# DOCKER_REGISTRY: ${{ needs.determine_docker_registry_and_tag.outputs.docker_registry }}
45-
# DOCKER_TAG: ${{ needs.determine_docker_registry_and_tag.outputs.docker_tag }}
46-
# strategy:
47-
# matrix:
48-
# include:
49-
# - component: operator
50-
# image_name: ${{ github.event.repository.name }}
51-
# dockerfile: Dockerfile
52-
# - component: config-daemon
53-
# image_name: ${{ github.event.repository.name }}-config-daemon
54-
# dockerfile: Dockerfile.sriov-network-config-daemon
55-
# - component: webhook
56-
# image_name: ${{ github.event.repository.name }}-webhook
57-
# dockerfile: Dockerfile.webhook
58-
# steps:
59-
# - uses: actions/checkout@v4
60-
# - uses: docker/setup-qemu-action@v3
61-
# - uses: docker/setup-buildx-action@v3
62-
# - uses: docker/login-action@v3
63-
# with:
64-
# registry: ${{ env.DOCKER_REGISTRY }}
65-
# username: ${{ secrets.NVCR_USERNAME }}
66-
# password: ${{ secrets.NVCR_TOKEN }}
67-
# - uses: docker/build-push-action@v4
68-
# with:
69-
# platforms: ${{ env.BUILD_PLATFORMS }}
70-
# context: .
71-
# file: ${{ matrix.dockerfile }}
72-
# tags: ${{ env.DOCKER_REGISTRY }}/${{ matrix.image_name }}:${{ env.DOCKER_TAG }}
73-
# push: true
74-
7511
update_network_operator_values:
76-
# needs:
77-
# - determine_docker_registry_and_tag
78-
# - build_and_push_images
7912
runs-on: ubuntu-latest
8013
env:
81-
DOCKER_REGISTRY: ${{ needs.determine_docker_registry_and_tag.outputs.docker_registry }}
82-
DOCKER_TAG: ${{ needs.determine_docker_registry_and_tag.outputs.docker_tag }}
83-
# GH_TOKEN: ${{ secrets.GH_TOKEN_NVIDIA_CI_CD }}
14+
DOCKER_REGISTRY: test-docker_registry
15+
DOCKER_TAG: test-docker_tag
8416
steps:
8517
- uses: actions/checkout@v4
8618
with:
87-
# token: ${{ secrets.GH_TOKEN_NVIDIA_CI_CD }}
19+
path: sriov-network-operator-fork
20+
- uses: actions/checkout@v4
21+
with:
8822
repository: ${{ github.repository_owner }}/network-operator
23+
path: network-opertor-fork
8924
- name: Determine base branch
9025
run: |
9126
echo "BASE_BRANCH=${{ contains(env.DOCKER_TAG, 'beta') && 'master' || env.DOCKER_TAG }}" >> $GITHUB_ENV
9227
- name: Create PR to update image tags in network-operator values
9328
run: |
94-
ls -al ../
29+
echo 0
30+
pwd
31+
echo 1
32+
ls -al
33+
echo 3
34+
ls -al sriov-network-operator-fork/
35+
cd network-opertor-fork
36+
9537
git config user.name nvidia-ci-cd
9638
git config user.email [email protected]
9739
9840
git checkout -b feature/update-sriov-tags-to-$DOCKER_TAG
41+
42+
cp -r ../sriov-network-operator/deployment/sriov-network-operator-chart/* deployment/network-operator/charts/sriov-network-operator/
43+
9944
yq -i e '.SriovNetworkOperator.repository |= "${{ env.DOCKER_REGISTRY }}"' hack/release.yaml
10045
yq -i e '.SriovNetworkOperator.version |= "${{ env.DOCKER_TAG }}"' hack/release.yaml
10146
make release-build
10247
10348
if ! git diff --color --unified=0 --exit-code; then
49+
git add deployment/network-operator/charts/sriov-network-operator
10450
git commit -sam "task: update SR-IOV images tags to $DOCKER_TAG in chart values"
10551
git push -u origin feature/update-sriov-tags-to-$DOCKER_TAG
10652
gh pr create \
@@ -110,3 +56,4 @@ jobs:
11056
--fill \
11157
--body "Created by the *${{ github.job }}* job in [${{ github.repository }} CI](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})."
11258
fi
59+

0 commit comments

Comments
 (0)