mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-08 03:38:23 +00:00
ci(deploy): prevent docker compose builds in GitHub Actions
Switch CI detection to GITHUB_ACTIONS and disable compose builds via INFINITO_NO_BUILD=1. The deploy workflows now rely on pulling the prebuilt CI image instead of triggering local Docker builds. - Remove legacy UP_BUILD handling - Enable --no-build in compose when running in real CI - Keep local/act builds working as before https://chatgpt.com/share/69666e0b-f08c-800f-93fd-611eced4b100
This commit is contained in:
5 files changed
+18
-23
No files matched your search
@@ -41,7 +41,7 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
make up UP_BUILD=0
|
||||
make up
|
||||
|
||||
- name: Discover apps (JSON)
|
||||
id: discover
|
||||
@@ -83,7 +83,7 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
make up UP_BUILD=0
|
||||
make up
|
||||
|
||||
- name: Deploy app
|
||||
shell: bash
|
||||
|
||||
@@ -40,7 +40,7 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
make up UP_BUILD=0
|
||||
make up
|
||||
|
||||
- name: Discover apps (JSON)
|
||||
id: discover
|
||||
@@ -82,7 +82,7 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
make up UP_BUILD=0
|
||||
make up
|
||||
|
||||
- name: Deploy app
|
||||
shell: bash
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# .github/workflows/test-deploy-workstation.yml
|
||||
name: Test Infinito.Nexus Deploy (workstation)
|
||||
|
||||
on:
|
||||
@@ -40,7 +39,7 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
make up UP_BUILD=0
|
||||
make up
|
||||
|
||||
- name: Discover apps (JSON)
|
||||
id: discover
|
||||
@@ -82,7 +81,7 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
make up UP_BUILD=0
|
||||
make up
|
||||
|
||||
- name: Deploy app
|
||||
shell: bash
|
||||
|
||||
@@ -48,14 +48,13 @@ TEST_DEPLOY_TYPE ?= server
|
||||
# Ensure repo root is importable (so module_utils/, filter_plugins/ etc. work)
|
||||
PYTHONPATH ?= .
|
||||
|
||||
# Control whether images are built before compose up (default: yes)
|
||||
UP_BUILD ?= 1
|
||||
|
||||
# Overwrite defaults
|
||||
ifeq ($(IS_ACT),0)
|
||||
ifeq ($(GITHUB_ACTIONS),true)
|
||||
# -------- Real GitHub Actions CI --------
|
||||
INFINITO_PULL_POLICY ?= always
|
||||
INFINITO_IMAGE ?= ghcr.io/$(GITHUB_REPOSITORY_OWNER)/infinito-$(INFINITO_DISTRO):ci-$(GITHUB_SHA)
|
||||
INFINITO_NO_BUILD ?= 1
|
||||
export INFINITO_NO_BUILD
|
||||
export INFINITO_PULL_POLICY
|
||||
export INFINITO_IMAGE
|
||||
endif
|
||||
@@ -100,15 +99,7 @@ down:
|
||||
@INFINITO_DISTRO="$(INFINITO_DISTRO)" docker compose --profile ci down --remove-orphans -v
|
||||
|
||||
up:
|
||||
ifeq ($(UP_BUILD),1)
|
||||
@$(MAKE) build-missing
|
||||
else
|
||||
@echo ">>> Skipping local image build (UP_BUILD=0)"
|
||||
endif
|
||||
python3 -m cli.deploy.test.up
|
||||
|
||||
up-local:
|
||||
@$(MAKE) up UP_BUILD=1
|
||||
python3 -m cli.deploy.test.up
|
||||
|
||||
list:
|
||||
@echo "Generating the roles list"
|
||||
|
||||
@@ -66,15 +66,20 @@ class Compose:
|
||||
|
||||
def up(self, *, run_init: bool = True) -> None:
|
||||
print(">>> Starting compose stack (coredns + infinito)")
|
||||
self.run(["up", "-d", "coredns", "infinito"], check=True)
|
||||
|
||||
no_build = os.environ.get("INFINITO_NO_BUILD", "0") == "1"
|
||||
args = ["up", "-d"]
|
||||
if no_build:
|
||||
args.append("--no-build")
|
||||
args += ["coredns", "infinito"]
|
||||
|
||||
self.run(args, check=True)
|
||||
|
||||
print(">>> Waiting for systemd to be ready")
|
||||
self.wait_for_systemd_ready()
|
||||
|
||||
if run_init:
|
||||
print(">>> Running infinito entry.sh init")
|
||||
# Reuse the same init entrypoint logic as the image does.
|
||||
# Use sh -lc so PATH/env/profile are consistent and we can pass args.
|
||||
self.exec(
|
||||
["sh", "-lc", "/opt/src/infinito/scripts/docker/entry.sh true"],
|
||||
workdir="/opt/src/infinito",
|
||||
|
||||
Reference in new issue
Block a user