Skip to content

Commit

Permalink
Merge pull request #34 from smoser/feature/allow-mos-zot-env
Browse files Browse the repository at this point in the history
Allow MOSCTL_BINARY and ZOT_BINARY to be read from the environment.
  • Loading branch information
hallyn committed Jul 18, 2023
2 parents c9b5115 + 4dcbc77 commit a21a607
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
23 changes: 17 additions & 6 deletions layers/mos/stacker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ mos-build:
type: built
tag: build-krd
import:
- ${{MOSCTL_BINARY:https://github.com/project-machine/mos/releases/download/0.0.9/mosctl}}
- ${{ZOT_BINARY:https://github.com/project-zot/zot/releases/download/v1.4.3/zot-linux-amd64-minimal}}
- path: ${{MOSCTL_BINARY}}
dest: /imports/mosctl/
- path: ${{ZOT_BINARY}}
dest: /imports/zot/
- zot-config.json
run: |
d=$(mktemp -d)
Expand All @@ -23,10 +25,19 @@ mos-build:
cp /stacker/zot-config.json "$workd/etc/"
mkdir -p "$workd/usr/bin"
for bin in mosctl:mosctl zot-linux-amd64-minimal:zot ; do
t=$workd/usr/bin/${bin#*:}
cp -v /stacker/${bin%:*} $t
chmod 755 $t
# working around https://github.com/project-stacker/stacker/issues/456
for bin in mosctl zot; do
t="$workd/usr/bin/$bin"
src=$(echo /imports/$bin/*)
[ -f "$src" ] || {
echo "import for $bin: was not a file"
echo "glob resolved to: $src"
echo "/imports/$bin/ has:"
ls -l /imports/$bin/
}
cp -v "$src" "$t"
chmod 755 "$t"
done
# dracut-install will pick up all the deps for these binaries
Expand Down
6 changes: 5 additions & 1 deletion subs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@ KEYSET ?= snakeoil
DOCKER_BASE ?= docker://
UBUNTU_MIRROR ?= http://archive.ubuntu.com/ubuntu
KEYSET_D ?= $(HOME)/.local/share/machine/trust/keys/$(KEYSET)
MOSCTL_BINARY ?= https://github.com/project-machine/mos/releases/download/0.0.9/mosctl
ZOT_BINARY ?= https://github.com/project-zot/zot/releases/download/v1.4.3/zot-linux-amd64-minimal

STACKER_SUBS = \
--substitute=KEYSET_D=$(KEYSET_D) \
--substitute=DOCKER_BASE=$(DOCKER_BASE) \
--substitute=UBUNTU_MIRROR=$(UBUNTU_MIRROR) \
--substitute=HOME=$(HOME) \
--substitute=KEYS_DIR=$(HOME)/.local/share/machine/trust/keys \
--substitute=TOP_D=$(TOP_D)
--substitute=TOP_D=$(TOP_D) \
--substitute=MOSCTL_BINARY=$(MOSCTL_BINARY) \
--substitute=ZOT_BINARY=$(ZOT_BINARY)

0 comments on commit a21a607

Please sign in to comment.