Browse Source

Fix container name

master
wchen342 1 year ago
parent
commit
52c71d0ee3
Signed by: wchen342 GPG Key ID: 9C19365D69B04CEC
  1. 4
      SDK/build.sh
  2. 9
      SDK/docker-build.sh
  3. 2
      base/docker-setup.sh
  4. 5
      base/setup.sh

4
SDK/build.sh

@ -3,14 +3,14 @@ set -eu -o pipefail
pushd ../base && source ./setup.sh && popd
container_name="android-rebuilds:sdk"
container_name="android-rebuilds-sdk"
docker create --name ${container_name} --workdir /home/build/wd --entrypoint "tail" android-rebuilds:base "-f" "/dev/null"
docker start "${container_name}"
# Run build script
docker cp docker-build.sh "${container_name}":/home/build/wd/docker-build.sh
docker exec --user build "${container_name}" /home/build/wd/docker-build.sh
docker exec --user build "${container_name}" bash -c "/home/build/wd/docker-build.sh"
# copy output

9
SDK/docker-build.sh

@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/env bash
set -eux -o pipefail
VERSION='s-beta-5' # temporarily before SDK 12 comes out formally
@ -6,15 +6,18 @@ VERSION='s-beta-5' # temporarily before SDK 12 comes out formally
TARGET='user' # user, userdebug, eng
export USER=$(whoami)
export BUILD_NUMBER="${BUILD_VARIANT}-${VERSION}"
export BUILD_NUMBER="${TARGET}-${VERSION}"
# Sync sources
repo init -u https://android.googlesource.com/platform/manifest -b android-$VERSION --depth=1
repo sync -c -j4
# Build
# build/envsetup.sh cannot be run with -u
set +u
source build/envsetup.sh
lunch sdk-${BUILD_VARIANT}
set -u
lunch sdk-${TARGET}
# win_sdk build linux SDK too
#make -j$(nproc) sdk dist sdk_repo

2
base/docker-setup.sh

@ -24,4 +24,4 @@ mkdir -p /home/build/wd
chown -R build:build /home/build
# Set up git
su -c - build 'git config --global user.email "[email protected]" && git config --global user.name "Your Name"'
su -c - build 'git config --global user.email "[email protected]" && git config --global user.name "Your Name" && git config --global color.ui true'

5
base/setup.sh

@ -1,5 +1,10 @@
#!/usr/bin/env bash
# Remove old image if exists
if [[ "$(docker images -q android-rebuilds:base 2> /dev/null)" != "" ]]; then
docker image rm android-rebuilds:base
fi
docker pull debian:bookworm
docker build -t android-rebuilds:base .

Loading…
Cancel
Save