Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion METADOC-SETTING-DOCS-DSL.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Children:
* a 2 or 3 element array of string that represents another setting split by `.`.
Example (to `setting.foo.mysetting`): `[ "settings", "foo", "mysetting" ]`
* `note` (optional, [string](https://toml.io/en/v1.0.0#string), markdownified): A non-dangerous, context setting piece of information.
Will have the heading “Note” andis rendered separately after the `description`
Will have the heading “Note” and is rendered separately after the `description`
* `warning` (optional, [string](https://toml.io/en/v1.0.0#string), markdownified): Information that warns the reader of potentially dangerous outcomes.
Will have the heading “Warning” and is rendered separately after the `description`
* `accepted_values` (optional, [array](https://toml.io/en/v1.0.0#array) of [string](https://toml.io/en/v1.0.0#string), each string is markdownified): A representation of allowed values, typically for enums where there are specific allowable strings in a setting value.
Expand Down
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@ preview_finch:
-v "${PWD}":/src \
-p 1313:1313 \
hugomods/hugo:exts-0.123.8 \
hugo server -w --bind=0.0.0.0

hugo server -w --bind=0.0.0.0 --disableFastRender --poll 700ms

mdlint:
docker run --rm \
-v "$$(pwd)":/workdir \
ghcr.io/igorshubovych/markdownlint-cli:latest \
"**/*.md"

mdlint_finch:
finch run --rm \
-v "$(pwd)":/workdir \
ghcr.io/igorshubovych/markdownlint-cli:latest \
"**/*.md"
6 changes: 3 additions & 3 deletions scripts/nvidia-driver-versions/create_data_file_from_cargo.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

FNAME="$(echo $1 | awk -F/ '{print $(NF-1)}')"
FNAME="$(echo "$1" | awk -F/ '{print $(NF-1)}')"
EXTRACTED="# Extracted from https://github.com/bottlerocket-os/bottlerocket/tree/develop/packages/$FNAME/Cargo.toml"
echo $EXTRACTED > $2$FNAME.toml
cat $1 >> $2$FNAME.toml
echo "$EXTRACTED" >"$2""$FNAME".toml
cat "$1" >>"$2""$FNAME".toml
6 changes: 3 additions & 3 deletions scripts/nvidia-driver-versions/create_markdown.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/bin/bash

mkdir $1/$2
mkdir -p "$1"/"$2"

cat << EOF > $1/$2/index.markdown
cat <<EOF >"$1"/"$2"/index.markdown
+++
title = "${2}"
description = "Drivers included in each GPU-enabled variant"
type = "docs"
+++

{{< nvidia-versions >}}
EOF
EOF
2 changes: 1 addition & 1 deletion scripts/nvidia-driver-versions/get_cargos.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash

# find $1/* -name "Cargo.toml" -exec bash create_data_file_from_cargo.sh {} $2 \;
find $1/packages/kmod-* -name "Cargo.toml" -exec bash create_data_file_from_cargo.sh {} $2 \;
find "$1"/packages/kmod-* -name "Cargo.toml" -exec bash create_data_file_from_cargo.sh {} "$2" \;
10 changes: 9 additions & 1 deletion scripts/software-versions-inventory/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,15 @@ On macOS with `brew`, run `brew install rpm` to get the `rpmspec` command.

## Running the script

1. Run `./software-versions-inventory.sh PATH_TO_BOTTLEROCKET_OS_REPO > packages.markdown`, where `PATH_TO_BOTTLEROCKET_OS_REPO` is the path to the Bottlerocket OS repository from which you want to extract package versions.
1. software-versions-index.sh

`./software-versions-index.sh BOTTLEROCKET_RELEASE_VERSION PATH_TO_BOTTLEROCKET_OS_REPO > _index.markdown`

1. software-versions-inventory.sh

`./software-versions-inventory.sh BOTTLEROCKET_RELEASE_VERSION PATH_TO_BOTTLEROCKET_OS_REPO > packages.markdown`

Where `PATH_TO_BOTTLEROCKET_OS_REPO` is the path to the Bottlerocket OS repository from which you want to extract package versions.

## Script output

Expand Down
10 changes: 10 additions & 0 deletions scripts/software-versions-inventory/software-versions-index.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

bottlerocket_release=$1

printf "+++\n"
printf "title=\"%s Package Versions\"\n" "$bottlerocket_release"
printf "type=\"docs\"\n"
printf "description=\"Versions of packages included in the %s release of Bottlerocket\"\n" "$bottlerocket_release"
printf "+++\n"
printf "\n"
48 changes: 29 additions & 19 deletions scripts/software-versions-inventory/software-versions-inventory.sh
Original file line number Diff line number Diff line change
@@ -1,34 +1,44 @@
#!/bin/bash

bottlerocket_release=$(grep "version =" $1/Release.toml | cut -d "=" -f 2 | tr -d '"')
bottlerocket_release=$1
# Find kit name
kit_name=""
for file in "$2"/kits/*kit*; do
if [ -f "$file" ] || [ -d "$file" ]; then
kit_name=$(basename "$file" | cut -d "-" -f2)
# Capitalize first letter
first_char=$(echo "${kit_name:0:1}" | tr '[:lower:]' '[:upper:]')
kit_name="${first_char}${kit_name:1}"
break
fi
done
kit_release=$(grep "release-version =" "$2"/Twoliter.toml | cut -d "=" -f 2 | tr -d '"' | tr -d " ")
printf "%s\n" "---"
printf "title: \"%s\"\n" $bottlerocket_release
printf "title: \"%s Kit packages %s\"\n" "$kit_name" "$kit_release"
printf "type: \"docs\"\n"
printf "description: \"Package Versions in Bottlerocket Release %s\"\n" $bottlerocket_release
printf "description: \"%s Kit Package Versions in Bottlerocket Release %s\"\n" "$kit_name" "$bottlerocket_release"
printf "packages:\n"
for d in $(find $1/packages -maxdepth 1 -type d | sort)
do
if [ $d != $1/packages ]; then
base=$(basename $d)
rpmspec -q --qf "%{Version}:" $d/$base.spec --define="_cross_os _" --nodebuginfo --quiet &> /dev/null
for d in $(find "$2"/packages -maxdepth 1 -type d | sort); do
if [ "$d" != "$2"/packages ]; then
package_name=$(basename "$d")
# rpmspec -q --qf "%{Version}:" "$d"/"$package_name".spec --define="_cross_os _" --nodebuginfo --quiet &> /dev/null

if [ $? -eq 0 ]; then
version=$(rpmspec -q --qf "%{Version}:" $d/$base.spec --define="_cross_os _" --nodebuginfo)
if version=$(rpmspec -q --qf "%{Version}:" "$d"/"$package_name".spec --define="_cross_os _" --nodebuginfo 2>/dev/null); then
# version=$(rpmspec -q --qf "%{Version}:" "$d"/"$package_name".spec --define="_cross_os _" --nodebuginfo)

printf "%2s" " "
printf "%s\r\n" "- package: $base"
printf "%4s" " "
printf "%s\r\n" "- package: $package_name"
printf "%4s" " "
printf "%s" "version: "
printf "%s\n" "$version" | cut -d":" -f1
patch_count=`find $d -type f -name "*.patch" | wc -l`
if [ $patch_count -gt 0 ]; then
patches=`find $d -type f -name "*.patch"`
patch_count=$(find "$d" -type f -name "*.patch" | wc -l)
if [ "$patch_count" -gt 0 ]; then
patches=$(find "$d" -type f -name "*.patch")
printf "%4s" " "
printf "%s\n" "patches:"
for patch in $patches
do
patch_file=$(basename $patch)
printf "%6s" " "
for patch in $patches; do
patch_file=$(basename "$patch")
printf "%6s" " "
printf "%s\n" "- \"$patch_file\""
done
fi
Expand Down
11 changes: 5 additions & 6 deletions scripts/variant-kernel/create_data_file_from_cargo.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#!/bin/bash

FNAME="$(echo $1 | awk -F/ '{print $(NF-1)}')"
FNAME="$(echo "$1" | awk -F/ '{print $(NF-1)}')"
EXTRACTED="# Extracted from https://github.com/bottlerocket-os/bottlerocket/variants/$FNAME/Cargo.toml"
if [ "$FNAME" != "variants" ]
then
echo $EXTRACTED > $2$FNAME.toml
cat $1 >> $2$FNAME.toml
fi
if [ "$FNAME" != "variants" ]; then
echo "$EXTRACTED" >"$2""$FNAME".toml
cat "$1" >>"$2""$FNAME".toml
fi
2 changes: 1 addition & 1 deletion scripts/variant-kernel/get_cargos.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

find $1/* -name "Cargo.toml" -exec bash create_data_file_from_cargo.sh {} $2 \;
find "$1"/* -name "Cargo.toml" -exec bash create_data_file_from_cargo.sh {} "$2" \;
27 changes: 21 additions & 6 deletions scripts/website-boiler-plate-generator/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,36 @@
# Script: Copy documentation from previous minor version to current minor version
# Script: Update Bottlerocket Website Content

This script is used to generate the data for `content/[lang]/os/[version]/` and `data/settings/[version]`. You will need to run it on every minor version before running any other script.
This script is used to update the Bottlerocket website content for a new version. It copies data from the previous minor version, updates version labels, and generates new content for `content/[lang]/os/[version]/` and `data/settings/[version]`.

## Prerequisites

This script works on Linux or MacOS and is unlikely to work in Windows.
- This script works on Linux or MacOS and is unlikely to work in Windows.
- Git must be installed and configured with access to the Bottlerocket repositories.
- You need internet access to clone the required repositories.

## Running the script

There is one script in this directory:

- `copy_files_from_prev_version.sh`: Copies contents from previous minor version to current minor version and removes unnecessary files. The only argument it accepts is the version (usually the latest) for which we want to copy content.
- `update_website.sh`: Updates website content for a new Bottlerocket version. It copies content from the previous minor version, updates version labels, and generates new content including package information, NVIDIA driver data, and kernel version information.

### Usage

As an example, if we want to copy the contents from 1.25 to 1.26, then, you can run the following:
The script uses flag-based arguments:
- `-b`: Bottlerocket version in X.Y.Z format
- `-c`: Core Kit version in X.Y.Z format
- `-k`: Kernel Kit version in X.Y.Z format
- `-h`: Show help message

For example, if you want to update the website for Bottlerocket version 1.40.0 with Core Kit version 8.2.0 and Kernel Kit version 2.5.1:

```bash
./copy_files_from_prev_version.sh 1.26.0
./update_website.sh -b 1.40.0 -c 8.2.0 -k 2.5.1
```

The script will:
1. Clone the necessary repositories at the specified versions
2. Copy content from the previous minor version (e.g., 1.25.x to 1.26.x)
3. Update version labels in the content
4. Generate new package version data, NVIDIA information, and kernel version information
5. Clean up temporary files when complete

This file was deleted.

Loading