This commit is contained in:
parent
c718fcb17a
commit
f2b58cd094
@ -1 +0,0 @@
|
|||||||
DOCKER_TAG=dev-test-2
|
|
@ -1,44 +0,0 @@
|
|||||||
name: dev-test
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- dev-test
|
|
||||||
branches:
|
|
||||||
- 'dev-test*'
|
|
||||||
paths:
|
|
||||||
- '.ci/tag.env'
|
|
||||||
jobs:
|
|
||||||
build-and-push:
|
|
||||||
runs-on: docker
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
submodules: recursive
|
|
||||||
- name: Setup Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
- name: Login to Gitea Registry
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: git.4nkweb.com
|
|
||||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
|
||||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
||||||
- name: Sync submodules branches
|
|
||||||
run: |
|
|
||||||
bash scripts/sync_submodules.sh
|
|
||||||
- name: Build and push images
|
|
||||||
env:
|
|
||||||
REGISTRY: git.4nkweb.com
|
|
||||||
run: |
|
|
||||||
COMMIT_MSG=$(git log -1 --pretty=%B)
|
|
||||||
FROM_COMMIT=$(printf "%s" "$COMMIT_MSG" | sed -n 's/.*ci:[[:space:]]*docker_tag=\([^ ][^\n]*\).*/\1/p' | head -n1)
|
|
||||||
if [ -n "$FROM_COMMIT" ]; then
|
|
||||||
DOCKER_TAG="$FROM_COMMIT"
|
|
||||||
elif [ -f .ci/tag.env ]; then
|
|
||||||
# shellcheck disable=SC1091
|
|
||||||
. .ci/tag.env
|
|
||||||
else
|
|
||||||
DOCKER_TAG="${GITHUB_REF_NAME:-dev-test}"
|
|
||||||
fi
|
|
||||||
bash scripts/build_and_push.sh "$DOCKER_TAG"
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit 2f663d20a28ff0dc42ef0ebf29cc405329fd23a8
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit 6ced5d29231b711bd0c8eab591091c810d0147d7
|
|
@ -1,11 +0,0 @@
|
|||||||
# Submodules
|
|
||||||
|
|
||||||
## Déclaration
|
|
||||||
|
|
||||||
- Chaque sous-dépôt est déclaré dans `.gitmodules` avec `path`, `url`, `branch`.
|
|
||||||
|
|
||||||
## Bonnes pratiques
|
|
||||||
|
|
||||||
- Exécuter `git submodule sync --recursive` après modification de `.gitmodules`.
|
|
||||||
- Utiliser `git submodule update --init --recursive` pour initialiser.
|
|
||||||
- Éviter les chemins ambigus; respecter `modules/`, `deploy/`, `projects/<projet>/<repo>`.
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit 9e2d56383b1ddea92149f2e201cad630d5e57b30
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit 6e505b2f32467af5852928215d2dc18d26917824
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit cfa9514be9a5e4deae9dccb2fe03780b8707ea43
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit a78666b4a985e4e3e4deb19f4cbb10e4e4202c9b
|
|
@ -1,48 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -euo pipefail
|
|
||||||
IFS=$'\n\t'
|
|
||||||
|
|
||||||
echo "[sync] lecture des submodules depuis .gitmodules"
|
|
||||||
|
|
||||||
if [ ! -f .gitmodules ]; then
|
|
||||||
echo "[sync][erreur] .gitmodules introuvable dans $(pwd)" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Récupère la liste des sous-modules (noms logiques)
|
|
||||||
mapfile -t submodules < <(git config -f .gitmodules --name-only --get-regexp 'submodule\..*\.path' | sed -E 's/\.path$//')
|
|
||||||
|
|
||||||
for name in "${submodules[@]}"; do
|
|
||||||
path=$(git config -f .gitmodules --get "${name}.path" || true)
|
|
||||||
url=$(git config -f .gitmodules --get "${name}.url" || true)
|
|
||||||
branch=$(git config -f .gitmodules --get "${name}.branch" || echo "master")
|
|
||||||
|
|
||||||
if [ -z "${path}" ] || [ -z "${url}" ]; then
|
|
||||||
echo "[sync][warn] entrée incomplète pour ${name}, ignoré" >&2
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "[sync] => ${path} (${url}) branch=${branch}"
|
|
||||||
|
|
||||||
if [ ! -d "${path}/.git" ]; then
|
|
||||||
echo "[sync] init submodule ${path}"
|
|
||||||
git submodule update --init --recursive -- "${path}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "[sync] fetch ${path}"
|
|
||||||
git -C "${path}" fetch --all --prune
|
|
||||||
|
|
||||||
echo "[sync] checkout ${branch} dans ${path}"
|
|
||||||
if ! git -C "${path}" checkout "${branch}" 2>/dev/null; then
|
|
||||||
if git -C "${path}" rev-parse --verify "origin/${branch}" >/dev/null 2>&1; then
|
|
||||||
git -C "${path}" checkout -b "${branch}" "origin/${branch}"
|
|
||||||
else
|
|
||||||
echo "[sync][warn] branche ${branch} introuvable pour ${path}, on reste sur la branche courante" >&2
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "[sync] pull ${path}"
|
|
||||||
git -C "${path}" pull --ff-only || true
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "[sync] terminé"
|
|
Loading…
x
Reference in New Issue
Block a user