particle-os-cli/integration-tests/mock-scripts/rpm-ostree
Gerald Pinder 02b2fe5434
refactor!: Rename template to generate and move rebase/upgrade under switch (#116)
This updates the `template` subcommand to be `generate`. The `template`
usage will continue to work as an alias to `generate`. A new `switch`
command is added that will manage both `rpm-ostree rebase` and
`rpm-ostree upgrade` and is fully replacing the respective subcommands
as a breaking change.

The new `switch` command is under the feature flag `switch` and will
currently only build for the `main` branch builds until it is moved as a
default feature (`v0.9.0`).

Closes #159
2024-05-26 22:47:34 -04:00

34 lines
765 B
Bash
Executable file

#!/bin/bash
set -euo pipefail
if [ "$1" = "rebase" ]; then
if [ "$2" = "ostree-unverified-image:oci-archive:$BB_TEST_LOCAL_IMAGE" ]; then
echo "Rebased to local image $BB_TEST_LOCAL_IMAGE"
else
echo "Failed to rebase"
exit 1
fi
elif [ "$1" = "upgrade" ]; then
echo "Performing upgrade for $BB_TEST_LOCAL_IMAGE"
elif [ "$1" = "status" ]; then
cat <<EOF
{
"deployments": [
{
"container-image-reference": "ostree-image-signed:docker://ghcr.io/blue-build/cli/test",
"booted": true,
"staged": false
},
{
"container-image-reference": "ostree-image-signed:docker://ghcr.io/blue-build/cli/test:last",
"booted": false,
"staged": false
}
]
}
EOF
else
echo "Arg $1 is not recognized"
exit 1
fi