Skip to content

Commit

Permalink
fix: CICD pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
mc256 committed Nov 10, 2022
1 parent 9124455 commit bef460d
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 44 deletions.
2 changes: 0 additions & 2 deletions .github/.helper/.dockerignore

This file was deleted.

2 changes: 0 additions & 2 deletions .github/.helper/.gitignore

This file was deleted.

13 changes: 0 additions & 13 deletions .github/.helper/Dockerfile

This file was deleted.

20 changes: 0 additions & 20 deletions .github/.helper/app.py

This file was deleted.

1 change: 0 additions & 1 deletion .github/.helper/requirements.txt

This file was deleted.

3 changes: 1 addition & 2 deletions .github/workflows/debian-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ jobs:
curl -fsSL https://get.docker.com -o /tmp/get-docker.sh
sh /tmp/get-docker.sh
docker run --privileged --rm tonistiigi/binfmt --install all
docker build -t helper:latest -f ./.github/.helper/Dockerfile ./.github/.helper/
docker run -d --hostname helper --expose 8080 --name helper -v "$(pwd)"/sandbox:/app/upload:rw helper:latest
docker run -d --hostname helper --expose 8080 --name helper -v "$(pwd)"/sandbox:/app/upload:rw harbor.yuri.moe/public/helper:latest
export UPLOAD_URL=http://`docker inspect helper | grep "IPAddress" | grep -o -E '[0-9.]+' | head -n 1`:8080/
make docker-buildx-multi-arch
- name: Release
Expand Down
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -131,17 +131,17 @@ create-deb-package.arm64: change-version-number set-production build-starlight-d
.PHONY: upload-deb-package.amd64
upload-deb-package.amd64:
curl --form uploadfile='@./sandbox/starlight-snapshotter_$(VERSIONNUMBER)_amd64.deb' $(UPLOAD_URL)
curl -X POST -u $(APT_UPLOAD_AUTH) -F starlight-snapshotter_$(VERSIONNUMBER)_amd64.deb='@./sandbox/starlight-snapshotter_$(VERSIONNUMBER)_amd64.deb' https://repo.yuri.moe/api/files/starlight-snapshotter
#curl -X POST -u $(APT_UPLOAD_AUTH) -F starlight-snapshotter_$(VERSIONNUMBER)_amd64.deb='@./sandbox/starlight-snapshotter_$(VERSIONNUMBER)_amd64.deb' https://repo.yuri.moe/api/files/starlight-snapshotter

.PHONY: upload-deb-package.armv6l
upload-deb-package.armv6l:
curl --form uploadfile='@./sandbox/starlight-snapshotter_$(VERSIONNUMBER)_armhf.deb' $(UPLOAD_URL)
curl -X POST -u $(APT_UPLOAD_AUTH) -F starlight-snapshotter_$(VERSIONNUMBER)_armhf.deb='@./sandbox/starlight-snapshotter_$(VERSIONNUMBER)_armhf.deb' https://repo.yuri.moe/api/files/starlight-snapshotter
#curl -X POST -u $(APT_UPLOAD_AUTH) -F starlight-snapshotter_$(VERSIONNUMBER)_armhf.deb='@./sandbox/starlight-snapshotter_$(VERSIONNUMBER)_armhf.deb' https://repo.yuri.moe/api/files/starlight-snapshotter

.PHONY: upload-deb-package.amd64
upload-deb-package.arm64:
curl --form uploadfile='@./sandbox/starlight-snapshotter_$(VERSIONNUMBER)_arm64.deb' $(UPLOAD_URL)
curl -X POST -u $(APT_UPLOAD_AUTH) -F starlight-snapshotter_$(VERSIONNUMBER)_arm64.deb='@./sandbox/starlight-snapshotter_$(VERSIONNUMBER)_arm64.deb' https://repo.yuri.moe/api/files/starlight-snapshotter
#curl -X POST -u $(APT_UPLOAD_AUTH) -F starlight-snapshotter_$(VERSIONNUMBER)_arm64.deb='@./sandbox/starlight-snapshotter_$(VERSIONNUMBER)_arm64.deb' https://repo.yuri.moe/api/files/starlight-snapshotter

######################################################################
.PHONY: docker-buildx-multi-arch
Expand All @@ -151,18 +151,21 @@ docker-buildx-multi-arch:
--build-arg ARCH=amd64 \
--build-arg UPLOAD_URL=$(UPLOAD_URL) \
--build-arg APT_UPLOAD_AUTH=$(APT_UPLOAD_AUTH) \
--network=host \
-f ./demo/deb-package/Dockerfile .
docker buildx build \
--platform linux/arm/v7 \
--build-arg ARCH=armv6l \
--build-arg UPLOAD_URL=$(UPLOAD_URL) \
--build-arg APT_UPLOAD_AUTH=$(APT_UPLOAD_AUTH) \
--network=host \
-f ./demo/deb-package/Dockerfile .
docker buildx build \
--platform linux/arm64/v8 \
--build-arg ARCH=arm64 \
--build-arg UPLOAD_URL=$(UPLOAD_URL) \
--build-arg APT_UPLOAD_AUTH=$(APT_UPLOAD_AUTH) \
--network=host \
-f ./demo/deb-package/Dockerfile .

######################################################################
Expand Down
2 changes: 1 addition & 1 deletion demo/deb-package/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC

RUN apt update -y && apt upgrade -y
RUN apt install -y tzdata curl wget git dpkg-dev gpg build-essential debhelper
RUN apt install -y tzdata curl wget git dpkg-dev gpg build-essential debhelper bind9-utils
RUN wget -q https://go.dev/dl/go1.18.4.linux-$ARCH.tar.gz && rm -rf /usr/local/go && tar -C /usr/local -xzf go1.18.4.linux-$ARCH.tar.gz
COPY . .
RUN ARCH=$ARCH && make create-deb-package.$ARCH upload-deb-package.$ARCH

0 comments on commit bef460d

Please sign in to comment.