Skip to content

Commit

Permalink
chore: exeute commands via aqua exec (#16768)
Browse files Browse the repository at this point in the history
* chore: exeute commands via aqua exec

* chore(scaffold): stop running start.sh twice

* ci: fix test-docker
  • Loading branch information
suzuki-shunsuke authored Oct 28, 2023
1 parent 8958b41 commit 0fee095
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ jobs:
policy_allow: "true"
env:
AQUA_GITHUB_TOKEN: ${{github.token}}
- run: bash scripts/test.sh suzuki-shunsuke/mkghtag
- run: cmdx t suzuki-shunsuke/mkghtag

ci-info:
runs-on: ubuntu-latest
Expand Down
6 changes: 4 additions & 2 deletions cmdx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ tasks:
if [ "{{.recreate}}" = true ]; then
cmdx rm
fi
bash scripts/start.sh
bash scripts/scaffold.sh "{{.package}}" "{{.cmd}}" "{{.limit}}"
args:
- name: package
Expand Down Expand Up @@ -67,6 +68,7 @@ tasks:
if [ "{{.recreate}}" = true ]; then
cmdx rm
fi
bash scripts/start.sh
bash scripts/test.sh "{{.package}}"
- name: connect
Expand Down Expand Up @@ -117,7 +119,7 @@ tasks:
shell:
- "bash"
- "-c"
script: aqua-registry gr
script: aqua exec -- aqua-registry gr

- name: new
usage: Create a branch, a commit, and a pull request to add a given package
Expand All @@ -129,7 +131,7 @@ tasks:
e.g.
$ cmdx new cli/cli
script: aqua-registry create-pr-new-pkg "{{.package}}"
script: aqua exec -- aqua-registry create-pr-new-pkg "{{.package}}"
args:
- name: package
required: true
Expand Down
4 changes: 2 additions & 2 deletions scripts/check_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -euo pipefail

container_image_id=$(docker inspect aqua-registry | jq -r ".[].Image")
image_id=$(docker inspect aquaproj/aqua-registry | jq -r ".[].Id")
container_image_id=$(docker inspect aqua-registry | aqua exec -- jq -r ".[].Image")
image_id=$(docker inspect aquaproj/aqua-registry | aqua exec -- jq -r ".[].Id")

[ "$container_image_id" = "$image_id" ]
4 changes: 1 addition & 3 deletions scripts/scaffold.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ pkg=$1
cmd=$2
limit=$3

bash scripts/start.sh

if [ -d "pkgs/$pkg" ]; then
rm -R "pkgs/$pkg"
fi
Expand All @@ -26,4 +24,4 @@ fi
# shellcheck disable=SC2086
docker exec -ti -w /aqua-registry aqua-registry aqua-registry scaffold $opts "$pkg"

cmdx t "$pkg"
bash scripts/test.sh "$pkg"
4 changes: 1 addition & 3 deletions scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ set -euo pipefail

pkg=$1

bash scripts/start.sh

docker cp "pkgs/$pkg/pkg.yaml" aqua-registry:/workspace/pkg.yaml
docker cp "pkgs/$pkg/registry.yaml" aqua-registry:/workspace/registry.yaml

Expand All @@ -19,4 +17,4 @@ for os in linux darwin windows; do
done
done

aqua-registry gr
aqua exec -- aqua-registry gr

0 comments on commit 0fee095

Please sign in to comment.