Commit Graph
15 Commits
Author SHA1 Message Date
darroyo 803f05a60b tag con fecha y hora 2026-09-24 18:21:35 -03:00
darroyo faabf0b82b cambios cleanup del registry remoto y tags 2026-09-24 17:18:05 -03:00
darroyo 5b4bbce5c8 cambios en script y version 2026-09-24 16:41:36 -03:00
darroyo bc5ffaf1d2 fix: use Mandrel jdk-25 builder for Quarkus 3.39 native image
Quarkus 3.39 requires GraalVM/Mandrel 25.0; the jdk-21 builder ships
Mandrel 23.1 and fails native-image compilation in Docker.
2026-09-24 13:11:06 -03:00
darroyo bd196ec9e0 docs: add Spanish guide for build-and-push.sh
Document flags, SSH aliases, and troubleshooting for invalid Docker tags
when xmllint is missing on build hosts such as vm-compilador.
2026-09-24 12:58:11 -03:00
darroyo 57af30fdd2 fix: read_pom fallback returned both artifactId and version
When xmllint is not in PATH, the grep fallback in read_pom() captured
both <artifactId> and <version> in a single multi-line string and
returned it for every call. Concatenating it with ':' produced an
invalid Docker tag like:

    test-quarkus\n1.0.0-SNAPSHOT:test-quarkus\n1.0.0-SNAPSHOT

causing 'docker build' to fail with 'invalid reference format'.

Add a third 'tag' argument to read_pom() so the fallback extracts
only the requested element, and pass 'artifactId' / 'version' from
the call sites.

Also enrich pom.xml with <name> and <description> for Maven/IDE
metadata, without changing the image identity.

Tests cover the no-xmllint path explicitly (PATH stripped to
reproduce the vm-compilador environment) and the override path.
2026-09-09 12:10:17 -03:00
darroyo 6740e4e398 fix: make SSH config directive matching case-insensitive
resolve_ssh_alias() used a case statement that only matched
'HostName' (capital N), but OpenSSH treats config directives
as case-insensitive: 'Hostname', 'HostName', 'HOSTNAME' and
'hostname' are all equivalent. A config like

    Host retailpos-hites-qa
        Hostname 10.60.16.35
        User retailpos
        IdentityFile ~/.ssh/retailpos-key

produced 'has no HostName' even though one was present.

Enable 'shopt -s nocasematch' around the parsing loop so the
case branches match any casing. nocasematch was chosen over
${var,,} because the latter requires bash 4+, and macOS still
ships bash 3.2.57 as /bin/bash.

The 'Host' pattern itself remains case-sensitive, matching
ssh's own behavior.

Verified against: tabbed/spaced/mixed indentation, lowercase,
uppercase, mixed-casing directives, the user's exact config,
and the previous regression cases.
2026-09-09 11:26:35 -03:00
darroyo 4d55c8b8bb fix: parse SSH config entries with tabs as well as spaces
resolve_ssh_alias() now extracts tokens with 'read -r', which
collapses tabs and spaces uniformly. Two bugs were at play:

1. The previous parser split on literal spaces
   (key="${line%% *}") and used '${line#Host }' to drop the
   Host directive, so configs that used tab indentation
   (e.g. '\tHostName 10.60.16.35') ended up with key being the
   whole line and never matching the case branches. Result:
   'has no HostName in ~/.ssh/config' even when one was present.

2. The script's global IFS is $'\n\t' (no space), which made
   'read' unable to split on spaces at all. Fixed by restoring
   space-aware IFS locally inside the loop.

Verified against tabbed, spaced, mixed, indented-comment and
Host\tname configs; behavior with the original space-separated
configs is unchanged.
2026-09-09 11:19:13 -03:00
darroyo 38b22648f1 build: resolve --remote as SSH config alias when it has no @
scripts/build-and-push.sh now parses ~/.ssh/config (or --ssh-config)
when --remote is a bare alias like 'prod'. It extracts HostName,
User, Port and IdentityFile from the matching Host block, falls back
to the current user / port 22, and uses the config IdentityFile when
--ssh-key is not given. --ssh-key always wins. The resolved target
is shown in the logs before any docker/pussh call, and is the form
passed to docker pussh and the verification ssh.

Wildcards, Include and Match directives are intentionally not handled:
ssh itself resolves them when the alias is passed through, but the
script logs the expanded target first for visibility.
2026-09-08 18:35:23 -03:00
darroyo 3b0e6b4a3f build: make build-and-push.sh runnable from any directory
- Resolve PROJECT_DIR from the script's own location by default
  (works with absolute, relative and symlinked invocations)
- Allow override via --project-dir flag or PROJECT_DIR env var
- Improve error message for invalid --project-dir paths
- Update usage and README accordingly
2026-09-08 18:20:49 -03:00
darroyo ceebfb33f8 build: add native build and unregistry push script
scripts/build-and-push.sh builds the native image with the Mandrel
Dockerfile and pushes it to a remote Docker host via docker-pussh
(unregistry), transferring only missing layers over SSH.

- Name and tag default to pom.xml artifactId/version (overridable)
- Builds for linux/amd64; --skip-build to pussh only
- Verifies image presence on the remote after push and prints
  a ready-to-use docker run hint

README updated with a 'Building and deploying natively' section.
2026-09-07 18:02:37 -03:00
darroyo 73875aab94 build: move Dockerfile under src/main/docker
- Restore the Quarkus-default location for the container build recipe
- Drop the stale !Dockerfile entry from .dockerignore (file no longer at root)
2026-09-07 17:51:33 -03:00
darroyo 6d1b7643df build: replace scaffold Dockerfiles with native multi-stage image
- Add Dockerfile using Mandrel jdk-21 builder and quarkus-micro-image:2.0 runtime
- Run as non-root user 1001, expose 8080, set TZ=America/Santiago
- Bind http host to 0.0.0.0 for container networking
- Remove obsolete Quarkus-generated Dockerfiles (jvm, legacy-jar, native, native-micro)
- Tighten .dockerignore to ship only build inputs (mvnw, .mvn, pom.xml, src)
- Add api.http with /status and /q/health request samples
2026-09-07 17:10:49 -03:00
darroyo e5c382fe0a feat: bootstrap Quarkus app with status endpoint and MicroProfile Health
- Scaffold Quarkus 3.39.2 (Java 21, Maven) with rest-jackson and smallrye-health
- Add GET /status returning application uptime, version and JVM metrics
- Add ApplicationHealthCheck (@Readiness) exposing /q/health/ready
- Configure application name, version and health root path
- Cover endpoints with StatusResourceTest (@QuarkusTest + rest-assured)
2026-09-07 16:45:01 -03:00
darroyo 558063cf3e Initial commit 2026-09-07 19:30:23 +00:00