debian-mirror-gitlab/scripts/frontend/startup_css/startup_css_changed.sh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

52 lines
1.3 KiB
Bash
Raw Normal View History

2021-09-04 01:27:46 +05:30
#!/bin/sh
echo "-----------------------------------------------------------"
echo "If you run into any issues with Startup CSS generation"
echo "please check out the feedback issue:"
echo ""
echo "https://gitlab.com/gitlab-org/gitlab/-/issues/331812"
echo "-----------------------------------------------------------"
2021-11-18 22:05:49 +05:30
startup_glob="app/assets/stylesheets/startup*"
if ! [ "$FOSS_ONLY" ]
then
startup_glob="*${startup_glob}"
fi
2021-09-04 01:27:46 +05:30
echo "Staging changes to '${startup_glob}' so we can check for untracked files..."
2021-09-30 23:02:18 +05:30
git add "${startup_glob}"
2021-09-04 01:27:46 +05:30
2021-09-30 23:02:18 +05:30
if [ -n "$(git diff HEAD --name-only -- "${startup_glob}")" ]; then
diff=$(git diff HEAD -- "${startup_glob}")
2021-09-04 01:27:46 +05:30
cat <<EOF
Startup CSS changes detected!
It looks like there have been recent changes which require
regenerating the Startup CSS files.
2021-09-30 23:02:18 +05:30
IMPORTANT:
2021-09-04 01:27:46 +05:30
2021-09-30 23:02:18 +05:30
- If you are making changes to any Startup CSS file, it is very likely that
**both** the CE and EE Startup CSS files will need to be updated.
- Changing any Startup CSS file will trigger the "as-if-foss" job to also run.
HOW TO FIX:
2021-09-04 01:27:46 +05:30
To fix this job, consider one of the following options:
2021-09-30 23:02:18 +05:30
1. (Strongly recommended) Copy and apply the diff below:
2. Regenerate locally with "yarn run generate:startup_css".
You may need to set "FOSS_ONLY=1" if you are trying to generate for CE.
2021-09-04 01:27:46 +05:30
----- start diff -----
$diff
----- end diff -------
EOF
exit 1
fi