Skip to content

Commit

Permalink
Source version.txt to get version information
Browse files Browse the repository at this point in the history
This guards against possible quotes.
  • Loading branch information
krnowak committed Oct 26, 2023
1 parent bdfad35 commit f2dab49
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion content/docs/latest/installing/cloud/azure.md
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ resource_group_location = "westeurope"
You can resolve the latest Flatcar Stable version with this shell command:

```
curl -sSfL https://stable.release.flatcar-linux.net/amd64-usr/current/version.txt | grep -m 1 FLATCAR_VERSION_ID= | cut -d = -f 2
(source <(curl -sSfL https://stable.release.flatcar-linux.net/amd64-usr/current/version.txt); echo "${FLATCAR_VERSION_ID}")
```

The machine name listed in the `machines` variable is used to retrieve the corresponding [Container Linux Config](../../provisioning/config-transpiler/configuration) template from the `cl/` subfolder.
Expand Down
4 changes: 2 additions & 2 deletions content/docs/latest/installing/cloud/digitalocean.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ read SSH_KEY_ID
If not done yet, [create a custom image](https://developers.digitalocean.com/documentation/v2/#create-a-custom-image) from the current Flatcar Container Linux Stable version:

```shell
VER=$(curl https://stable.release.flatcar-linux.net/amd64-usr/current/version.txt | grep -m 1 FLATCAR_VERSION_ID= | cut -d = -f 2)
VER=$(source <(curl https://stable.release.flatcar-linux.net/amd64-usr/current/version.txt); echo "${FLATCAR_VERSION_ID}")
curl --request POST "https://api.digitalocean.com/v2/images" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer $TOKEN" \
Expand Down Expand Up @@ -339,7 +339,7 @@ flatcar_stable_version = "x.y.z"
You can resolve the latest Flatcar Stable version with this shell command:

```shell
curl -sSfL https://stable.release.flatcar-linux.net/amd64-usr/current/version.txt | grep -m 1 FLATCAR_VERSION_ID= | cut -d = -f 2
(source <(curl -sSfL https://stable.release.flatcar-linux.net/amd64-usr/current/version.txt); echo "${FLATCAR_VERSION_ID}")
```

The machine name listed in the `machines` variable is used to retrieve the corresponding [Butane Config](https://www.flatcar.org/docs/latest/provisioning/config-transpiler/configuration/).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ core@host ~ $ sudo systemctl reboot
If it fails due to SSL connection issues from outdated certificates, you can also download the update payload of the latest Stable release through plain HTTP and use the `flatcar-update` script instead:

```shell
$ VER=$(curl -fsSL --insecure --ssl-no-revoke http://stable.release.flatcar-linux.net/amd64-usr/current/version.txt | grep FLATCAR_VERSION= | cut -d = -f 2)
$ VER=$(source <(curl -fsSL --insecure --ssl-no-revoke http://stable.release.flatcar-linux.net/amd64-usr/current/version.txt); echo "${FLATCAR_VERSION}")
$ wget --no-check-certificate "http://update.release.flatcar-linux.net/amd64-usr/$VER/flatcar_production_update.gz"
$ wget --no-check-certificate http://raw.githubusercontent.com/flatcar/init/flatcar-master/bin/flatcar-update
$ less flatcar-update # Double check the content of the script
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ In some cases such a file can pin an exact version of a specific package, which
Some packages like `coreos-modules` take a long time to build. Use:

```shell
./build_packages --getbinpkgver=$(gsutil cat gs://…/boards/amd64-usr/current-master/version.txt |& sed -n 's/^FLATCAR_VERSION=//p')
./build_packages --getbinpkgver=$(source <(gsutil cat gs://…/boards/amd64-usr/current-master/version.txt); echo "${FLATCAR_VERSION}")
```

to use packages from the another build store.
Expand Down
2 changes: 1 addition & 1 deletion content/docs/latest/setup/releases/switching-channels.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ $ # In case another channel is set as GROUP, first remove it so that in the futu
$ sudo sed -i "/GROUP=.*/d" /etc/flatcar/update.conf
$ # Set the channel you want to jump to:
$ CHANNEL=beta
$ VER=$(curl -fsSL "https://$CHANNEL.release.flatcar-linux.net/amd64-usr/current/version.txt" | grep FLATCAR_VERSION= | cut -d = -f 2)
$ VER=$(source <(curl -fsSL "https://$CHANNEL.release.flatcar-linux.net/amd64-usr/current/version.txt"); echo "${FLATCAR_VERSION}")
$ sudo flatcar-update --to-version "$VER"
```

Expand Down
4 changes: 2 additions & 2 deletions content/docs/latest/setup/releases/update-strategies.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ The `flatcar-update` tool automatically removes the `SERVER=disabled` line to ap

```shell
$ # For example, update to the latest Stable release:
$ VER=$(curl -fsSL https://stable.release.flatcar-linux.net/amd64-usr/current/version.txt | grep FLATCAR_VERSION= | cut -d = -f 2)
$ VER=$(source <(curl -fsSL https://stable.release.flatcar-linux.net/amd64-usr/current/version.txt); echo "${FLATCAR_VERSION}")
$ sudo flatcar-update --to-version $VER
```

Expand Down Expand Up @@ -236,7 +236,7 @@ On the non-airgapped machine (here for amd64, use `ARCH=arm64` for arm64):

```shell
ARCH=amd64
VER=$(curl -fsSL https://stable.release.flatcar-linux.net/${ARCH}-usr/current/version.txt | grep FLATCAR_VERSION= | cut -d = -f 2)
VER=$(source <(curl -fsSL "https://stable.release.flatcar-linux.net/${ARCH}-usr/current/version.txt"; echo "${FLATCAR_VERSION}")
echo "$VER"
# or if you know which version to update to, set it like VER=3033.2.1 (no channel info needed)
wget "https://update.release.flatcar-linux.net/${ARCH}-usr/${VER}/flatcar_production_update.gz"
Expand Down

0 comments on commit f2dab49

Please sign in to comment.