Skip to content

Commit

Permalink
Chore: Remove outdated instructions from README (#300)
Browse files Browse the repository at this point in the history
  • Loading branch information
arnauorriols authored Mar 14, 2024
1 parent 0a63c1c commit 612f83d
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 18 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ deno install -Arf jsr:@deno/deployctl

## Usage

Before being able to deploy, you need to get a personal access token from the
[Deno Deploy access token page](https://dash.deno.com/account#access-tokens).
Store this token in a `DENO_DEPLOY_TOKEN` environment variable, or pass it to
`deployctl` with the `--token` flag.
The easiest way to get started with `deployctl` is to deploy one of the examples
in the [examples directory](./examples):

```shell
deployctl deploy --project=hello-world ./examples/hello.ts
cd examples/hello-world
deployctl deploy
```

View the help:
Visit the [deployctl docs](https://docs.deno.com/deploy/manual/deployctl) and
check out the help output to learn all you can do with deployctl:

```shell
deployctl -h
Expand Down
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@deno/deployctl",
"version": "1.11.0",
"version": "1.12.0",
"exports": "./deployctl.ts",
"fmt": {
"files": {
Expand Down
1 change: 0 additions & 1 deletion examples/fresh/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"jsxImportSource": "preact"
},
"deploy": {
"project": "example-fresh",
"exclude": [],
"include": [],
"entrypoint": "main.ts"
Expand Down
1 change: 0 additions & 1 deletion examples/hello-world/deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"deploy": {
"project": "example-hello-world",
"exclude": [],
"include": [],
"entrypoint": "main.ts"
Expand Down
1 change: 0 additions & 1 deletion examples/link-shortener/deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"deploy": {
"project": "example-link-shortener",
"exclude": [],
"include": [],
"entrypoint": "main.ts"
Expand Down
12 changes: 7 additions & 5 deletions src/subcommands/deployments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ You can control the database with the --db option:
If your organization has custom databases, you can also set them by UUID:
deployctl deployments redeploy --db=0b1c3e1b-a527-4055-b864-8bc7884390c9
deployctl deployments redeploy --db=5261e096-f9aa-4b72-8440-1c2b5b553def
Lastly, environment variables can also be changed using the redeploy functionality. You can use --env to set individual
environment variables, or --env-file to load one or more environment files:
Expand Down Expand Up @@ -628,7 +628,7 @@ function renderShowOverview(
if (build.relatedCommit) {
console.log(`Git`);
console.log(
` Ref:\t\t${cyan(build.relatedCommit.branch)} [${
` Ref:\t\t${cyan(build.relatedCommit.branch ?? "??")} [${
build.relatedCommit.hash.slice(0, 7)
}]`,
);
Expand Down Expand Up @@ -701,7 +701,7 @@ async function renderListOverview(
Entrypoint: colorByStatus(deploymentEntrypoint(build)),
...build.relatedCommit
? {
Branch: colorByStatus(build.relatedCommit.branch),
Branch: colorByStatus(build.relatedCommit.branch ?? "??"),
Commit: colorByStatus(build.relatedCommit.hash.slice(0, 7)),
}
: {},
Expand Down Expand Up @@ -797,7 +797,9 @@ function deploymentRelativeDate(build: Build): string {

function deploymentEntrypoint(build: Build): string {
return build.deployment
? fromFileUrl(build.deployment.url).replace("/src/", "")
? build.deployment.url.startsWith("https://")
? build.deployment.url
: fromFileUrl(build.deployment.url).replace("/src/", "")
: "n/a";
}

Expand Down Expand Up @@ -967,10 +969,10 @@ async function resolveDeploymentId(
return Deno.exit(1);
}
build = maybeBuild;
deploymentId = build.deploymentId;
spinner.succeed(
`The deployment ${relativePosString} relative to '${deploymentId}' is '${build.deploymentId}'`,
);
deploymentId = build.deploymentId;
}
return [deploymentId, projectId, build, project];
}
Expand Down
6 changes: 5 additions & 1 deletion src/subcommands/top.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Project monitoring (ALPHA)
Definition of the table columns:
idx Instance discriminator. Opaque id to discriminate different executions running in the same region.
Deployment The id of the deployment running in the executing instance.
Req/min Requests per minute received by the project.
CPU% Percentage of CPU used by the project.
CPU/req CPU time per request, in milliseconds.
Expand Down Expand Up @@ -137,9 +138,12 @@ async function tabbed(stats: AsyncGenerator<ProjectStats, void>) {
}
if (typeof stat === "object") {
next = stats.next();
const id = encodeHex(await sha256(stat.id + stat.region))
const id = encodeHex(
await sha256(stat.id + stat.region + stat.deploymentId),
)
.slice(0, 6);
table[id] = {
"deployment": stat.deploymentId,
"region": stat.region,
"Req/min": Math.ceil(stat.requestsPerMinute),
"CPU%": parseFloat((stat.cpuTimePerSecond / 10).toFixed(2)),
Expand Down
2 changes: 1 addition & 1 deletion src/utils/api_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export interface Build {
id: string;
relatedCommit?: {
hash: string;
branch: string;
branch?: string;
message: string;
authorName: string;
authorEmail: string;
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export const VERSION = "1.11.0";
export const VERSION = "1.12.0";

export const MINIMUM_DENO_VERSION = "1.40.0";

0 comments on commit 612f83d

Please sign in to comment.