43 Commits
Tache3 ... main

Author SHA1 Message Date
tuanvu
6335b425f7 install docker without sudo 2026-02-16 18:57:38 +01:00
tuanvu
c198419f58 install docker 2026-02-16 18:55:18 +01:00
tuanvu
39ae214f78 3rd can use shell? 2026-02-16 18:51:50 +01:00
tuanvu
28d90e66dd rebuild 2026-02-16 18:15:14 +01:00
tuanvu
d1fa4044e1 change docker build 2026-02-16 17:45:39 +01:00
tuanvu
181eb1ae4a test4 2026-02-16 17:38:10 +01:00
tuanvu
9d15c7dfa3 retest 3rd one 2026-02-16 17:11:27 +01:00
tuanvu
2d1fb8759a add tag 2026-02-16 17:04:43 +01:00
tuanvu
df45862a27 3rd ones 2026-02-16 17:01:30 +01:00
tuanvu
3670516270 3rd ones 2026-02-16 16:58:11 +01:00
tuanvu
16a0145a4f add git 2026-02-16 16:54:54 +01:00
tuanvu
62385a9bf6 git recursive? 2026-02-16 16:53:55 +01:00
tuanvu
320bd0974e update before? 2026-02-16 16:51:32 +01:00
tuanvu
882efd42bf install git 2026-02-16 16:50:40 +01:00
tuanvu
3eee533f66 install git 2026-02-16 16:49:30 +01:00
tuanvu
51251e2390 remove ssh 2026-02-16 16:48:44 +01:00
tuanvu
4485ce3f04 test runner 2026-02-16 16:06:49 +01:00
Alexis Leboeuf
f0b852d5cd Re-added gitmodules as it was deleted 2026-02-16 15:56:30 +01:00
tuanvu
466b82d174 use heodic maybe? 2026-02-16 15:54:46 +01:00
tuanvu
247f2eae1c maybe 2nd will pass? 2026-02-16 15:53:18 +01:00
tuanvu
8680677903 maybe 2nd will pass? 2026-02-16 15:51:20 +01:00
tuanvu
24eae0d590 TLS encore 2026-02-16 15:50:15 +01:00
tuanvu
ef6a11dd35 test tache2 2026-02-16 15:47:33 +01:00
tuanvu
12aeb5573e debian for check_app 2026-02-16 15:46:53 +01:00
tuanvu
65db761a81 debian for check_app 2026-02-16 15:46:34 +01:00
tuanvu
ecc6bcb233 git for check_app 2026-02-16 15:46:04 +01:00
tuanvu
c55d5e51d7 alpine again for check_app 2026-02-16 15:44:47 +01:00
tuanvu
85964ad5e7 change to 3.23 2026-02-16 15:43:33 +01:00
tuanvu
14839ad79b add node alpine 2026-02-16 15:41:14 +01:00
tuanvu
ae97e3317b add nodejs 2026-02-16 15:40:07 +01:00
tuanvu
539d3499a8 test 2026-02-16 15:37:57 +01:00
tuanvu
c4f8bc3a0c test 2026-02-16 15:36:32 +01:00
tuanvu
fce18a4da1 remove subfolder 2026-02-16 15:35:01 +01:00
tuanvu
29faddbe2b retry debian for first task 2026-02-16 15:31:27 +01:00
Alexis Leboeuf
110033155f test2 2026-02-16 15:26:18 +01:00
Alexis Leboeuf
3f809eacfc test 2026-02-16 15:23:09 +01:00
Alexis Leboeuf
b9cbb24bf1 Added debug 2026-02-16 15:18:36 +01:00
Alexis Leboeuf
a57233ba31 Added update before to test 2026-02-16 15:16:26 +01:00
Alexis Leboeuf
27b8229b99 Test 2026-02-16 15:10:39 +01:00
tuanvu
f4704af0ec add env 2026-02-16 15:00:01 +01:00
tuanvu
3725de1d31 add job build-frontend 2026-02-16 14:57:22 +01:00
tuanvu
56da48d1b0 return to alpine 2026-02-16 14:55:01 +01:00
tuanvu
4ddd2cfb37 test sudo 2026-02-16 14:53:32 +01:00
4 changed files with 44 additions and 23 deletions

View File

@@ -6,8 +6,6 @@ stages:
variables:
DOCKER_REGISTRY: "docker.io"
DOCKER_USERNAME: "$DOCKERHUB_USER" # c'est dans gitlab Setting -> CI -> Variable
DOCKER_PASSWORD: "$DOCKERHUB_TOKEN" # IDEM mais j'ai caché mon token
IMAGE_BACKEND: "docker.io/benarbause/doodleback-with-quarkus:latest"
IMAGE_FRONTEND: "docker.io/vuminh224/doodle-frontend:latest"
APP_REPO: "https://github.com/barais/doodlestudent.git"
@@ -16,9 +14,11 @@ variables:
check_app_update:
stage: check
image: debian:latest
before_script:
- apt-get update && apt-get install -y git
tags:
- docker
script:
- apt-get update
- apt-get install -y git
# Récupère le dernier commit distant
- LATEST_REMOTE=$(git ls-remote $APP_REPO HEAD | awk '{print $1}')
# Récupère le commit actuel du submodule
@@ -31,18 +31,26 @@ check_app_update:
echo "NEW_COMMIT=false" >> variables.env
fi
artifacts:
reports:
dotenv: variables.env
paths:
- variables.env
# Build Frontend (Angular)
build_frontend:
stage: build
image: node:18
image: node:current-alpine3.23
tags:
- docker
dependencies:
- check_app_update
rules:
- if: '$NEW_COMMIT == "true"'
script:
- apk add --no-cache git
- git submodule update --init --recursive
- source variables.env || true
- if [ "$NEW_COMMIT" != "true" ]; then
echo "No new commit, skipping build";
exit 0;
fi
- ls -la doodlestudent/front #test
- cd doodlestudent/front
- npm ci
- npm run build --prod
@@ -54,27 +62,32 @@ build_frontend:
# Build & Push Docker frontend
build_docker_frontend:
stage: package
image: docker:latest
services:
- docker:dind
tags:
- shell
dependencies:
- check_app_update
- build_frontend
rules:
- if: '$NEW_COMMIT == "true"'
script:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- apt update
- apt install -y docker.io
- source variables.env || true
- if [ "$NEW_COMMIT" != "true" ]; then
echo "No new commit, skipping build";
exit 0;
fi
- echo "$DOCKERHUB_TOKEN" | docker login -u "$DOCKERHUB_USER" --password-stdin
- docker build -t "$IMAGE_FRONTEND" doodlestudent/front
- docker push "$IMAGE_FRONTEND"
- docker logout
# Deploy to Production
deploy_production:
stage: deploy
image: alpine:latest
dependencies:
- build_docker_frontend
rules:
- if: '$NEW_COMMIT == "true"'
- check_app_update
tags:
- docker
before_script:
- apk add --no-cache openssh-client docker-cli
- mkdir -p ~/.ssh
@@ -83,13 +96,18 @@ deploy_production:
- chmod 600 ~/.ssh/id_rsa
- ssh-keyscan -H "$DEPLOY_SERVER" >> ~/.ssh/known_hosts 2>/dev/null || true
script:
- source variables.env || true
- if [ "$NEW_COMMIT" != "true" ]; then
echo "No new commit, skipping build";
exit 0;
fi
- |
ssh "$DEPLOY_USER@$DEPLOY_SERVER" << 'EOF'
cd /app
docker compose pull
docker compose up -d
EOF
#environment:
#name: production
#url: http://127.0.0.1
when: manual
environment:
name: production
url: http://148.60.11.130
when: manual

3
.gitmodules vendored Normal file
View File

@@ -0,0 +1,3 @@
[submodule "doodlestudent"]
path = doodlestudent
url = https://github.com/barais/doodlestudent.git

View File

@@ -53,7 +53,6 @@
port: "{{ http_port }}"
proto: tcp
- name: Install munin
apt:
name:

1
doodlestudent Submodule

Submodule doodlestudent added at c51d096c7b