Skip to content

Conversation

@neilcook
Copy link
Contributor

@neilcook neilcook commented Dec 2, 2025

No description provided.

@neilcook
Copy link
Contributor Author

neilcook commented Dec 3, 2025

Currently waiting for the harbor password before this will pass tests.

@neilcook neilcook requested a review from Luit December 4, 2025 09:24
Copy link

@Luit Luit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the bash scripts could use a full ShellCheck, but I'll leave it up to you whether to do that right now or later.


docker run -v "${PWD}:${PWD}" $image sh -c "pip install mkdocs-swagger-ui-tag && mkdocs build -f $mkdocs_file -d ${PWD}/output/${version}"

latestVersion=`aws s3 ls s3://"${AWS_S3_BUCKET_DOCS}"/docs.powerdns.com/$subdir/ | awk '{print $2}' | grep -v latest | awk -F '/' '/\// {print $1}' | sort -V | tail -1`
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this all comes verbatim from a different repo, but this line I didn't even fire up ShellCheck for to know it'll complain. Please use $(...) instead of the legacy backtick style command substitution.


on:
push:
# docs is the branch on which we are developing this, can be removed later
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the comment as well?

# - AWS_SECRET_ACCESS_KEY: The AWS secret access key
# - AWS_REGION: The AWS region where resources are located
# - AWS_S3_BUCKET_DOCS: The name of the S3 bucket for documentation
# - BUILD_PATH: The root of the lightningstream directory
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I often prefer something like the following for finding my script dir, which seems to be the only reason for this required var:

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This var disappears in the GH Action version anyway

Comment on lines +56 to +64
while read -r docsVersion; do
if [ "$docsVersion" != "" ] && [ "$docsVersion" != "latest" ]; then
if [ $docsVersion == $latestVersion ]; then
versionsData=$(echo $versionsData | jq ". += [{\"title\": \"${docsVersion}\", \"version\": \"${latestVersion}\", \"aliases\": [\"latest\"]}]")
else
versionsData=$(echo $versionsData | jq ". += [{\"title\": \"${docsVersion}\", \"version\": \"${docsVersion}\", \"aliases\": []}]")
fi
fi
done < <(aws s3 ls s3://"${AWS_S3_BUCKET_DOCS}"/docs.powerdns.com/$subdir/ | awk '{print $2}' | awk -F '/' '/\// {print $1}')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems a bit convoluted when the aws s3 ls command has an --output json option.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The --output flag is ignored for the ls command. From the help:

Note that the --output and --no-paginate arguments are ignored for this command.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strange, there's no mention of that on https://docs.aws.amazon.com/cli/latest/reference/s3/ls.html

There's the option to use aws s3api though, I found when looking up this issue...

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh my, it is there, but Ctrl+F "--output" won't find it, because the -- is turned into a by their docs 🤦🏻

@neilcook
Copy link
Contributor Author

neilcook commented Dec 9, 2025

I think all the review comments are valid, however I'm going to apply them in the new repo for the GH Action, and then refactor this PR to just use that.

@neilcook neilcook closed this Dec 11, 2025
@neilcook neilcook deleted the docs branch December 11, 2025 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants