mirror of
https://gitlab.com/soapbox-pub/mkstack.git
synced 2025-08-27 04:59:22 +00:00
revert gitlab-ci to upstream version for now
This commit is contained in:
parent
36237fd5b6
commit
0c039bfbcf
@ -11,52 +11,14 @@ stages:
|
|||||||
test:
|
test:
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- |
|
- npm run test
|
||||||
# Check if this is a non-forked execution on soapbox-pub/mkstack
|
|
||||||
if [ "$CI_PROJECT_NAMESPACE" = "soapbox-pub" ] && [ "$CI_PROJECT_NAME" = "mkstack" ] && [ "$CI_PROJECT_PATH" = "soapbox-pub/mkstack" ]; then
|
|
||||||
echo "Running on soapbox-pub/mkstack - applying template-specific test logic"
|
|
||||||
|
|
||||||
# Run npm test and capture output and exit code
|
|
||||||
set +e
|
|
||||||
test_output=$(npm run test 2>&1)
|
|
||||||
test_exit_code=$?
|
|
||||||
set -e
|
|
||||||
|
|
||||||
echo "$test_output"
|
|
||||||
|
|
||||||
# Check if the output contains exactly 6 linting problems
|
|
||||||
if echo "$test_output" | grep -q "✖ 6 problems (6 errors, 0 warnings)"; then
|
|
||||||
echo "✅ Expected 6 linting errors found - template is correctly configured"
|
|
||||||
exit 0
|
|
||||||
elif [ $test_exit_code -eq 0 ]; then
|
|
||||||
echo "✅ Tests passed with no linting errors"
|
|
||||||
exit 0
|
|
||||||
else
|
|
||||||
echo "❌ Unexpected test failure or wrong number of linting errors"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "Running on fork or different project - using standard test behavior"
|
|
||||||
npm run test
|
|
||||||
fi
|
|
||||||
|
|
||||||
pages:
|
pages:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
script:
|
script:
|
||||||
- |
|
- npm run build
|
||||||
# Check if this is a non-forked execution on soapbox-pub/mkstack
|
- rm -rf public
|
||||||
if [ "$CI_PROJECT_NAMESPACE" = "soapbox-pub" ] && [ "$CI_PROJECT_NAME" = "mkstack" ] && [ "$CI_PROJECT_PATH" = "soapbox-pub/mkstack" ]; then
|
- mv dist public
|
||||||
echo "Running on soapbox-pub/mkstack - proceeding with deployment"
|
|
||||||
npm run build
|
|
||||||
rm -rf public
|
|
||||||
mv dist public
|
|
||||||
else
|
|
||||||
echo "Running on fork or different project - skipping deployment"
|
|
||||||
echo "This is expected behavior for forks"
|
|
||||||
# Create a minimal public directory to avoid job failure
|
|
||||||
mkdir -p public
|
|
||||||
echo "<html><body><h1>Deployment skipped for fork</h1><p>This deployment is only active on soapbox-pub/mkstack</p></body></html>" > public/index.html
|
|
||||||
fi
|
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- public
|
- public
|
||||||
|
Loading…
x
Reference in New Issue
Block a user