forked from endoflife-date/endoflife.date
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate validation to Jekyll hooks (endoflife-date#2859)
Compared to the use of the validate.py script / validate.yaml workflow, this has the advantage of ensuring the validation is always performed. It also gives access to enriched data, which is useful for validated generated content, such as links. In addition to checks already implemented in the previous 'validate.py' script, this script: - Check that release dates are not too far in the future to avoid mistakes such as endoflife-date#3281 (max 30 days allowed). - Check all links are valid (even those in the products description). This check takes time and is not performed by default, but it can be triggered by setting the MUST_CHECK_URLS environment variable to true. To ensure links are regularly verified a new GitHub workflow, check-links.yml, has also been added. It runs every sunday at midnight. Note that: - Some links had to be excluded from the link validation because, despite being valid, they are sometime or systematically returning an error. - A dependency to open-uri (https://github.com/ruby/open-uri) has been added to simplify the validation of HTTP links. - The priority of the ProductDataEnricher plugin had to be set to normal, to allow hooks to be run before and after enrichment. - The deploy.sh has been cleaned-up and enriched with the deploy URL replacement originaly done in netlify.toml. Some alternate URLs has been changed or removed due to an enforcement of the rules regarding permalinks and alternate_urls (no more dots). Closes endoflife-date#1206, endoflife-date#2709, endoflife-date#3409.
- Loading branch information
1 parent
39ec87f
commit 88ff602
Showing
16 changed files
with
383 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Check URLs | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * 0' # At 00:00 on Sunday. | ||
|
||
jobs: | ||
check_urls: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout site | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 3.1 | ||
bundler-cache: true | ||
|
||
- name: Perform URLs check | ||
run: bundle exec jekyll build | ||
env: | ||
MUST_CHECK_URLS: true |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,24 @@ | ||
#!/bin/bash | ||
#!/bin/bash -e | ||
|
||
### Update latest information | ||
# See https://github.com/endoflife-date/endoflife.date/pull/2081 | ||
git submodule update --remote | ||
# Display context information | ||
echo "Current commit: $(git rev-parse HEAD)" | ||
echo "Ruby version: $(ruby --version)" | ||
echo "Python version: $(python --version)" | ||
echo "Jekyll version: $(bundle exec jekyll --version)" | ||
echo "Deploy URL: $1" | ||
|
||
# Update latest product information, see https://github.com/endoflife-date/endoflife.date/pull/2081 | ||
pip install -r requirements.txt | ||
# If the latest.py script fails, | ||
# We don't want to raise any errors | ||
# just undo the changes, and carry on | ||
if ! python3 _auto/latest.py ; then | ||
git checkout -- products/ | ||
git submodule update --remote | ||
if ! python3 _auto/latest.py ; then # if the latest.py script fails... | ||
git checkout -- products/ # ...just undo the changes, and carry on | ||
fi | ||
|
||
# Replace the Deploy URL with the Preview URL | ||
if [ -n "$1" ]; then | ||
echo "Replacing Deploy URL with Preview URL ($1)" | ||
sed -i "/url\:/curl\: $1" _config.yml | ||
fi | ||
|
||
# Finally, do a build | ||
bundle exec jekyll build | ||
# Finally, do a full build | ||
bundle exec jekyll build --trace |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.