Skip to content

Commit ff6ffeb

Browse files
committed
test: run build in container
1 parent 0c001a5 commit ff6ffeb

2 files changed

Lines changed: 20 additions & 4 deletions

File tree

integration/Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ COPY . .
1010
RUN --mount=type=cache,target=/go/pkg/mod/ \
1111
CGO_ENABLED=0 go build -o /bin/hackstack .
1212

13-
# ========== CLI RUN STAGE ==========
13+
# ========== CLI SETUP STAGE ==========
1414
FROM ubuntu:22.04 AS setup
1515

1616
ENV DEBIAN_FRONTEND=noninteractive
@@ -29,8 +29,13 @@ RUN addgroup --gid $GROUP_ID ${USERNAME} && \
2929

3030
USER ${USERNAME}
3131
ENV HOME=/home/${USERNAME}
32-
WORKDIR ${HOME}/projects
32+
ARG PROJECT_DIR="${HOME}/projects"
33+
WORKDIR ${PROJECT_DIR}
3334

35+
COPY examples/ ./examples/
36+
RUN mkdir -p "${PROJECT_DIR}/backend" "${PROJECT_DIR}/cli"
37+
38+
# ========== APP RUN STAGE ==========
3439
FROM setup AS app
3540

3641
ENTRYPOINT [ "/bin/hackstack" ]

integration/justfile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,16 @@ test-all: test-base
3838
@echo "hackstack CLI integration test completed!"
3939

4040
test-base:
41-
@just hackstack --version | grep -n "hackstack"
42-
@just hackstack --help 2>&1 | grep -n "hackstack"
41+
#!/usr/bin/env bash
42+
just hackstack --version | grep -n "hackstack"
43+
just hackstack --help 2>&1 | grep -n "hackstack"
44+
45+
test-build:
46+
#!/usr/bin/env bash
47+
just hackstack build --help
48+
just hackstack build build backend \
49+
--output "/home/testuser/projects/backend" \
50+
--source examples/datasource.yaml
51+
just hackstack build build cli \
52+
--output "/home/testuser/projects/cli" \
53+
--source examples/datasource.yaml

0 commit comments

Comments
 (0)