Hide build info and fix deploy workflow
This commit is contained in:
@@ -31,22 +31,13 @@ jobs:
|
||||
python -m pytest -q
|
||||
npm --prefix frontend test -- --run
|
||||
npm --prefix frontend run build
|
||||
python -m pip wheel --no-deps --wheel-dir dist .
|
||||
sh -n deploy/systemd-install.sh
|
||||
sh -n deploy/repo-upgrade.sh
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: importarr-wheel
|
||||
path: dist/*.whl
|
||||
|
||||
deploy:
|
||||
needs: test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: importarr-wheel
|
||||
path: dist
|
||||
- name: Configure deployment SSH
|
||||
shell: bash
|
||||
env:
|
||||
@@ -65,14 +56,9 @@ jobs:
|
||||
DEPLOY_USER: ${{ secrets.IMPORTARR_DEPLOY_USER }}
|
||||
DEPLOY_SHA: ${{ github.sha }}
|
||||
run: |
|
||||
WHEEL=$(find dist -maxdepth 1 -name 'importarr-*.whl' -print -quit)
|
||||
test -n "$WHEEL"
|
||||
scp -P "$DEPLOY_PORT" -o BatchMode=yes "$WHEEL" "$DEPLOY_USER@$DEPLOY_HOST:/tmp/importarr-deploy.whl"
|
||||
ssh -p "$DEPLOY_PORT" -o BatchMode=yes "$DEPLOY_USER@$DEPLOY_HOST" \
|
||||
"deploy_status=0; sudo -n /bin/sh -c 'set -eu; cd /opt/importarr/repo;
|
||||
"sudo -n /bin/sh -c 'set -eu; cd /opt/importarr/repo;
|
||||
test -z \"\$(git status --porcelain)\";
|
||||
git fetch --prune origin main;
|
||||
git checkout --detach $DEPLOY_SHA;
|
||||
/bin/sh deploy/repo-upgrade.sh /tmp/importarr-deploy.whl $DEPLOY_SHA' || deploy_status=\$?;
|
||||
rm -f /tmp/importarr-deploy.whl;
|
||||
exit \$deploy_status"
|
||||
/bin/sh deploy/repo-upgrade.sh \"\" $DEPLOY_SHA'"
|
||||
|
||||
@@ -23,7 +23,7 @@ export const pollDelay = failures => failures ? Math.min(5000,1000*2**(failures-
|
||||
|
||||
function Modal({ trigger, title, children }) { return <Dialog><DialogTrigger asChild>{trigger}</DialogTrigger><DialogContent><DialogHeader><DialogTitle>{title}</DialogTitle></DialogHeader>{children}</DialogContent></Dialog>; }
|
||||
function Field({ label, ...props }) { return <label className="grid gap-2 text-sm font-medium">{label}<Input {...props}/></label>; }
|
||||
export function BuildSummary({ build }) { return <p className="hidden max-w-md truncate text-xs text-muted-foreground sm:block">{build?`Build ${build.git_sha} · ${build.build_date}`:"Build information unavailable"}</p>; }
|
||||
export function BuildSummary() { return null; }
|
||||
|
||||
export function SettingsDialog({ status, refresh }) {
|
||||
const [result,setResult]=useState({});
|
||||
|
||||
@@ -39,8 +39,8 @@ describe("Importarr UI behavior", () => {
|
||||
expect([pollDelay(0),pollDelay(1),pollDelay(2),pollDelay(4)]).toEqual([300,1000,2000,5000]);
|
||||
});
|
||||
|
||||
it("shows the build commit and date in the header summary", () => {
|
||||
it("hides the build commit and date from the header summary", () => {
|
||||
render(<BuildSummary build={{ git_sha: "abc123def456", build_date: "2026-08-11T12:34:56+02:00" }} />);
|
||||
expect(screen.getByText("Build abc123def456 · 2026-08-11T12:34:56+02:00")).toBeInTheDocument();
|
||||
expect(screen.queryByText("Build abc123def456 · 2026-08-11T12:34:56+02:00")).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -60,25 +60,21 @@ def test_repo_upgrade_forces_fresh_install_without_skipping_dependencies():
|
||||
assert '"${WHEEL:-$REPO_DIR}"' in script
|
||||
|
||||
|
||||
def test_deploy_workflow_pins_built_wheel_to_triggering_revision():
|
||||
def test_deploy_workflow_pins_repository_to_triggering_revision():
|
||||
workflow = (Path(__file__).parents[1] / ".gitea/workflows/deploy.yml").read_text()
|
||||
|
||||
assert "actions/upload-artifact@v4" in workflow
|
||||
assert "actions/download-artifact@v4" in workflow
|
||||
assert "scp -P" in workflow
|
||||
assert "DEPLOY_SHA: ${{ github.sha }}" in workflow
|
||||
assert "git fetch --prune origin main" in workflow
|
||||
assert "git checkout --detach $DEPLOY_SHA" in workflow
|
||||
assert "repo-upgrade.sh /tmp/importarr-deploy.whl $DEPLOY_SHA" in workflow
|
||||
assert 'repo-upgrade.sh \\"\\" $DEPLOY_SHA' in workflow
|
||||
|
||||
|
||||
def test_deploy_workflow_cleans_up_without_masking_deployment_failure():
|
||||
def test_deploy_workflow_runs_repository_upgrade_over_ssh():
|
||||
workflow = (Path(__file__).parents[1] / ".gitea/workflows/deploy.yml").read_text()
|
||||
|
||||
capture = "|| deploy_status=\\$?;"
|
||||
cleanup = "rm -f /tmp/importarr-deploy.whl;"
|
||||
propagate = "exit \\$deploy_status"
|
||||
assert "deploy_status=0; sudo" in workflow
|
||||
assert workflow.index(capture) < workflow.index(cleanup) < workflow.index(propagate)
|
||||
assert 'ssh -p "$DEPLOY_PORT" -o BatchMode=yes "$DEPLOY_USER@$DEPLOY_HOST"' in workflow
|
||||
assert 'test -z \\"\\$(git status --porcelain)\\"' in workflow
|
||||
assert "sudo -n /bin/sh -c 'set -eu; cd /opt/importarr/repo" in workflow
|
||||
|
||||
|
||||
def test_repo_upgrade_uses_pinned_revision_for_build_metadata():
|
||||
|
||||
Reference in New Issue
Block a user