-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Update build tools and workflows
- Loading branch information
Showing
8 changed files
with
110 additions
and
184 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 |
---|---|---|
@@ -1,35 +1,64 @@ | ||
name: Release | ||
name: Create a Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
release: | ||
if: contains(github.ref, 'refs/tags/') | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Login to UHub | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: uhub.service.ucloud.cn | ||
username: ${{ secrets.UHUB_USER }} | ||
password: ${{ secrets.UHUB_PASSWORD }} | ||
|
||
- name: Get the version | ||
id: get_version | ||
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3 | sed -e "s/^v//") | ||
|
||
- name: Set up go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.19.5 | ||
go-version: 1.20.5 | ||
|
||
- name: Build cnivpc | ||
run: DEPLOY=true make cnivpc | ||
|
||
- name: Build CNI | ||
run: make build | ||
- name: Build ipamd | ||
run: DEPLOY=true make ipamd | ||
|
||
- name: Build ipamctl | ||
run: make build-ipamctl | ||
- name: Build vip-controller | ||
run: DEPLOY=true make vip-controller | ||
|
||
- name: Pack | ||
run: zip -r cnivpc.zip ./bin LLICENSE | ||
- name: Package cni | ||
run: > | ||
tar -cv | ||
LICENSE README.md | ||
-C bin/ cnivpc cnivpctl | ||
-C config/ 10-cnivpc.conf | ||
| gzip --best | ||
> 'uk8s-cni-vpc_v${{ steps.get_version.outputs.VERSION }}.tar.gz' | ||
- name: Create release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
token: ${{ secrets.RELEASE_GITHUB_TOKEN }} | ||
draft: true | ||
body: | | ||
## Docker Images | ||
- uhub.service.ucloud.cn/uk8s/cni-vpc-node:${{ steps.get_version.outputs.VERSION }} | ||
- uhub.service.ucloud.cn/uk8s/cni-vpc-ipamd:${{ steps.get_version.outputs.VERSION }} | ||
- uhub.service.ucloud.cn/uk8s/vip-controller:${{ steps.get_version.outputs.VERSION }} | ||
files: | | ||
cnivpc.zip | ||
*.tar.gz |
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.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,21 +1,8 @@ | ||
FROM uhub.service.ucloud.cn/wxyz/cni-vpc-base:1.19.4 AS builder | ||
FROM alpine:latest | ||
|
||
WORKDIR /go/src/cni-vpc-uk8s | ||
COPY bin/cnivpc /usr/local/bin/ | ||
COPY bin/cnivpctl /usr/local/bin/ | ||
COPY scripts/cnivpc-docker-entrypoint.sh /entrypoint.sh | ||
COPY config/10-cnivpc.conf /10-cnivpc.conf | ||
|
||
# Configure build with Go modules | ||
ENV GO111MODULE=on | ||
ENV GOPROXY=direct | ||
|
||
COPY . ./ | ||
RUN make build-cni | ||
|
||
FROM uhub.service.ucloud.cn/wxyz/cnivpc-plugin-basic:1.0 | ||
|
||
RUN mkdir -p /app | ||
RUN mkdir -p /app/cni/bin | ||
RUN mkdir -p /app/cni/net.d | ||
|
||
COPY --from=builder /go/src/cni-vpc-uk8s/bin/cnivpc /app/cni/bin/cnivpc | ||
COPY config/10-cnivpc.conf /app/cni/net.d | ||
|
||
ENTRYPOINT [ "" ] | ||
ENTRYPOINT [ "/entrypoint.sh" ] |
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 |
---|---|---|
@@ -1,23 +1,5 @@ | ||
FROM uhub.service.ucloud.cn/wxyz/cni-vpc-base:1.19.4 AS builder | ||
FROM alpine:latest | ||
|
||
WORKDIR /go/src/cni-vpc-uk8s | ||
|
||
# Configure build with Go modules | ||
ENV GO111MODULE=on | ||
ENV GOPROXY=direct | ||
|
||
COPY . ./ | ||
RUN make build-ipamd | ||
RUN make build-cni | ||
|
||
FROM centos:7.7.1908 | ||
|
||
RUN mkdir -p /app/ | ||
RUN mkdir -p /opt/cni/bin/ | ||
RUN mkdir -p /opt/cni/net.d/ | ||
|
||
COPY --from=builder /go/src/cni-vpc-uk8s/bin/cnivpc-ipamd /usr/local/bin/ | ||
COPY --from=builder /go/src/cni-vpc-uk8s/bin/cnivpc /app/ | ||
COPY config/10-cnivpc.conf /app/10-cnivpc.conf | ||
COPY bin/cnivpc-ipamd /usr/local/bin/ | ||
|
||
ENTRYPOINT [ "/usr/local/bin/cnivpc-ipamd" ] |
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 |
---|---|---|
@@ -1,16 +1,5 @@ | ||
FROM uhub.service.ucloud.cn/wxyz/cni-vpc-base:1.19.4 AS builder | ||
FROM alpine:latest | ||
|
||
WORKDIR /go/src/cni-vpc-uk8s | ||
|
||
# Configure build with Go modules | ||
ENV GO111MODULE=on | ||
ENV GOPROXY=direct | ||
|
||
COPY . ./ | ||
RUN make build-vip-controller | ||
|
||
FROM centos:7.7.1908 | ||
|
||
COPY --from=builder /go/src/cni-vpc-uk8s/bin/vip-controller /usr/local/bin/ | ||
COPY bin/vip-controller /usr/local/bin/ | ||
|
||
ENTRYPOINT [ "/usr/local/bin/vip-controller" ] |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/sh | ||
|
||
if [[ -d /opt/cni ]]; then | ||
cp -f /usr/local/bin/cnivpc /opt/cni/bin/cnivpc | ||
# cp -f /10-cnivpc.conf /opt/cni/net.d/10-cnivpc.conf | ||
fi | ||
|
||
if [[ -d /host-bin ]]; then | ||
cp -f /usr/local/bin/cnivpctl /host-bin/cnivpctl | ||
fi | ||
|
||
while true; do | ||
if [[ ! -f "/var/log/cnivpc.log" ]]; then | ||
echo "waitting for cnivpc logs..." | ||
sleep 3 | ||
continue | ||
fi | ||
tail -f /var/log/cnivpc.log | ||
done |