Skip to content

Commit

Permalink
chore: update build tools
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadnassri committed Aug 1, 2023
1 parent 1737cb6 commit f0a2e29
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 13 deletions.
2 changes: 0 additions & 2 deletions .dockerignore

This file was deleted.

3 changes: 3 additions & 0 deletions .github/linters/.grype.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
check-for-app-update: false
exclude:
- '**/package-lock.json'
26 changes: 21 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
# Note: this file originates in template-action-docker #
# ---------------------------------------------------- #

SHELL := /bin/bash

pull: ## pull latest containers
@docker compose pull

Expand All @@ -15,15 +13,33 @@ lint: clean ## run mega-linter
readme: clean ## run readme action
@docker compose run --rm readme

start: ## start the project in foreground
@docker compose run $(shell env | grep DOCKER | sed -E 's/DOCKER_(.*?)=(.*)/-e \1="\2"/gm;t;d') app

build: clean ## start the project in background
@docker compose build --no-cache app

shell: ## start the container shell
@docker compose run --rm --entrypoint /bin/sh app

install: ## install all dependencies
@docker compose run --rm app install

start: ## start the project in foreground
@docker compose run --rm app

test: ## run all npm tests
@docker compose run --rm app-test

build-action: clean ## start the project in background
@docker compose build --no-cache action

shell-action: ## start the container shell
@docker compose run --rm --entrypoint /bin/sh action

start-action: ## start the project in foreground
@docker compose run --rm action

test-action: ## start the project in foreground
@docker compose run --rm action-test

stop: ## stop all running containers
@docker compose down --remove-orphans --rmi local

Expand Down
33 changes: 27 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
# ---- mega-linter ---- #
lint:
profiles: ["dev"]
image: oxsecurity/megalinter-javascript:v6.20.1
image: oxsecurity/megalinter:v7.2.1
volumes:
- ./:/tmp/lint
environment:
Expand All @@ -22,13 +22,34 @@ services:
- ./:/data
command: --defaults=.pandoc.yml

# ---- app ---- #
# ---- action container ---- #
action:
profiles: ["action"]
build: .

action-test:
extends: action
profiles: ["action"]
volumes:
- ./test:/github/workspace/test
- .git:/github/workspace/.git
env_file:
- .env

# ---- main container ---- #
app:
profiles: ["app"]
privileged: true
build: .
working_dir: /github/workspace
image: node:20-alpine
working_dir: /app
entrypoint: npm --no-update-notifier --no-fund --no-audit
command: start
tty: true
volumes:
- ./:/github/workspace
- ./:/app
env_file:
- .env

app-test:
extends: app
profiles: ["test"]
command: run test:ci -- --reporter=classic

0 comments on commit f0a2e29

Please sign in to comment.