Skip to content

Commit

Permalink
chore: sec tester integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
mdwagner committed Oct 24, 2023
1 parent e82caac commit 9b71845
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,22 @@ integration-full-web-app-dir:
RUN docker run --network=host lucky-image:latest
END

# integration-sec-tester tests lucky full app with security tester enabled
integration-sec-tester:
FROM earthly/dind:alpine
COPY docker-compose.yml ./
WITH DOCKER \
--compose docker-compose.yml \
--load lucky-image:latest=+integration-image-security
RUN --secret BRIGHT_TOKEN --secret BRIGHT_PROJECT_ID -- \
docker run \
--network=host \
-e BRIGHT_TOKEN \
-e BRIGHT_PROJECT_ID \
lucky-image:latest \
spec -Dwith_sec_tests
END

integration-base-image:
RUN apt-get update \
&& apt-get install -y postgresql-client ca-certificates curl gnupg \
Expand Down Expand Up @@ -165,3 +181,17 @@ integration-image-dir:
RUN crystal run src/app.cr
ENTRYPOINT ["crystal", "spec"]
SAVE IMAGE lucky-image:dir

integration-image-security:
FROM +integration-base-image
RUN npm install --global @neuralegion/nexploit-cli --unsafe-perm=true
RUN lucky init.custom test-project --with-sec-test
WORKDIR /workdir/test-project
RUN crystal tool format --check src spec config
RUN shards install
RUN crystal build src/start_server.cr
RUN crystal build src/test_project.cr
RUN crystal run src/app.cr
ENV LUCKY_ENV=test
ENV RUN_SEC_TESTER_SPECS=1
SAVE IMAGE lucky-image:security

0 comments on commit 9b71845

Please sign in to comment.