Mirror full styleguide docs into portal repo on sync
This commit is contained in:
@@ -2,7 +2,10 @@
|
|||||||
|
|
||||||
## Ziel
|
## Ziel
|
||||||
|
|
||||||
Der Styleguide bleibt in diesem Repository die Source of Truth. Das Portal holt den Stand versioniert als `public/assets/styleguide.upstream.css`.
|
Der Styleguide bleibt in diesem Repository die Source of Truth. Das Portal holt:
|
||||||
|
|
||||||
|
- den deploy-relevanten CSS-Upstream versioniert als `public/assets/styleguide.upstream.css`
|
||||||
|
- die vollstaendige Styleguide-Dokumentation gespiegelt nach `docs/styleguide`
|
||||||
|
|
||||||
## Vorbereitung
|
## Vorbereitung
|
||||||
|
|
||||||
@@ -30,6 +33,7 @@ Optional kann der Zielpfad ueberschrieben werden:
|
|||||||
|
|
||||||
- `public/assets/styleguide.upstream.css` aktualisiert
|
- `public/assets/styleguide.upstream.css` aktualisiert
|
||||||
- `public/assets/styleguide.upstream.meta.json` aktualisiert (Version, Commit, Zeitstempel)
|
- `public/assets/styleguide.upstream.meta.json` aktualisiert (Version, Commit, Zeitstempel)
|
||||||
|
- `docs/styleguide` gespiegelt (mit `--delete`, ohne `.git`, `.codex`, `scripts/`)
|
||||||
- Optional: automatischer Commit + Push im Portalrepo
|
- Optional: automatischer Commit + Push im Portalrepo
|
||||||
|
|
||||||
## Standardprozess je Release
|
## Standardprozess je Release
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ VERSION_FILE="$STYLEGUIDE_REPO_ROOT/VERSION"
|
|||||||
PORTAL_REPO_PATH="/Users/mathias/Documents/Dokumente Chouchou/Codebases/WebApp_Aktienberater"
|
PORTAL_REPO_PATH="/Users/mathias/Documents/Dokumente Chouchou/Codebases/WebApp_Aktienberater"
|
||||||
PORTAL_CSS_REL="public/assets/styleguide.upstream.css"
|
PORTAL_CSS_REL="public/assets/styleguide.upstream.css"
|
||||||
PORTAL_META_REL="public/assets/styleguide.upstream.meta.json"
|
PORTAL_META_REL="public/assets/styleguide.upstream.meta.json"
|
||||||
|
PORTAL_STYLEGUIDE_DOCS_REL="docs/styleguide"
|
||||||
COMMIT_IN_PORTAL="false"
|
COMMIT_IN_PORTAL="false"
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
@@ -62,11 +63,21 @@ fi
|
|||||||
|
|
||||||
PORTAL_CSS_PATH="$PORTAL_REPO_PATH/$PORTAL_CSS_REL"
|
PORTAL_CSS_PATH="$PORTAL_REPO_PATH/$PORTAL_CSS_REL"
|
||||||
PORTAL_META_PATH="$PORTAL_REPO_PATH/$PORTAL_META_REL"
|
PORTAL_META_PATH="$PORTAL_REPO_PATH/$PORTAL_META_REL"
|
||||||
|
PORTAL_STYLEGUIDE_DOCS_PATH="$PORTAL_REPO_PATH/$PORTAL_STYLEGUIDE_DOCS_REL"
|
||||||
|
|
||||||
mkdir -p "$(dirname "$PORTAL_CSS_PATH")"
|
mkdir -p "$(dirname "$PORTAL_CSS_PATH")"
|
||||||
|
mkdir -p "$PORTAL_STYLEGUIDE_DOCS_PATH"
|
||||||
|
|
||||||
cp "$SOURCE_CSS" "$PORTAL_CSS_PATH"
|
cp "$SOURCE_CSS" "$PORTAL_CSS_PATH"
|
||||||
|
|
||||||
|
rsync -a --delete \
|
||||||
|
--exclude ".git/" \
|
||||||
|
--exclude ".codex/" \
|
||||||
|
--exclude ".DS_Store" \
|
||||||
|
--exclude "scripts/" \
|
||||||
|
"$STYLEGUIDE_REPO_ROOT/" \
|
||||||
|
"$PORTAL_STYLEGUIDE_DOCS_PATH/"
|
||||||
|
|
||||||
STYLEGUIDE_VERSION="$(tr -d '[:space:]' < "$VERSION_FILE")"
|
STYLEGUIDE_VERSION="$(tr -d '[:space:]' < "$VERSION_FILE")"
|
||||||
STYLEGUIDE_COMMIT="$(git -C "$STYLEGUIDE_REPO_ROOT" rev-parse --short HEAD)"
|
STYLEGUIDE_COMMIT="$(git -C "$STYLEGUIDE_REPO_ROOT" rev-parse --short HEAD)"
|
||||||
SYNCED_AT="$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
|
SYNCED_AT="$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
|
||||||
@@ -76,12 +87,13 @@ cat > "$PORTAL_META_PATH" <<META
|
|||||||
"styleguideVersion": "$STYLEGUIDE_VERSION",
|
"styleguideVersion": "$STYLEGUIDE_VERSION",
|
||||||
"styleguideCommit": "$STYLEGUIDE_COMMIT",
|
"styleguideCommit": "$STYLEGUIDE_COMMIT",
|
||||||
"syncedAtUtc": "$SYNCED_AT",
|
"syncedAtUtc": "$SYNCED_AT",
|
||||||
"sourceRepo": "$STYLEGUIDE_REPO_ROOT"
|
"sourceRepo": "$STYLEGUIDE_REPO_ROOT",
|
||||||
|
"mirroredDocsPath": "$PORTAL_STYLEGUIDE_DOCS_REL"
|
||||||
}
|
}
|
||||||
META
|
META
|
||||||
|
|
||||||
if [[ "$COMMIT_IN_PORTAL" == "true" ]]; then
|
if [[ "$COMMIT_IN_PORTAL" == "true" ]]; then
|
||||||
git -C "$PORTAL_REPO_PATH" add "$PORTAL_CSS_REL" "$PORTAL_META_REL"
|
git -C "$PORTAL_REPO_PATH" add -A "$PORTAL_CSS_REL" "$PORTAL_META_REL" "$PORTAL_STYLEGUIDE_DOCS_REL"
|
||||||
if ! git -C "$PORTAL_REPO_PATH" diff --cached --quiet; then
|
if ! git -C "$PORTAL_REPO_PATH" diff --cached --quiet; then
|
||||||
git -C "$PORTAL_REPO_PATH" commit -m "Sync styleguide $STYLEGUIDE_VERSION"
|
git -C "$PORTAL_REPO_PATH" commit -m "Sync styleguide $STYLEGUIDE_VERSION"
|
||||||
git -C "$PORTAL_REPO_PATH" push
|
git -C "$PORTAL_REPO_PATH" push
|
||||||
@@ -95,3 +107,4 @@ fi
|
|||||||
|
|
||||||
echo "Synced $SOURCE_CSS -> $PORTAL_CSS_PATH"
|
echo "Synced $SOURCE_CSS -> $PORTAL_CSS_PATH"
|
||||||
echo "Metadata written: $PORTAL_META_PATH"
|
echo "Metadata written: $PORTAL_META_PATH"
|
||||||
|
echo "Mirrored styleguide docs: $PORTAL_STYLEGUIDE_DOCS_PATH"
|
||||||
|
|||||||
Reference in New Issue
Block a user