build: extract versions to versions.env and add PostCSS optimization#29
build: extract versions to versions.env and add PostCSS optimization#29sbaerlocher merged 2 commits intomainfrom
Conversation
Move collection versions to versions.env for cleaner Renovate management. Add PostCSS pipeline with autoprefixer and cssnano for CSS optimization.
build.sh
Outdated
| # renovate: datasource=galaxy-collection depName=arillso.container | ||
| ARILLSO_CONTAINER_VERSION="1.0.2" | ||
| # Load collection versions from versions.env | ||
| SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" |
There was a problem hiding this comment.
The SCRIPT_DIR computation here is redundant — the pushd at the top of the script already changes the working directory to the script's location. You can simplify the source to just:
| SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" | |
| source versions.env |
This avoids duplicating the $( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) expansion, which is already covered by pushd.
build.sh
Outdated
|
|
||
| # Install Ansible Collections | ||
| echo "Installing Ansible Collections..." | ||
| # echo "Using collections from Galaxy..." |
There was a problem hiding this comment.
Dead code — this commented-out echo shouldn't be committed. Either remove it or replace it with a meaningful log line if that was the intent.
| # echo "Using collections from Galaxy..." |
| # Optimize CSS and JS if postcss is available | ||
| if command -v postcss &> /dev/null; then | ||
| echo "Optimizing CSS with PostCSS (autoprefixer + cssnano)..." | ||
| postcss build/html/_static/custom.css \ |
There was a problem hiding this comment.
custom.css is not guaranteed to exist — it depends on the Sphinx theme generating it. If the file is absent, postcss will error out and fail the build. Add a guard:
| postcss build/html/_static/custom.css \ | |
| if command -v postcss &> /dev/null && [ -f build/html/_static/custom.css ]; then |
| @@ -0,0 +1,13 @@ | |||
| module.exports = { | |||
There was a problem hiding this comment.
There's no package.json in this PR to track postcss, autoprefixer, and cssnano as dependencies. Without it, contributors have no canonical way to install the right versions, and the versions are effectively unmanaged (and invisible to Renovate). Consider adding a minimal package.json with these as devDependencies.
- Remove redundant SCRIPT_DIR, use simple source since pushd already sets the working directory - Remove dead commented-out echo line - Add file existence guard for PostCSS optimization step - Add package.json with PostCSS devDependencies for reproducible installs
Summary
build.shtoversions.envfor cleaner Renovate dependency managementpostcss.config.js) with autoprefixer and cssnano for CSS optimization after buildTest plan
build.shcorrectly sources versions fromversions.envpostcssCLI is availableversions.env