From 7b1f4a44257297113a6df0ada564bb49c694f71a Mon Sep 17 00:00:00 2001 From: Tsiry Sandratraina Date: Sun, 4 Aug 2024 19:21:46 +0000 Subject: [PATCH] feat: set hostname and workspace_name vars --- .github/workflows/ci.yml | 12 ++++++++---- .github/workflows/flakestry-publish.yml | 8 +++++--- README.md | 2 +- flake.nix | 2 +- src/cmd/up.ts | 10 +++++++++- src/consts.ts | 2 +- 6 files changed, 25 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 85b1717..501403a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 }} diff --git a/.github/workflows/flakestry-publish.yml b/.github/workflows/flakestry-publish.yml index e9204fc..86e7bc0 100644 --- a/.github/workflows/flakestry-publish.yml +++ b/.github/workflows/flakestry-publish.yml @@ -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 }} diff --git a/README.md b/README.md index 12bb532..d79355a 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/flake.nix b/flake.nix index 2059359..9f17351 100644 --- a/flake.nix +++ b/flake.nix @@ -25,7 +25,7 @@ packages.default = pkgs.deno2nix.mkExecutable { pname = "pocketenv"; - version = "0.1.0"; + version = "0.1.1"; src = ./.; lockfile = "./deno.lock"; diff --git a/src/cmd/up.ts b/src/cmd/up.ts index 17493e0..75bdd6b 100644 --- a/src/cmd/up.ts +++ b/src/cmd/up.ts @@ -23,6 +23,7 @@ async function up( } let workdir = Deno.cwd(); + const generatedName = generateName(); if (workspace) { const result = await workspaces.get(workspace); @@ -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`)) { @@ -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, diff --git a/src/consts.ts b/src/consts.ts index 118546d..ecd4bbf 100644 --- a/src/consts.ts +++ b/src/consts.ts @@ -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`;