Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Kapral67 committed Feb 28, 2024
1 parent b42b9fc commit 507af13
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/package_on_device.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,9 @@ jobs:
env:
ARCH: ${{ matrix.target_arch }}
run: |
./common-files/build-termux-docker.sh login ./scripts/setup-termux.sh
docker run -v .:/root --rm ghcr.io/jguer/archlinuxarm:base-20240228.8076116248@sha256:f47612965638036a436a463b026cc0ba32e7a45d24bcfa999f1d66d82a3fc818 /bin/bash /root/test.sh
exit 38
script -e -O /dev/null -c "./common-files/build-termux-docker.sh login ./scripts/setup-termux.sh"
declare -a packages
for repo_path in $(jq --raw-output 'keys | .[]' repo.json); do
repo=$(jq --raw-output '.["'${repo_path}'"].name' repo.json)
Expand All @@ -177,7 +179,7 @@ jobs:
done
sudo chown -R 1000:1000 $(pwd)
if [ ! -z "$packages" ]; then
./common-files/build-termux-docker.sh login ./build-package.sh --format pacman -I $packages
script -e -O /dev/null -c "./common-files/build-termux-docker.sh login ./build-package.sh --format pacman -I $packages"
fi
- name: Clean up docker containers
env:
Expand Down
8 changes: 5 additions & 3 deletions common-files/build-termux-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ REPOROOT="$(dirname $(readlink -f $0))/../"

# Check whether attached to tty and adjust docker flags accordingly.
if [ -t 1 ]; then
echo 'YES TTY'
DOCKER_TTY=" --tty"
else
echo 'NO TTY'
DOCKER_TTY=""
fi

Expand All @@ -37,11 +39,11 @@ $SUDO docker start $CONTAINER_NAME >/dev/null 2>&1 || {

echo "Running existing container..."

if [ "$#" -eq "0" ]; then
echo "bash"
if [ "$#" -eq "0" ]; then
echo "bash"
$SUDO docker exec --interactive $DOCKER_TTY $CONTAINER_NAME bash
else
echo '$@'
echo '$@'
$SUDO docker exec --interactive $DOCKER_TTY $CONTAINER_NAME "$@"
fi

Expand Down
12 changes: 10 additions & 2 deletions test.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
#!/bin/bash
#!/usr/bin/env bash
set -x
export GPG_TTY=$(tty)
pacman -Syu --noconfirm --needed gnupg wget
cd ~
GPG_TTY="\$(tty)" || true
export GPG_TTY
gpg --version
wget https://github.com/termux/termux-packages/raw/master/packages/termux-keyring/grimler.gpg
gpg --import grimler.gpg
gpg --no-tty --command-file <(echo -e "trust\n5\ny") --edit-key 2C7F29AE97891F6419A9E2CDB0076E490B71616B
gpg --list-keys
set +x

0 comments on commit 507af13

Please sign in to comment.