add gitlab ci
This commit is contained in:
@@ -51,4 +51,46 @@ run = '''
|
||||
set -euo pipefail
|
||||
cd backend && staticcheck ./...
|
||||
cd ../mobile-kotlin && ./gradlew :app:lint -q
|
||||
'''
|
||||
|
||||
[tasks.build:release]
|
||||
description = "Build signed release APK (assembleRelease)"
|
||||
dir = "mobile-kotlin"
|
||||
run = '''
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
if [ ! -f app/signing.properties ] && [ -z "${SIGNING_STORE_FILE:-}" ]; then
|
||||
echo "signing.properties absent — copiez app/signing.properties.example et"
|
||||
echo "préparez un keystore, ou fournissez SIGNING_STORE_FILE (CI)." >&2
|
||||
exit 1
|
||||
fi
|
||||
./gradlew :app:assembleRelease -q
|
||||
echo "APK : app/build/outputs/apk/release/app-release.apk"
|
||||
'''
|
||||
|
||||
[tasks.docker:build]
|
||||
description = "Build the backend Docker image (tagged with VERSION)"
|
||||
run = '''
|
||||
set -euo pipefail
|
||||
VERSION=$(cat VERSION)
|
||||
docker build \\
|
||||
--build-arg VERSION="$VERSION" \\
|
||||
--build-arg BUILD_DATE="$(date -u +%Y-%m-%dT%H:%M:%SZ)" \\
|
||||
-t vaultdrop-server:"$VERSION" \\
|
||||
./backend
|
||||
echo "Image : vaultdrop-server:$VERSION"
|
||||
'''
|
||||
|
||||
[tasks.release]
|
||||
description = "Local release checklist: test, build artifacts, tag, push"
|
||||
run = '''
|
||||
set -euo pipefail
|
||||
VERSION=$(cat VERSION)
|
||||
echo ">>> Version : $VERSION (tag cible v$VERSION)"
|
||||
mise run test
|
||||
mise run build
|
||||
mise run docker:build
|
||||
echo
|
||||
echo "Prêt à tagger ? La CI GitLab construira la release finale à partir du tag."
|
||||
echo " git tag v$VERSION && git push origin v$VERSION"
|
||||
'''
|
||||
Reference in New Issue
Block a user