Skip to content

Commit

Permalink
Fix bk docker and bk edit (#318)
Browse files Browse the repository at this point in the history
* Fix brewkit source mount within bk docker

Refs pkgxdev/pantry#5472 (comment)

* Fix bk edit
  • Loading branch information
felipecrs committed Apr 1, 2024
1 parent 2d90aad commit c3f504c
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 10 deletions.
8 changes: 6 additions & 2 deletions audit/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,16 @@ runs:
fi
shell: bash
- uses: denoland/setup-deno@v1
env:
DENO_INSTALL_ROOT: /tmp/deno-bin

- name: fetch deno deps
shell: bash
run: |
echo "::group::fetch deno deps"
cd $GITHUB_ACTION_PATH
pkgx deno cache ./audit.ts
cd ${GITHUB_ACTION_PATH}
/tmp/deno-bin/deno cache ./build.ts
echo "::endgroup::"
- run: ${GITHUB_ACTION_PATH}/audit.ts '${{ inputs.pkg }}'
Expand Down
2 changes: 1 addition & 1 deletion audit/audit.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!//usr/bin/env -S pkgx +git +gh deno run --allow-env --allow-read --allow-run --allow-net --ext=ts
#!//usr/bin/env -S pkgx +git +gh /tmp/deno-bin/deno run --allow-env --allow-read --allow-run --allow-net --ext=ts

import { Command } from "cliffy/command/mod.ts"
import { swallow } from "brewkit/utils.ts"
Expand Down
2 changes: 1 addition & 1 deletion bin/bk-docker
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if [ ! -d "$PKGX_PANTRY_PATH" ]; then
exit 64
fi

d="$(cd "$(dirname "$0")/../.." && pwd)"
d="$(cd "$(dirname "$0")/.." && pwd)"

if [ -z "$GITHUB_TOKEN" ]; then
GITHUB_TOKEN=$(pkgx gh auth token)
Expand Down
2 changes: 1 addition & 1 deletion bin/bk-edit
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -eo pipefail

d="$(cd "$(dirname "$0")/../.." && pwd)"
d="$(cd "$(dirname "$0")/.." && pwd)"

if [ -z "$1" ]; then
if [ -z "$PKGX_PANTRY_PATH" ]; then
Expand Down
8 changes: 6 additions & 2 deletions build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,16 @@ runs:
fi
shell: bash

- uses: denoland/setup-deno@v1
env:
DENO_INSTALL_ROOT: /tmp/deno-bin

- name: fetch deno deps
shell: bash
run: |
echo "::group::fetch deno deps"
cd $GITHUB_ACTION_PATH
pkgx deno cache ./build.ts
cd ${GITHUB_ACTION_PATH}
/tmp/deno-bin/deno cache ./build.ts
echo "::endgroup::"
- name: build
Expand Down
2 changes: 1 addition & 1 deletion build/build.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env -S pkgx +rsync +git +bash +gum +gh +curl +bzip2 +xz +unzip +lzip +column deno run --ext=ts --allow-env --allow-read --allow-write --allow-run --allow-net
#!/usr/bin/env -S pkgx +rsync +git +bash +gum +gh +curl +bzip2 +xz +unzip +lzip +column /tmp/deno-bin/deno run --ext=ts --allow-env --allow-read --allow-write --allow-run --allow-net

import make_build_script from "brewkit/porcelain/build-script.ts"
import { gum, rsync } from "brewkit/utils.ts"
Expand Down
6 changes: 5 additions & 1 deletion test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@ runs:
fi
shell: bash
- uses: denoland/setup-deno@v1
env:
DENO_INSTALL_ROOT: /tmp/deno-bin

- name: fetch deno deps
shell: bash
run: |
echo "::group::fetch deno deps"
cd ${GITHUB_ACTION_PATH}
pkgx deno cache ./test.ts
/tmp/deno-bin/deno cache ./build.ts
echo "::endgroup::"
- name: test
Expand Down
2 changes: 1 addition & 1 deletion test/test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env -S pkgx +bash +gum +gh +rsync deno run --ext=ts --allow-env --allow-read --allow-write --allow-net --allow-run
#!/usr/bin/env -S pkgx +bash +gum +gh +rsync /tmp/deno-bin/deno run --ext=ts --allow-env --allow-read --allow-write --allow-net --allow-run

//TODO net required because we go to github for version info, but really we should require
// a built product that is then recorded for us to use
Expand Down

0 comments on commit c3f504c

Please sign in to comment.