Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove tools/, install schematyper on demand #3093

Merged
merged 1 commit into from
Sep 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ maipo/
*.pyo
*.shellchecked
.coverage
tools/bin
.idea
bin/
9 changes: 2 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ DESTDIR ?=
# W504 line break after binary operator
PYIGNORE ?= E128,E241,E402,E501,E722,W503,W504

.PHONY: all check shellcheck flake8 pycheck unittest clean mantle mantle-check install tools
.PHONY: all check shellcheck flake8 pycheck unittest clean mantle mantle-check install

MANTLE_BINARIES := ore kola plume

all: bin/coreos-assembler tools mantle
all: bin/coreos-assembler mantle

src:=$(shell find src -maxdepth 1 -type f -executable -print)
pysources=$(shell find src -type f -name '*.py') $(shell for x in $(src); do if head -1 $$x | grep -q python; then echo $$x; fi; done)
Expand Down Expand Up @@ -64,7 +64,6 @@ cosa-go-check:

clean:
rm -f ${src_checked} ${tests_checked} ${cwd_checked}
rm -rf tools/bin
find . -name "*.py[co]" -type f | xargs rm -f
find . -name "__pycache__" -type d | xargs rm -rf

Expand All @@ -78,9 +77,6 @@ $(MANTLE_BINARIES) kolet:
mantle-check:
cd mantle && $(MAKE) test

tools:
cd tools && $(MAKE)

.PHONY: schema
schema:
$(MAKE) -C schema
Expand Down Expand Up @@ -113,5 +109,4 @@ install:
ln -sf ../lib/coreos-assembler/cp-reflink $(DESTDIR)$(PREFIX)/bin/
ln -sf coreos-assembler $(DESTDIR)$(PREFIX)/bin/cosa
install -d $(DESTDIR)$(PREFIX)/lib/coreos-assembler/tests/kola
cd tools && $(MAKE) install DESTDIR=$(DESTDIR)
cd mantle && $(MAKE) install DESTDIR=$(DESTDIR)
2 changes: 1 addition & 1 deletion gangplank/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = $(shell cd .. && git log -n 1 --date=short --pretty=format:%cs.%h~${st
cosa_dir = $(shell test -d /usr/lib/coreos-assembler && echo /usr/lib/coreos-assembler)
ldflags=-X main.version=${version} -X main.cosaDir=${cosa_dir}
buildtags=containers_image_openpgp
export PATH := $(my_dir)/bin:$(shell readlink -f ../tools/bin):$(PATH)
export PATH := $(my_dir)/bin:$(PATH)

PREFIX ?= /usr
DESTDIR ?=
Expand Down
19 changes: 16 additions & 3 deletions schema/generate-schema.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/bash -xe
#!/bin/bash
set -euo pipefail
topdir=$(git rev-parse --show-toplevel)
mydir=$(dirname $(readlink -f $0))
tdir="${mydir}/tmp"
mkdir -p "${tdir}"
Expand All @@ -11,8 +13,19 @@ echo "Generating COSA Schema ${schema_version}"

out="${tdir}/cosa_${schema_version}.go"

"schematyper" \
"${schema_version}.json" \
schematyper=
if test -f ${topdir}/bin/schematyper; then
schematyper=${topdir}/bin/schematyper
else
schematyper=$(which schematyper 2>/dev/null || true)
fi
if test -z "${schematyper}"; then
env GOBIN=${topdir}/bin go install github.com/idubinskiy/schematyper@latest
schematyper=${topdir}/bin/schematyper
fi

${schematyper} \
${topdir}/src/"${schema_version}.json" \
-o "${out}" \
--package="builds" \
--root-type=Build \
Expand Down
20 changes: 0 additions & 20 deletions tools/Makefile

This file was deleted.

6 changes: 0 additions & 6 deletions tools/README.md

This file was deleted.