Skip to content

Commit 1166e54

Browse files
committed
feat: support overriding the apt repo url during build time
1 parent 43a3771 commit 1166e54

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

Taskfile.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,23 @@ version: "3"
22

33
vars:
44
DOCKERIMG: '{{ default "ghcr.io/octoprint/custopizer:latest" .DOCKERIMG }}'
5+
OCTOPRINT_APT_REPO: '{{ default "" .OCTOPRINT_APT_REPO }}'
56

67
tasks:
78
build:
89
cmds:
910
- |
10-
{{if eq OS "windows"}}powershell {{end}}docker run --rm --privileged -v {{.USER_WORKING_DIR | toSlash}}/workspace:/CustoPiZer/workspace -v {{.USER_WORKING_DIR | toSlash}}/scripts:/CustoPiZer/workspace/scripts {{.DOCKERIMG}}
11+
docker run --rm --privileged -e OCTOPRINT_APT_REPO={{.OCTOPRINT_APT_REPO}} -v {{.USER_WORKING_DIR | toSlash}}/workspace:/CustoPiZer/workspace -v {{.USER_WORKING_DIR | toSlash}}/scripts:/CustoPiZer/workspace/scripts {{.DOCKERIMG}}
1112
preconditions:
1213
- test -d workspace
1314
- test -f workspace/input.img
15+
- lsmod | grep '\bloop\b'
1416

1517
inspect:
1618
cmds:
1719
- |
18-
{{if eq OS "windows"}}powershell {{end}}docker run -it --rm --privileged -v {{.USER_WORKING_DIR | toSlash}}/workspace/output.img:/image.img {{.DOCKERIMG}} /CustoPiZer/enter_image /image.img
20+
docker run -it --rm --privileged -v {{.USER_WORKING_DIR | toSlash}}/workspace/output.img:/image.img {{.DOCKERIMG}} /CustoPiZer/enter_image /image.img
1921
preconditions:
2022
- test -d workspace
2123
- test -f workspace/output.img
24+
- lsmod | grep '\bloop\b'

scripts/01-add-octoprint-apt-repo

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ export LC_ALL=C
66
source /common.sh
77
install_cleanup_trap
88

9-
curl -s --compressed "https://apt.octoprint.org/octoprint.gpg.key" | gpg --dearmor > /etc/apt/trusted.gpg.d/octoprint.gpg
10-
echo "deb https://apt.octoprint.org/debian $(lsb_release -cs) rpi" > /etc/apt/sources.list.d/octoprint-rpi.list
9+
URL=${OCTOPRINT_APT_REPO:-"https://apt.octoprint.org"}
10+
11+
curl -s --compressed "$URL/octoprint.gpg.key" | gpg --dearmor > /etc/apt/trusted.gpg.d/octoprint.gpg
12+
echo "deb $URL/debian $(lsb_release -cs) rpi" > /etc/apt/sources.list.d/octoprint-rpi.list
1113
apt-get update

0 commit comments

Comments
 (0)