|
7 | 7 | types: [published]
|
8 | 8 |
|
9 | 9 | jobs:
|
10 |
| - build-coredns: |
11 |
| - strategy: |
12 |
| - matrix: |
13 |
| - arch: [amd64, arm64] |
14 |
| - runs-on: ${{ fromJson('{"amd64":"ubuntu-latest", "arm64":["self-hosted", "Linux", "ARM64"]}')[matrix.arch] }} |
15 |
| - |
16 |
| - container: |
17 |
| - image: golang:1.13 |
18 |
| - |
19 |
| - steps: |
20 |
| - - name: Clone CoreDNS |
21 |
| - run: | |
22 |
| - apt update -y && apt install git make -y |
23 |
| -
|
24 |
| - git clone https://github.com/coredns/coredns.git . |
25 |
| - git checkout 7d5f5b87a4fb310d442f7ef0d52e3fead0e10d39 |
26 |
| - sed -i 's/stable/buster/g' Dockerfile |
27 |
| -
|
28 |
| - - uses: actions/checkout@v3 |
29 |
| - with: |
30 |
| - path: 'plugin/k8s_dns_chaos' |
31 |
| - |
32 |
| - - name: Build Chaos CoreDNS |
33 |
| - run: | |
34 |
| - echo "k8s_dns_chaos:github.com/chaos-mesh/k8s_dns_chaos" >> plugin.cfg |
35 |
| - # TODO: replace with the local repo, not stuck with a certain commit |
36 |
| - go mod edit -require github.com/chaos-mesh/k8s_dns_chaos@649fd5298a454eb59b6080fd670e7f7ea1f5b1b4 |
37 |
| - SWAGGER=1 UI=1 make coredns |
38 |
| -
|
39 |
| - - name: upload coredns binary |
40 |
| - uses: actions/upload-artifact@v2 |
41 |
| - with: |
42 |
| - name: coredns-${{ matrix.arch }} |
43 |
| - path: coredns |
44 |
| - retention-days: 7 |
45 |
| - |
46 | 10 | build-docker-image:
|
47 | 11 | strategy:
|
48 | 12 | matrix:
|
@@ -70,29 +34,12 @@ jobs:
|
70 | 34 | username: ${{ github.actor }}
|
71 | 35 | password: ${{ secrets.GITHUB_TOKEN }}
|
72 | 36 |
|
73 |
| - - name: Clone CoreDNS |
74 |
| - run: | |
75 |
| - apt update -y && apt install git make -y |
76 |
| -
|
77 |
| - git clone https://github.com/coredns/coredns.git . |
78 |
| - git checkout 7d5f5b87a4fb310d442f7ef0d52e3fead0e10d39 |
79 |
| - sed -i 's/stable/buster/g' Dockerfile |
80 |
| -
|
81 |
| - - name: Download coredns binary |
82 |
| - uses: actions/download-artifact@v2 |
83 |
| - with: |
84 |
| - name: coredns-${{ matrix.arch }} |
85 |
| - path: coredns-artifacts |
86 |
| - |
87 | 37 | - name: Build Chaos CoreDNS Image
|
88 | 38 | env:
|
89 | 39 | IMAGE_TAG: ${{ steps.image_tag.outputs.image_tag }}
|
90 | 40 | ARCH: ${{ matrix.arch }}
|
91 | 41 | GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }}
|
92 | 42 | run: |
|
93 |
| - # permissions would be lost after transfer by github artifacts, see: https://github.com/chaos-mesh/k8s_dns_chaos/issues/20 |
94 |
| - chmod +x coredns-artifacts/coredns |
95 |
| - mv coredns-artifacts/coredns coredns |
96 | 43 | docker build -t ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/chaos-coredns:$IMAGE_TAG-$ARCH .
|
97 | 44 |
|
98 | 45 | - name: Upload Chaos CoreDNS
|
|
0 commit comments