Skip to content

Commit 3e164db

Browse files
committed
chore: update package.json to remove docker scripts and add devDependencies
- Removed docker-related scripts from the package.json. - Added several development dependencies including all-contributors-cli, cypress, generate-changelog, and others. - Changed "dependencies" to "devDependencies" for better project organization. feat: add taskfiles directory with initial commit reference
1 parent 20c4d29 commit 3e164db

File tree

11 files changed

+10434
-4623
lines changed

11 files changed

+10434
-4623
lines changed

.env.example

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
STACK=socketio
1+
STACK=angular
22
FOLDERPHAR=apps
3-
FOLDERLAMPY=lampy
4-
DOCKERCOMPOSEFILES=docker-compose.yml docker-compose-lampy.yml
3+
DOCKERCOMPOSEFILE=docker-compose-lampy.yml

.github/workflows/ci.yml

Lines changed: 89 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,107 @@
1-
name: ci
2-
on: [push]
1+
name: CI Pipeline
2+
on:
3+
push:
4+
paths-ignore:
5+
- '**.md'
6+
- 'docs/**'
7+
- '.gitignore'
8+
pull_request:
9+
paths-ignore:
10+
- '**.md'
11+
- 'docs/**'
12+
- '.gitignore'
13+
14+
env:
15+
NODE_VERSION: '22'
16+
DOCKER_COMPOSE_VERSION: '2.29.7'
17+
318
jobs:
4-
tests:
19+
ci:
520
runs-on: ubuntu-24.04
21+
timeout-minutes: 60
22+
env:
23+
DOCKER_INTERACTIVE: false
624
steps:
25+
# === SETUP PHASE ===
726
- name: Checkout
827
uses: actions/checkout@v4
928
with:
1029
submodules: recursive
30+
31+
- name: Setup Docker Compose
32+
run: |
33+
if ! command -v docker-compose &> /dev/null; then
34+
sudo curl -L "https://github.com/docker/compose/releases/download/v${{ env.DOCKER_COMPOSE_VERSION }}/docker-compose-linux-x86_64" -o /usr/local/bin/docker-compose
35+
sudo chmod +x /usr/local/bin/docker-compose
36+
fi
37+
docker-compose --version
38+
39+
- name: Setup Task
40+
uses: go-task/setup-task@v1
41+
42+
- name: Setup Node.js
43+
uses: actions/setup-node@v4
44+
with:
45+
node-version: ${{ env.NODE_VERSION }}
46+
cache: 'npm'
47+
cache-dependency-path: 'package-lock.json'
48+
1149
- name: Repository lampy
1250
uses: actions/checkout@v4
1351
with:
1452
submodules: recursive
15-
ref: 'v2.0'
1653
repository: koromerzhin/lampy
54+
ref: 'v4.0'
1755
path: lampy
18-
- name: Install npm dependencies
19-
run: npm install
20-
- name: 'set .env'
21-
run: 'cp .env.example .env'
22-
- name: 'Launch Lampy'
23-
run: cd lampy && npm run exec
24-
- name: 'Image pull'
25-
run: npm run docker:getpull-image
26-
- name: 'Build containers'
27-
run: npm run docker:deploy
28-
- name: 'Waiting'
29-
run: npm run docker:waiting
30-
- name: linter readme.md
31-
run: npm run lint:markdown
32-
- name: Cypress run
56+
57+
# === BUILD PHASE ===
58+
- name: Install dependencies
59+
run: npm ci --prefer-offline --no-audit
60+
61+
- name: Setup environment files
62+
run: |
63+
cp .env.example .env
64+
65+
# === INFRASTRUCTURE PHASE ===
66+
- name: Setup Docker cache
67+
uses: actions/cache@v4
68+
with:
69+
path: /tmp/.buildx-cache
70+
key: ${{ runner.os }}-buildx-${{ github.sha }}
71+
restore-keys: |
72+
${{ runner.os }}-buildx-
73+
74+
- name: Setup database and infrastructure
75+
run: |
76+
cd lampy && task lampy:exec
77+
78+
- name: Deploy containers
79+
run: |
80+
task socketio:exec
81+
82+
- name: Run Cypress tests
3383
uses: cypress-io/github-action@v6
3484
continue-on-error: true
35-
- name: Set date and branch variables
36-
run: |
37-
echo "CURRENT_DATE=$(date '+%Y-%m-%d_%H-%M-%S')" >> $GITHUB_ENV
38-
echo "CURRENT_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV
39-
- name: Archive screenshots
85+
with:
86+
wait-on-timeout: 120
87+
browser: chrome
88+
record: false
89+
parallel: false
90+
config: 'screenshotOnRunFailure=true,video=true,videoCompression=32,defaultCommandTimeout=10000,requestTimeout=10000,responseTimeout=10000,retries={"runMode":2,"openMode":0}'
91+
env:
92+
CYPRESS_CACHE_FOLDER: ~/.cache/Cypress
93+
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
94+
95+
# === ARTIFACTS PHASE ===
96+
- name: Archive test results
4097
uses: actions/upload-artifact@v4
98+
if: always()
4199
with:
42-
name: "socketio-${{ env.CURRENT_BRANCH }}_${{ env.CURRENT_DATE }}"
43-
path: cypress/
100+
name: "test-results-${{ github.run_number }}-${{ github.sha }}"
101+
path: |
102+
cypress/screenshots
103+
cypress/videos
104+
cypress/reports
44105
retention-days: 7
106+
if-no-files-found: ignore
107+
compression-level: 6

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
/node_modules
22
/apps/node_modules
3-
.env
3+
.env
4+
docker-compose-*.yml
5+
!docker-compose-lampy.yml

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "taskfiles"]
2+
path = taskfiles
3+
url = git@github.com:koromerzhin/taskfiles.git

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v22

Taskfile.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
version: 3
2+
3+
# Taskfile principal - Tâches globales et inclusions
4+
# Charge automatiquement les variables depuis le fichier .env s'il existe
5+
dotenv: [ '.env' ]
6+
7+
includes:
8+
docker: ./taskfiles/docker/Taskfile.yml
9+
utils: ./taskfiles/utils/Taskfile.yml
10+
env: ./taskfiles/env/Taskfile.yml
11+
nodejs: ./taskfiles/nodejs/Taskfile.yml
12+
download: ./taskfiles/download/Taskfile.yml
13+
14+
vars:
15+
# Variables avec valeurs par défaut depuis .env ou valeurs de fallback
16+
PROJECT_NAME: '{{.PROJECT_NAME | default "socketio"}}'
17+
PROJECT_VERSION: '1.0.0'
18+
ENVIRONMENT: '{{.ENVIRONMENT | default "development"}}'
19+
STACK_NAME: '{{.STACK | default "socketio"}}'
20+
FOLDERLAMPY: '{{.FOLDERLAMPY | default "lampy"}}'
21+
DOCKERCOMPOSEFILE: '{{.DOCKERCOMPOSEFILE | default "docker-compose.yml"}}'
22+
23+
tasks:
24+
default:
25+
desc: "Affiche l'aide et les tâches disponibles"
26+
silent: true
27+
cmds:
28+
- echo "🛠️ Collection de Taskfiles pour le développement"
29+
- echo ""
30+
- echo "Tâches globales disponibles :"
31+
- task --list
32+
- echo ""
33+
34+
info:
35+
desc: "Affiche les informations du projet avec les variables d'environnement"
36+
silent: true
37+
cmds:
38+
- |
39+
echo "🛠️ {{.PROJECT_NAME}} v{{.PROJECT_VERSION}} - Collection de Taskfiles"
40+
echo "Environnement: {{.ENVIRONMENT}}"
41+
42+
help:
43+
desc: "Affiche l'aide détaillée"
44+
aliases: [ h ]
45+
cmds:
46+
- task: default
47+
48+
socketio:getpull-image:
49+
desc: "Télécharge les images Docker définies dans le docker-compose.yml"
50+
silent: true
51+
cmds:
52+
- task: docker:images:pull
53+
vars:
54+
COMPOSE_FILE: "{{.DOCKERCOMPOSEFILE}}"
55+
56+
socketio:deploy:
57+
desc: "Déploie les stacks Docker définies dans les fichiers docker-compose"
58+
silent: true
59+
cmds:
60+
- task: docker:stack:deploy
61+
vars:
62+
COMPOSE_FILE: "{{.DOCKERCOMPOSEFILE}}"
63+
STACK_NAME: "{{.STACK_NAME}}"
64+
65+
socketio:waiting:
66+
desc: "Attend que les services soient opérationnels"
67+
silent: true
68+
cmds:
69+
- task: docker:stack:check:containers:ready
70+
vars:
71+
CONTAINERS: "www"
72+
STACK_NAME: "{{.STACK_NAME}}"
73+
74+
socketio:ls:
75+
desc: "Liste les stacks et services Docker"
76+
silent: true
77+
cmds:
78+
- task: docker:stack:services
79+
vars:
80+
STACK_NAME: "{{.STACK_NAME}}"
81+
82+
socketio:exec:
83+
desc: "Exécute une commande dans un conteneur en cours d'exécution"
84+
cmds:
85+
- task: socketio:getpull-image
86+
- task: socketio:deploy
87+
- task: socketio:waiting
88+
- task: socketio:ls
89+
90+
socketio:bash:
91+
desc: "Ouvre un shell bash dans le conteneur www"
92+
cmds:
93+
- task: docker:stack:shell
94+
vars:
95+
STACK_NAME: "socketio"
96+
SERVICE_NAME: "www"

docker-compose-lampy.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
21
version: "3.4"
32
networks:
43
proxylampy:
54
external: true
65
services:
76
www:
7+
image: node:22.12.0
8+
working_dir: /app
9+
command: >
10+
sh -c "npm install && npm run serve"
11+
volumes:
12+
- ${PWD}/apps:/app:delegated
813
networks:
914
- proxylampy
1015
deploy:

docker-compose.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)