Skip to content

Commit

Permalink
site: upgrade to v0.9.0-alpha.5
Browse files Browse the repository at this point in the history
Includes:

* Upgrade to go1.22.3 in Docker image
* Add 'cue mod fix' to generated docs
* Generated CLI docs changes from the alpha.5 version of CUE
* Content changes related to 'cue mod init' not adding v0 to module path
* Playground changes relating to vendored "internal" code from upstream
  CUE. No impact on behaviour.

Preprocessor-No-Write-Cache: true
Signed-off-by: Paul Jolly <paul@myitcv.io>
Change-Id: I5f2f7d6b04fbdf1b262aa61bf215470d8e72d828
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cuelang.org/+/1194849
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
  • Loading branch information
myitcv committed May 17, 2024
1 parent 84dc198 commit 2300001
Show file tree
Hide file tree
Showing 33 changed files with 217 additions and 176 deletions.
1 change: 1 addition & 0 deletions content/docs/reference/cli/commands.cue
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ cue: {
login: _
mod: _
"mod edit": _
"mod fix": _
"mod get": _
"mod init": _
"mod publish": _
Expand Down
10 changes: 10 additions & 0 deletions content/docs/reference/cli/cue-mod-fix/en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
WARNING: "Code generated site_tool.cue; DO NOT EDIT."
title: "cue mod fix"
tags:
- cue command
---

{{{with script "en" "cue cli help text"}}}
cue help mod fix
{{{end}}}
4 changes: 4 additions & 0 deletions content/docs/reference/cli/cue-mod-fix/page.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Code generated site_tool.cue; DO NOT EDIT.
package site

{"content":{"docs":{"reference":{"cli":{"cue-mod-fix":{"page":{}}}}}}}
2 changes: 1 addition & 1 deletion hugo/config/_default/params.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ logo = "svg/logo.svg"
[notification]
type = 'test'

content = '**Note:** documentation on this site relies on CUE v0.9.0-alpha.4'
content = '**Note:** documentation on this site relies on CUE v0.9.0-alpha.5'
[notification.button]
link = 'https://github.com/cue-lang/cue/releases'
icon = 'download'
Expand Down
33 changes: 17 additions & 16 deletions hugo/content/en/docs/reference/cli/cue-cmd/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ tags:
$ cue help cmd
cmd executes the named command for each of the named instances.
Commands define actions on instances. For example, they may
specify how to upload a configuration to Kubernetes. Commands are
defined directly in tool files, which are regular CUE files
within the same package with a filename ending in _tool.cue.
These are typically defined at the module root so that they apply
to all instances.
Workflow commands define actions on instances. For example, they
may specify how to upload a configuration to Kubernetes. Workflow
commands are defined directly in tool files, which are regular
CUE files within the same package with a filename ending in
_tool.cue. These are typically defined at the module root so
that they apply to all instances.
Each command consists of one or more tasks. A task may, for
example, load or write a file, consult a user on the command
Expand All @@ -35,8 +35,8 @@ Available tasks can be found in the package documentation at
Examples:
In this simple example, we define a command called "hello",
which declares a single task called "print" which uses
In this simple example, we define a workflow command called
"hello", which declares a single task called "print" which uses
"tool/exec.Run" to execute a shell command that echos output to
the terminal:
Expand All @@ -56,7 +56,7 @@ the terminal:
}
EOF
We run the "hello" command like this:
We run the "hello" workflow command like this:
$ cue cmd hello
Hello World! Welcome to Amsterdam.
Expand All @@ -65,12 +65,13 @@ We run the "hello" command like this:
Hello Jan! Welcome to Amsterdam.
In this example we declare the "prompted" command which has four
tasks. The first task prompts the user for a string input. The
second task depends on the first, and echos the response back to
the user with a friendly message. The third task pipes the output
from the second to a file. The fourth task pipes the output from
the second to standard output (i.e. it echos it again).
In this example we declare the "prompted" workflow command which
has four tasks. The first task prompts the user for a string
input. The second task depends on the first, and echos the
response back to the user with a friendly message. The third task
pipes the output from the second to a file. The fourth task pipes
the output from the second to standard output (i.e. it echos it
again).
package foo
Expand Down Expand Up @@ -110,7 +111,7 @@ the second to standard output (i.e. it echos it again).
}
}
Run "cue help commands" for more details on tasks and commands.
Run "cue help commands" for more details on tasks and workflow commands.
Usage:
cue cmd <name> [inputs] [flags]
Expand Down
39 changes: 19 additions & 20 deletions hugo/content/en/docs/reference/cli/cue-commands/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ tags:

```text { title="TERMINAL" codeToCopy="Y3VlIGhlbHAgY29tbWFuZHM=" }
$ cue help commands
Commands define actions on instances. For example, they may
specify how to upload a configuration to Kubernetes. Commands are
defined directly in tool files, which are regular CUE files
within the same package with a filename ending in _tool.cue.
These are typically defined at the module root so that they apply
to all instances.
Each command consists of one or more tasks. A task may, for
example, load or write a file, consult a user on the command
Workflow commands define actions on instances. For example, they
may specify how to upload a configuration to Kubernetes. Workflow
commands are defined directly in tool files, which are regular
CUE files within the same package with a filename ending in
_tool.cue. These are typically defined at the module root so
that they apply to all instances.
Each workflow command consists of one or more tasks. A task may,
for example, load or write a file, consult a user on the command
line, fetch a web page, and so on. Each task has inputs and
outputs. Outputs are typically filled out by the task
implementation as the task completes.
Expand All @@ -31,12 +31,10 @@ Available tasks can be found in the package documentation at
https://pkg.go.dev/cuelang.org/go/pkg/tool?tab=subdirectories
More on tasks can be found in the commands help topic.
Examples:
In this simple example, we define a command called "hello",
which declares a single task called "print" which uses
In this simple example, we define a workflow command called
"hello", which declares a single task called "print" which uses
"tool/exec.Run" to execute a shell command that echos output to
the terminal:
Expand All @@ -56,7 +54,7 @@ the terminal:
}
EOF
We run the "hello" command like this:
We run the "hello" workflow command like this:
$ cue cmd hello
Hello World! Welcome to Amsterdam.
Expand All @@ -65,12 +63,13 @@ We run the "hello" command like this:
Hello Jan! Welcome to Amsterdam.
In this example we declare the "prompted" command which has four
tasks. The first task prompts the user for a string input. The
second task depends on the first, and echos the response back to
the user with a friendly message. The third task pipes the output
from the second to a file. The fourth task pipes the output from
the second to standard output (i.e. it echos it again).
In this example we declare the "prompted" workflow command which
has four tasks. The first task prompts the user for a string
input. The second task depends on the first, and echos the
response back to the user with a friendly message. The third task
pipes the output from the second to a file. The fourth task pipes
the output from the second to standard output (i.e. it echos it
again).
package foo
Expand Down
6 changes: 6 additions & 0 deletions hugo/content/en/docs/reference/cli/cue-fmt/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@ tags:
$ cue help fmt
Fmt formats the given files or the files for the given packages in place
Arguments are interpreted as import paths (see 'cue help inputs') unless --files is set,
in which case the arguments are file paths to descend into and format all CUE files.
Directories named "cue.mod" and those beginning with "." and "_" are skipped unless
given as explicit arguments.
Usage:
cue fmt [-s] [inputs] [flags]
Flags:
--check exits with non-zero status if any files are not formatted
-d, --diff display diffs instead of rewriting files
--files treat arguments as file paths to descend into rather than import paths
Global Flags:
-E, --all-errors print all available errors
Expand Down
38 changes: 38 additions & 0 deletions hugo/content/en/docs/reference/cli/cue-mod-fix/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
WARNING: "Code generated site_tool.cue; DO NOT EDIT."
title: "cue mod fix"
tags:
- cue command
---

```text { title="TERMINAL" codeToCopy="Y3VlIGhlbHAgbW9kIGZpeA==" }
$ cue help mod fix
WARNING: THIS COMMAND IS EXPERIMENTAL.
Fix provides a way to migrate from a legacy module.cue file
to the new standard syntax. It
- adds a language.version field
- moves unrecognized fields into the custom.legacy field
- adds a major version to the module path
If there is no module path, it chooses an arbitrary path (test.example@v0).
If the module.cue file is already compatible with the new syntax,
it is just formatted without making any other changes.
Note: you must enable the modules experiment with:
export CUE_EXPERIMENT=modules
for this command to work.
Usage:
cue mod fix [flags]
Global Flags:
-E, --all-errors print all available errors
-i, --ignore proceed in the presence of errors
-s, --simplify simplify output
--strict report errors for lossy mappings
--trace trace computation
-v, --verbose print information about progress
```
1 change: 1 addition & 0 deletions hugo/content/en/docs/reference/cli/cue-mod/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Usage:
Available Commands:
edit edit cue.mod/module.cue
fix fix a legacy cue.mod/module.cue file
get add and upgrade module dependencies
init initialize new module in current directory
publish publish the current module to a registry
Expand Down
7 changes: 4 additions & 3 deletions hugo/content/en/docs/reference/cli/cue-vet/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@ a set of definitions to pick from.
Examples:
# Check files against a CUE file:
cue vet foo.yaml foo.cue
cue vet foo.cue foo.yaml
# Check files against a particular expression
cue vet translations/*.yaml foo.cue -d '#Translation'
cue vet foo.cue translations/*.yaml -d '#Translation'
If more than one expression is given, all must match all values.
More than one expression may be given using multiple -d flags. Each non-CUE
file must match all expression values.
Usage:
cue vet [flags]
Expand Down
2 changes: 1 addition & 1 deletion hugo/content/en/docs/reference/cli/cue/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Usage:
cue [command]
Available Commands:
cmd run a user-defined shell command
cmd run a user-defined workflow command
completion Generate completion script
def print consolidated definitions
eval evaluate and print a configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ This tutorial is written using the following version of `cue`:

```text { title="TERMINAL" codeToCopy="Y3VlIHZlcnNpb24=" }
$ cue version
cue version v0.9.0-alpha.4
cue version v0.9.0-alpha.5
...
```

Expand Down
4 changes: 2 additions & 2 deletions hugo/content/en/docs/tutorial/k8s/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -331,14 +331,14 @@ Let's compare the result of merging our new template to our original snapshot.

```text { title="TERMINAL" codeToCopy="Y3VlIGV2YWwgLWMgLi8uLi4gPnNuYXBzaG90Mg==" }
$ cue eval -c ./... >snapshot2
// k8s.example/services/mon/alertmanager:kube
// k8s.example/services/mon/alertmanager@v0:kube
deployment.alertmanager.spec.template.metadata.labels.component: incomplete value string:
./kube.cue:36:16
service.alertmanager.metadata.labels.component: incomplete value string:
./kube.cue:11:15
service.alertmanager.spec.selector.component: incomplete value string:
./kube.cue:11:15
// k8s.example/services/mon/nodeexporter:kube
// k8s.example/services/mon/nodeexporter@v0:kube
service."node-exporter".metadata.labels.component: incomplete value string:
./kube.cue:11:15
...
Expand Down
4 changes: 2 additions & 2 deletions hugo/content/en/docs/tutorial/loading-cue-go-api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ This tutorial is written using the following versions of `go` and `cue`:

```text { title="TERMINAL" codeToCopy="Y3VlIHZlcnNpb24KZ28gdmVyc2lvbg==" }
$ cue version
cue version v0.9.0-alpha.4
cue version v0.9.0-alpha.5
...
$ go version
go version go1.22.1 linux/amd64
go version go1.22.3 linux/amd64
```

## Create a CUE module
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ This tutorial is written using the following version of `cue`:

```text { title="TERMINAL" codeToCopy="Y3VlIHZlcnNpb24=" }
$ cue version
cue version v0.9.0-alpha.4
cue version v0.9.0-alpha.5
...
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ This tutorial is written using the following version of `cmd/cue`:

```text { title="TERMINAL" codeToCopy="Y3VlIHZlcnNpb24=" }
$ cue version
cue version v0.9.0-alpha.4
cue version v0.9.0-alpha.5
...
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Note that this guide depends on a pre-release version of CUE:

```text { title="TERMINAL" codeToCopy="Y3VlIHZlcnNpb24=" }
$ cue version
cue version v0.9.0-alpha.4
cue version v0.9.0-alpha.5
...
```

Expand Down
18 changes: 9 additions & 9 deletions internal/cmd/preprocessor/cmd/_docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Code generated site_tool.cue; DO NOT EDIT.

FROM golang:1.22.1 AS build
FROM golang:1.22.3 AS build

ENV CGO_ENABLED=0

Expand All @@ -27,9 +27,9 @@ RUN \
--mount=type=cache,target=/cache/gocache \
--mount=type=cache,target=/cache/gomodcache \
export GOCACHE=/cache/gocache GOMODCACHE=/cache/gomodcache && \
GOBIN=/cues/v0.9.0-alpha.4 go install -trimpath cuelang.org/go/cmd/cue@v0.9.0-alpha.4
GOBIN=/cues/v0.9.0-alpha.5 go install -trimpath cuelang.org/go/cmd/cue@v0.9.0-alpha.5

FROM golang:1.22.1
FROM golang:1.22.3

RUN apt-get update && apt-get install -y tree

Expand All @@ -39,14 +39,14 @@ ENV LC_ALL=C.UTF-8

# Default to the default value of CUE. Guides can fix to a different
# version explicitly
ENV PATH="/cues/v0.9.0-alpha.4:${PATH}"
ENV PATH="/cues/v0.9.0-alpha.5:${PATH}"

ENV PATH="/go/bin:/usr/local/go/bin:${PATH}"
ENV CUELANG_CUE_LATEST="v0.8.2"
ENV CUELANG_CUE_PRERELEASE="v0.9.0-alpha.4"
ENV CUELANG_CUE_TIP="v0.9.0-alpha.4"
ENV CUELANG_CUE_DEFAULT="v0.9.0-alpha.4"
ENV CUELANG_CUE_PLAYGROUND="v0.9.0-alpha.4"
ENV CUELANG_CUE_PRERELEASE="v0.9.0-alpha.5"
ENV CUELANG_CUE_TIP="v0.9.0-alpha.5"
ENV CUELANG_CUE_DEFAULT="v0.9.0-alpha.5"
ENV CUELANG_CUE_PLAYGROUND="v0.9.0-alpha.5"

WORKDIR /

Expand All @@ -57,6 +57,6 @@ RUN chown root:root /usr/bin/entrypoint.sh

COPY --from=build /go/bin/testscript /go/bin
COPY --from=build /cues/v0.8.2/cue /cues/v0.8.2/cue
COPY --from=build /cues/v0.9.0-alpha.4/cue /cues/v0.9.0-alpha.4/cue
COPY --from=build /cues/v0.9.0-alpha.5/cue /cues/v0.9.0-alpha.5/cue

ENTRYPOINT ["/usr/bin/entrypoint.sh"]
2 changes: 1 addition & 1 deletion internal/cmd/preprocessor/cmd/gen_dockerimagetag.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2300001

Please sign in to comment.