test
This commit is contained in:
5
Jenkinsfile
vendored
5
Jenkinsfile
vendored
@@ -4,7 +4,6 @@ pipeline {
|
||||
parameters {
|
||||
booleanParam(name: 'BUILD_ALL_PROFILES', defaultValue: true, description: 'Build all profiles one by one')
|
||||
string(name: 'PROFILE', defaultValue: 'demo', description: 'Profile to build when BUILD_ALL_PROFILES is false')
|
||||
booleanParam(name: 'FAKE_LEGACY', defaultValue: false, description: 'Use fake lh_config/lh_build wrappers')
|
||||
booleanParam(name: 'KEEP_CONTAINERS', defaultValue: false, description: 'Stop at end but do not remove runtime containers')
|
||||
}
|
||||
|
||||
@@ -22,10 +21,6 @@ pipeline {
|
||||
CMD="$CMD --profile $PROFILE"
|
||||
fi
|
||||
|
||||
if [ "$FAKE_LEGACY" = "true" ]; then
|
||||
CMD="$CMD --fake-legacy"
|
||||
fi
|
||||
|
||||
if [ "$KEEP_CONTAINERS" = "true" ]; then
|
||||
CMD="$CMD --keep-containers"
|
||||
fi
|
||||
|
||||
@@ -20,15 +20,3 @@ load_env_file() {
|
||||
. "$ENV_FILE"
|
||||
set +a
|
||||
}
|
||||
|
||||
maybe_fake_legacy() {
|
||||
TOOL_NAME="$1"
|
||||
if command -v "$TOOL_NAME" >/dev/null 2>&1; then
|
||||
return 1
|
||||
fi
|
||||
if [ "${RETRODEBIAN_FAKE_LEGACY_TOOLS:-1}" = "1" ]; then
|
||||
echo "[fake-legacy] $TOOL_NAME not found, emulating." >&2
|
||||
return 0
|
||||
fi
|
||||
fail "$TOOL_NAME not found and RETRODEBIAN_FAKE_LEGACY_TOOLS != 1"
|
||||
}
|
||||
|
||||
@@ -12,11 +12,4 @@ load_env_file "$ENV_FILE"
|
||||
[ -n "${PROFILE_ARTIFACT_DIR:-}" ] || fail "PROFILE_ARTIFACT_DIR is required"
|
||||
mkdir -p "$PROFILE_ARTIFACT_DIR/final"
|
||||
|
||||
if maybe_fake_legacy lh_build; then
|
||||
OUTPUT_FILE="$PROFILE_ARTIFACT_DIR/final/${PROFILE_NAME:-profile}.iso"
|
||||
printf 'fake iso for %s
|
||||
' "${PROFILE_NAME:-unknown}" > "$OUTPUT_FILE"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
exec lh_build "$LIVE_DIR"
|
||||
|
||||
@@ -11,11 +11,4 @@ load_env_file "$ENV_FILE"
|
||||
[ -n "${LIVE_DIR:-}" ] || fail "LIVE_DIR is required"
|
||||
mkdir -p "$LIVE_DIR"
|
||||
|
||||
if maybe_fake_legacy lh_config; then
|
||||
mkdir -p "$LIVE_DIR/.fake-live-helper"
|
||||
printf 'fake lh_config for %s
|
||||
' "${PROFILE_NAME:-unknown}" > "$LIVE_DIR/.fake-live-helper/lh_config.txt"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
exec lh_config "$LIVE_DIR"
|
||||
|
||||
6
builder/docker/live-helper/Dockerfile
Normal file
6
builder/docker/live-helper/Dockerfile
Normal file
@@ -0,0 +1,6 @@
|
||||
FROM lpenz/debian-lenny-i386-minbase
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
ARG ARCH=i386
|
||||
RUN apt-get update && \
|
||||
apt-get -y --force-yes install live-helper genisoimage syslinux squashfs-tools aptitude && \
|
||||
apt-get clean
|
||||
2
builder/docker/orchestrator/Dockerfile
Normal file
2
builder/docker/orchestrator/Dockerfile
Normal file
@@ -0,0 +1,2 @@
|
||||
FROM python:3.14-alpine
|
||||
RUN apk add --no-cache git ca-certificates
|
||||
12
builder/docker/package-builder/Dockerfile
Normal file
12
builder/docker/package-builder/Dockerfile
Normal file
@@ -0,0 +1,12 @@
|
||||
# building a modified Kernel + modules
|
||||
FROM lpenz/debian-etch-i386-minbase
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
ARG ARCH=i386
|
||||
ARG CONCURRENCY_LEVEL=4
|
||||
|
||||
# Preparing Environment
|
||||
RUN (echo "deb http://archive.debian.org/debian etch main contrib non-free" > /etc/apt/sources.list) && \
|
||||
(echo "deb-src http://archive.debian.org/debian etch main contrib non-free" >> /etc/apt/sources.list) && \
|
||||
mkdir -p /usr/src/modules &&\
|
||||
apt-get update && \
|
||||
apt-get install -y aptitude build-essential quilt cvs unzip git-core ncurses-dev
|
||||
@@ -100,7 +100,6 @@ def export_env(args: argparse.Namespace) -> int:
|
||||
root = root_dir()
|
||||
ctx = build_context(root, args.phase, args.kind, args.profile or '', args.base or '', args.feature or '')
|
||||
values = ctx.to_env()
|
||||
values['RETRODEBIAN_FAKE_LEGACY_TOOLS'] = os.environ.get('RETRODEBIAN_FAKE_LEGACY_TOOLS', '1')
|
||||
write_env_file(Path(args.output), values)
|
||||
return 0
|
||||
|
||||
@@ -214,9 +213,8 @@ def _env_and_path(root: Path, kind: str, phase: str, profile: str, base: str = '
|
||||
ctx = build_context(root, phase, kind, profile, base, feature)
|
||||
values = os.environ.copy()
|
||||
values.update(ctx.to_env())
|
||||
values['RETRODEBIAN_FAKE_LEGACY_TOOLS'] = values.get('RETRODEBIAN_FAKE_LEGACY_TOOLS', '1')
|
||||
env_path = profile_artifacts_dir(root, profile) / 'runtime' / f'{kind}-{ctx.current_name}-{phase}.env'
|
||||
write_env_file(env_path, {k: str(v) for k, v in values.items() if k in ctx.to_env() or k == 'RETRODEBIAN_FAKE_LEGACY_TOOLS'})
|
||||
write_env_file(env_path, {k: str(v) for k, v in values.items() if k in ctx.to_env()})
|
||||
return values, env_path
|
||||
|
||||
|
||||
|
||||
@@ -130,15 +130,13 @@ class Orchestrator:
|
||||
builder: RuntimeSpec,
|
||||
etch: RuntimeSpec,
|
||||
lenny: RuntimeSpec,
|
||||
fake_legacy: bool = False,
|
||||
keep_containers: bool = False,
|
||||
) -> None:
|
||||
self.root = root
|
||||
self.fake_legacy = fake_legacy
|
||||
self.keep_containers = keep_containers
|
||||
|
||||
self.builder = Runtime(root, 'builder', self._resolve_image('builder-alpine', builder))
|
||||
self.etch = Runtime(root, 'etch', self._resolve_image('package-builder-etch', etch))
|
||||
self.builder = Runtime(root, 'builder', self._resolve_image('orchestrator', builder))
|
||||
self.etch = Runtime(root, 'etch', self._resolve_image('package-builder', etch))
|
||||
self.lenny = Runtime(root, 'lenny', self._resolve_image('live-helper', lenny))
|
||||
self.defaults = {
|
||||
'python': self.builder,
|
||||
@@ -173,7 +171,7 @@ class Orchestrator:
|
||||
pass
|
||||
|
||||
def builder_env(self) -> dict[str, str]:
|
||||
return {'RETRODEBIAN_FAKE_LEGACY_TOOLS': '1'} if self.fake_legacy else {}
|
||||
return {}
|
||||
|
||||
def context(self, phase: str, kind: str, *, profile: str = '', base: str = '', feature: str = '') -> BuildContext:
|
||||
profile_spec = load_profile(self.root, profile) if profile else None
|
||||
@@ -203,8 +201,6 @@ class Orchestrator:
|
||||
|
||||
def write_phase_env(self, phase: str, kind: str, output: Path, *, profile: str = '', base: str = '', feature: str = '') -> None:
|
||||
values = self.context(phase, kind, profile=profile, base=base, feature=feature).to_env()
|
||||
if self.fake_legacy:
|
||||
values['RETRODEBIAN_FAKE_LEGACY_TOOLS'] = '1'
|
||||
write_env_file(output, values)
|
||||
|
||||
def python_phase(self, runtime: Runtime, phase: str, kind: str, *, profile: str = '', base: str = '', feature: str = '') -> None:
|
||||
@@ -358,7 +354,6 @@ def parser() -> argparse.ArgumentParser:
|
||||
run_p.add_argument('--lenny-image', default='')
|
||||
run_p.add_argument('--lenny-dockerfile', default='builder/docker/live-helper/Dockerfile')
|
||||
run_p.add_argument('--lenny-context', default='.')
|
||||
run_p.add_argument('--fake-legacy', action='store_true')
|
||||
run_p.add_argument('--keep-containers', action='store_true')
|
||||
return p
|
||||
|
||||
@@ -372,7 +367,6 @@ def main() -> int:
|
||||
builder=RuntimeSpec(args.builder_image, args.builder_dockerfile, args.builder_context),
|
||||
etch=RuntimeSpec(args.etch_image, args.etch_dockerfile, args.etch_context),
|
||||
lenny=RuntimeSpec(args.lenny_image, args.lenny_dockerfile, args.lenny_context),
|
||||
fake_legacy=args.fake_legacy,
|
||||
keep_containers=args.keep_containers,
|
||||
)
|
||||
orch.run(profile_names=profiles)
|
||||
|
||||
Reference in New Issue
Block a user