Skip to content

Commit 0a0a3af

Browse files
committed
chore: update package.json to remove docker commands and add devDependencies
- Removed docker-related scripts from the package.json - Added several development dependencies including all-contributors-cli, cypress, and others - Created a new taskfiles directory with a subproject commit
1 parent 0a9c639 commit 0a0a3af

File tree

11 files changed

+10392
-4856
lines changed

11 files changed

+10392
-4856
lines changed

.env.example

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
STACK=angular
1+
STACK=labstag
22
FOLDERPHAR=apps
3+
FOLDERSQL=database_init
4+
FILESQL=01_labstag.sql
35
FOLDERLAMPY=lampy
4-
DOCKERCOMPOSEFILES=docker-compose.yml docker-compose-lampy.yml
6+
DOCKERCOMPOSEFILE=docker-compose-lampy.yml
7+
8+
CKEDITOR_LICENSE_KEY=GPL

.github/workflows/ci.yml

Lines changed: 100 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,118 @@
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+
PHP_VERSION: '8.3'
18+
319
jobs:
4-
tests:
20+
ci:
521
runs-on: ubuntu-24.04
22+
timeout-minutes: 60
23+
env:
24+
DOCKER_INTERACTIVE: false
625
steps:
26+
# === SETUP PHASE ===
727
- name: Checkout
828
uses: actions/checkout@v4
929
with:
1030
submodules: recursive
31+
32+
- name: Setup Docker Compose
33+
run: |
34+
if ! command -v docker-compose &> /dev/null; then
35+
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
36+
sudo chmod +x /usr/local/bin/docker-compose
37+
fi
38+
docker-compose --version
39+
40+
- name: Setup Task
41+
uses: go-task/setup-task@v1
42+
43+
- name: Setup Node.js
44+
uses: actions/setup-node@v4
45+
with:
46+
node-version: ${{ env.NODE_VERSION }}
47+
cache: 'npm'
48+
cache-dependency-path: 'package-lock.json'
49+
1150
- name: Repository lampy
1251
uses: actions/checkout@v4
1352
with:
1453
submodules: recursive
15-
ref: 'v2.0'
1654
repository: koromerzhin/lampy
55+
ref: 'v4.0'
1756
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: 'create apps'
27-
run: npm run create:apps
28-
- name: 'Build containers'
29-
run: npm run docker:deploy
30-
- name: 'Waiting'
31-
run: npm run docker:waiting
32-
- name: 'docker ls'
33-
run: npm run docker:ls
34-
- name: linter readme.md
35-
run: npm run lint:markdown
36-
- name: 'sleep 50'
37-
run: sleep 50
38-
- name: Cypress run
57+
58+
# === BUILD PHASE ===
59+
- name: Install dependencies
60+
run: npm ci --prefer-offline --no-audit
61+
62+
- name: Setup environment files
63+
run: |
64+
cp .env.example .env
65+
66+
# === INFRASTRUCTURE PHASE ===
67+
- name: Setup Docker cache
68+
uses: actions/cache@v4
69+
with:
70+
path: /tmp/.buildx-cache
71+
key: ${{ runner.os }}-buildx-${{ github.sha }}
72+
restore-keys: |
73+
${{ runner.os }}-buildx-
74+
75+
- name: Setup database and infrastructure
76+
run: |
77+
cd lampy && task lampy:exec
78+
79+
- name: Deploy containers
80+
run: |
81+
task angular:exec
82+
83+
- name: Run Cypress tests
3984
uses: cypress-io/github-action@v6
4085
continue-on-error: true
41-
- name: Set date and branch variables
42-
run: |
43-
echo "CURRENT_DATE=$(date '+%Y-%m-%d_%H-%M-%S')" >> $GITHUB_ENV
44-
echo "CURRENT_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV
45-
- name: Archive screenshots
86+
with:
87+
wait-on-timeout: 120
88+
browser: chrome
89+
record: false
90+
parallel: false
91+
config: |
92+
screenshotOnRunFailure=true,
93+
video=true,
94+
videoCompression=32,
95+
defaultCommandTimeout=10000,
96+
requestTimeout=10000,
97+
responseTimeout=10000,
98+
retries={
99+
"runMode": 2,
100+
"openMode": 0
101+
}
102+
env:
103+
CYPRESS_CACHE_FOLDER: ~/.cache/Cypress
104+
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
105+
106+
# === ARTIFACTS PHASE ===
107+
- name: Archive test results
46108
uses: actions/upload-artifact@v4
109+
if: always()
47110
with:
48-
name: "angular-${{ env.CURRENT_BRANCH }}_${{ env.CURRENT_DATE }}"
49-
path: cypress/
111+
name: "test-results-${{ github.run_number }}-${{ github.sha }}"
112+
path: |
113+
cypress/screenshots
114+
cypress/videos
115+
cypress/reports
50116
retention-days: 7
117+
if-no-files-found: ignore
118+
compression-level: 6

.github/workflows/codeql.yml

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

.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 = [email protected]: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: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
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 "angular"}}'
17+
PROJECT_VERSION: '1.0.0'
18+
ENVIRONMENT: '{{.ENVIRONMENT | default "development"}}'
19+
SWARM_DEFAULT_ADDR_POOL: '{{.IPSWARM | default "10.20.0.0/16"}}'
20+
SWARM_ADVERTISE_ADDR: '{{.ADVERTISEADDR | default "192.168.1.46"}}'
21+
STACK_NAME: '{{.STACK | default "angular"}}'
22+
FOLDERSQL: '{{.FOLDERSQL | default "database_init"}}'
23+
FILESQL: '{{.FILESQL | default "dump.sql"}}'
24+
FOLDERLAMPY: '{{.FOLDERLAMPY | default "angular"}}'
25+
DOCKERCOMPOSEFILE: '{{.DOCKERCOMPOSEFILE | default "docker-compose.yml"}}'
26+
27+
tasks:
28+
default:
29+
desc: "Affiche l'aide et les tâches disponibles"
30+
silent: true
31+
cmds:
32+
- echo "🛠️ Collection de Taskfiles pour le développement"
33+
- echo ""
34+
- echo "Tâches globales disponibles :"
35+
- task --list
36+
- echo ""
37+
38+
info:
39+
desc: "Affiche les informations du projet avec les variables d'environnement"
40+
silent: true
41+
cmds:
42+
- |
43+
echo "🛠️ {{.PROJECT_NAME}} v{{.PROJECT_VERSION}} - Collection de Taskfiles"
44+
echo "Environnement: {{.ENVIRONMENT}}"
45+
46+
help:
47+
desc: "Affiche l'aide détaillée"
48+
aliases: [ h ]
49+
cmds:
50+
- task: default
51+
52+
angular:getpull-image:
53+
desc: "Télécharge les images Docker définies dans le docker-compose.yml"
54+
silent: true
55+
cmds:
56+
- task: docker:images:pull
57+
vars:
58+
COMPOSE_FILE: "{{.DOCKERCOMPOSEFILE}}"
59+
60+
angular:deploy:
61+
desc: "Déploie les stacks Docker définies dans les fichiers docker-compose"
62+
silent: true
63+
cmds:
64+
- task: docker:stack:deploy
65+
vars:
66+
COMPOSE_FILE: "{{.DOCKERCOMPOSEFILE}}"
67+
STACK_NAME: "{{.STACK_NAME}}"
68+
69+
angular:install-first:
70+
desc: "Installation initiale de Composer et des dépendances"
71+
silent: true
72+
cmds:
73+
- docker run --rm -v $(pwd)/apps:/var/www -w /var/www koromerzhin/php:8.4.3-apache-symfony symfony composer install
74+
75+
angular:waiting:
76+
desc: "Attend que les services soient opérationnels"
77+
silent: true
78+
cmds:
79+
- task: docker:stack:check:containers:ready
80+
vars:
81+
CONTAINERS: "phpfpm"
82+
STACK_NAME: "{{.STACK_NAME}}"
83+
84+
angular:ls:
85+
desc: "Liste les stacks et services Docker"
86+
silent: true
87+
cmds:
88+
- task: docker:stack:services
89+
vars:
90+
STACK_NAME: "{{.STACK_NAME}}"
91+
92+
create:apps:
93+
desc: "Crée une nouvelle application Angular dans le dossier apps"
94+
cmds:
95+
- npm install -g @angular/cli && ng new apps
96+
97+
angular:exec:
98+
desc: "Exécute une commande dans un conteneur en cours d'exécution"
99+
cmds:
100+
- task: create:apps
101+
- task: angular:getpull-image
102+
- task: angular:deploy
103+
- task: angular:waiting
104+
- task: angular:ls

docker-compose-lampy.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ networks:
44
external: true
55
services:
66
www:
7+
image: node:20.3.1
8+
working_dir: /app
9+
command: >
10+
sh -c "npm install -g @angular/cli && ng serve --host 0.0.0.0 --disable-host-check"
11+
volumes:
12+
- ${PWD}/apps:/app:delegated
713
networks:
814
- proxylampy
915
deploy:

docker-compose.yml

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

0 commit comments

Comments
 (0)