Skip to content

Commit

Permalink
feat: set hostname and workspace_name vars
Browse files Browse the repository at this point in the history
  • Loading branch information
tsirysndr committed Aug 4, 2024
1 parent 880d161 commit 7b1f4a4
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 11 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Setup Fluent CI
uses: fluentci-io/setup-fluentci@v4
- name: Run Dagger Pipelines
run: fluentci run deno_pipeline fmt lint
uses: fluentci-io/setup-fluentci@v5
with:
wasm: true
plugin: deno
args: |
fmt
lint
env:
DAGGER_CLOUD_TOKEN: ${{secrets.DAGGER_CLOUD_TOKEN}}
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 5 additions & 3 deletions .github/workflows/flakestry-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Setup Fluent CI
uses: fluentci-io/setup-fluentci@v4
- name: Publish flake
run: fluentci run flakestry_pipeline publish
uses: fluentci-io/setup-fluentci@v5
with:
wasm: true
plugin: flakestry
args: publish
env:
VERSION: ${{ inputs.tag || github.ref_name }}
GH_TOKEN: ${{ github.token }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Or download the binary from the [releases page](https://github.com/pocketenv-io/
pocketenv --help

Usage: pocketenv
Version: 0.1.0
Version: 0.1.1

Description:

Expand Down
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

packages.default = pkgs.deno2nix.mkExecutable {
pname = "pocketenv";
version = "0.1.0";
version = "0.1.1";

src = ./.;
lockfile = "./deno.lock";
Expand Down
10 changes: 9 additions & 1 deletion src/cmd/up.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ async function up(
}

let workdir = Deno.cwd();
const generatedName = generateName();

if (workspace) {
const result = await workspaces.get(workspace);
Expand All @@ -31,6 +32,13 @@ async function up(
Deno.exit(1);
}
workdir = result.path;
args.push(`-var 'hostname=${result.name}'`);
args.push(`-var 'workspace_name=${result.name}'`);
}

if (!workspace) {
args.push(`-var 'hostname=${generatedName}'`);
args.push(`-var 'workspace_name=${generatedName}'`);
}

if (existsSync(`${workdir}/.pocketenv`)) {
Expand All @@ -53,7 +61,7 @@ async function up(

const result = await workspaces.get(workspace || Deno.cwd());

workspace = result?.name || workspace || generateName();
workspace = result?.name || workspace || generatedName;
await workspaces.save(result?.path || Deno.cwd(), {
containerId,
name: workspace,
Expand Down
2 changes: 1 addition & 1 deletion src/consts.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { dir } from "../deps.ts";

export const VERSION = "0.1.0";
export const VERSION = "0.1.1";

export const POCKETENV_DIR = `${dir("home")}/.pocketenv`;

Expand Down

0 comments on commit 7b1f4a4

Please sign in to comment.