|
8 | 8 | - network-operator-*
|
9 | 9 |
|
10 | 10 | 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 |
| - |
75 | 11 | update_network_operator_values:
|
76 |
| -# needs: |
77 |
| -# - determine_docker_registry_and_tag |
78 |
| -# - build_and_push_images |
79 | 12 | runs-on: ubuntu-latest
|
80 | 13 | 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 |
84 | 16 | steps:
|
85 | 17 | - uses: actions/checkout@v4
|
86 | 18 | with:
|
87 |
| -# token: ${{ secrets.GH_TOKEN_NVIDIA_CI_CD }} |
| 19 | + path: sriov-network-operator-fork |
| 20 | + - uses: actions/checkout@v4 |
| 21 | + with: |
88 | 22 | repository: ${{ github.repository_owner }}/network-operator
|
| 23 | + path: network-opertor-fork |
89 | 24 | - name: Determine base branch
|
90 | 25 | run: |
|
91 | 26 | echo "BASE_BRANCH=${{ contains(env.DOCKER_TAG, 'beta') && 'master' || env.DOCKER_TAG }}" >> $GITHUB_ENV
|
92 | 27 | - name: Create PR to update image tags in network-operator values
|
93 | 28 | 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 | +
|
95 | 37 | git config user.name nvidia-ci-cd
|
96 | 38 | git config user.email [email protected]
|
97 | 39 |
|
98 | 40 | 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 | + |
99 | 44 | yq -i e '.SriovNetworkOperator.repository |= "${{ env.DOCKER_REGISTRY }}"' hack/release.yaml
|
100 | 45 | yq -i e '.SriovNetworkOperator.version |= "${{ env.DOCKER_TAG }}"' hack/release.yaml
|
101 | 46 | make release-build
|
102 | 47 |
|
103 | 48 | if ! git diff --color --unified=0 --exit-code; then
|
| 49 | + git add deployment/network-operator/charts/sriov-network-operator |
104 | 50 | git commit -sam "task: update SR-IOV images tags to $DOCKER_TAG in chart values"
|
105 | 51 | git push -u origin feature/update-sriov-tags-to-$DOCKER_TAG
|
106 | 52 | gh pr create \
|
|
110 | 56 | --fill \
|
111 | 57 | --body "Created by the *${{ github.job }}* job in [${{ github.repository }} CI](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})."
|
112 | 58 | fi
|
| 59 | +
|
0 commit comments