Skip to content

Commit 9d8fce1

Browse files
committed
Refactor naming convention for directories and files
1 parent 05ae7df commit 9d8fce1

20 files changed

+40
-40
lines changed

.github/workflows/docker-image.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ jobs:
1515
- name: Build the main Docker image (android-sdk)
1616
run: docker build -t android-sdk ./android-sdk
1717
- name: Display tool version information of the main Docker image (android-sdk)
18-
run: cmd=$(cat ./android-sdk/version_inspector.sh) && docker run -i --rm android-sdk bash -c "$cmd"
18+
run: cmd=$(cat ./android-sdk/version-inspector.sh) && docker run -i --rm android-sdk bash -c "$cmd"
1919
- name: Build the sub Docker image (android-sdk-vnc)
2020
run: docker build -t android-sdk-vnc ./android-sdk/vnc
2121
- name: Display tool version information of the sub Docker image (android-sdk-vnc)
22-
run: cmd=$(cat ./android-sdk/vnc/version_inspector.sh) && docker run -i --rm android-sdk-vnc bash -c "$cmd"
22+
run: cmd=$(cat ./android-sdk/vnc/version-inspector.sh) && docker run -i --rm android-sdk-vnc bash -c "$cmd"
2323
- name: Build the sub Docker image (android-sdk-firebase-test-lab)
2424
run: docker build -t android-sdk-firebase-test-lab ./android-sdk/firebase-test-lab
2525
- name: Display tool version information of the sub Docker image (android-sdk-firebase-test-lab)
26-
run: cmd=$(cat ./android-sdk/firebase-test-lab/version_inspector.sh) && docker run -i --rm android-sdk-firebase-test-lab bash -c "$cmd"
26+
run: cmd=$(cat ./android-sdk/firebase-test-lab/version-inspector.sh) && docker run -i --rm android-sdk-firebase-test-lab bash -c "$cmd"

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ Contributions are made by forking this repository, making the changes, and openi
1111
The [primary Docker image](./android-sdk/Dockerfile) was created in barebone, for the sake of providing Android environment only. If you have other needs, please build a dedicated Docker image:
1212

1313
* Create a specific directory under [android-sdk](./android-sdk) directory and a `Dockerfile` inside it.
14-
* A `version_inspector.sh` file is necessary to print out tools' version information.
14+
* A `version-inspector.sh` file is necessary to print out tools' version information.
1515
* Update corresponding CI workflow: [GitHub Action](https://github.com/thyrlian/AndroidSDK/blob/master/.github/workflows/docker-image.yml).
16-
* Add corresponding Docker image building and publishing steps to [`image_publisher.sh`](./image_publisher.sh) script.
16+
* Add corresponding Docker image building and publishing steps to [`image-publisher.sh`](./image-publisher.sh) script.
1717

1818
## Accept New SDK Licenses
1919

20-
Update the script [`android-sdk/license_acceptor.sh`](./android-sdk/license_accepter.sh) with the new agreement checksums. Do not remove pre-existing license agreement acceptances.
20+
Update the script [`android-sdk/license-accepter.sh`](./android-sdk/license-accepter.sh) with the new agreement checksums. Do not remove pre-existing license agreement acceptances.
2121

2222
If a new agreement is accepted, a file should be created in the directory [`EULA`](./EULA). If there is an update, ensure the agreements contain a suffix with the timestamp in the format `-YYYYMMDD`.
2323

README.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Android SDK development environment Docker image
1414

1515
[![Docker Badge](https://dockerico.blankenship.io/image/thyrlian/android-sdk)](https://hub.docker.com/r/thyrlian/android-sdk)
1616

17-
<img src="https://github.com/thyrlian/AndroidSDK/blob/master/images/logo.png?raw=true" width="200">
17+
<img src="https://github.com/thyrlian/AndroidSDK/blob/master/assets/logo.png?raw=true" width="200">
1818

1919
<a href="https://youtu.be/YwBAqMDYFCU"><img src="https://pbs.twimg.com/media/DODnbwmXkAAbXuM.jpg" alt="Conference Talk" width="600"></a>
2020

@@ -146,7 +146,7 @@ docker run -it -v $(pwd)/sdk:/opt/android-sdk:ro thyrlian/android-sdk /bin/bash
146146
docker run -it -v $(pwd)/sdk:/opt/android-sdk thyrlian/android-sdk /bin/bash
147147

148148
# to keep and reuse Gradle cache
149-
docker run -it -v $(pwd)/sdk:/opt/android-sdk -v $(pwd)/gradle_caches:/root/.gradle/caches thyrlian/android-sdk /bin/bash
149+
docker run -it -v $(pwd)/sdk:/opt/android-sdk -v $(pwd)/gradle-caches:/root/.gradle/caches thyrlian/android-sdk /bin/bash
150150

151151
# to stop and remove container
152152
# when the image was pulled from a registry
@@ -159,7 +159,7 @@ docker stop $(docker ps -a | grep 'android-sdk' | awk '{ print $1 }') &> /dev/nu
159159

160160
### Accepting Licenses
161161

162-
A helper script is provided at [`/opt/license_accepter.sh`](https://github.com/thyrlian/AndroidSDK/blob/master/android-sdk/license_accepter.sh) for accepting the SDK and its various licenses. This is helpful in non-interactive environments such as CI builds.
162+
A helper script is provided at [`/opt/license-accepter.sh`](https://github.com/thyrlian/AndroidSDK/blob/master/android-sdk/license-accepter.sh) for accepting the SDK and its various licenses. This is helpful in non-interactive environments such as CI builds.
163163

164164
## SSH
165165

@@ -168,9 +168,9 @@ It is also possible if you wanna connect to container via SSH. There are three
168168
* Build an image on your own, with a built-in `authorized_keys`
169169

170170
```bash
171-
# Put your `id_rsa.pub` under `android-sdk/accredited_keys` directory (as many as you want)
171+
# Put your `id_rsa.pub` under `android-sdk/accredited-keys` directory (as many as you want)
172172

173-
# Build an image, then an `authorized_keys` file will be composed automatically, based on the keys from `android-sdk/accredited_keys` directory
173+
# Build an image, then an `authorized_keys` file will be composed automatically, based on the keys from `android-sdk/accredited-keys` directory
174174
docker build -t android-sdk android-sdk
175175

176176
# Run a container
@@ -216,7 +216,7 @@ And, in case you need, you can still attach to the running container (not via ss
216216
docker exec -it <container_id> /bin/bash
217217
```
218218

219-
<img src="https://github.com/thyrlian/AndroidSDK/blob/master/images/SSH.png?raw=true">
219+
<img src="https://github.com/thyrlian/AndroidSDK/blob/master/assets/SSH.png?raw=true">
220220

221221
## VNC
222222

@@ -249,7 +249,7 @@ emulator -avd test -no-audio -no-boot-anim -accel on -gpu swiftshader_indirect &
249249

250250
For more details, please refer to [Emulator section](https://github.com/thyrlian/AndroidSDK#emulator).
251251

252-
<img src="https://github.com/thyrlian/AndroidSDK/blob/master/images/vnc.png?raw=true">
252+
<img src="https://github.com/thyrlian/AndroidSDK/blob/master/assets/vnc.png?raw=true">
253253

254254
### VNC client recommendation
255255

@@ -306,10 +306,10 @@ Fortunately, you can easily build such a mirror server docker image on your own.
306306
docker build --build-arg GRADLE_DOWNLOAD_AMOUNT=<amount_of_gradle_distributions_to_be_downloaded> -t gradle-server gradle-server
307307
```
308308

309-
Preferably, you should run the [download script](https://github.com/thyrlian/AndroidSDK/blob/master/gradle-server/gradle_downloader.sh) locally, and mount the download directory to the container.
309+
Preferably, you should run the [download script](https://github.com/thyrlian/AndroidSDK/blob/master/gradle-server/gradle-downloader.sh) locally, and mount the download directory to the container.
310310

311311
```bash
312-
gradle-server/gradle_downloader.sh [DOWNLOAD_DIRECTORY] [DOWNLOAD_AMOUNT]
312+
gradle-server/gradle-downloader.sh [DOWNLOAD_DIRECTORY] [DOWNLOAD_AMOUNT]
313313
docker run -d -p 80:80 -p 443:443 -v [DOWNLOAD_DIRECTORY]:/var/www/gradle.org/public_html/distributions gradle-server
314314
```
315315

@@ -521,7 +521,7 @@ Now you can for instance run UI tests on the emulator (just remember, the perfor
521521

522522
If you encounter an error "***Process system isn't responding***" in the emulator, like below:
523523

524-
<img src="https://github.com/thyrlian/AndroidSDK/blob/master/images/emulator_error_process_not_responding.png?raw=true">
524+
<img src="https://github.com/thyrlian/AndroidSDK/blob/master/assets/emulator-error-process-not-responding.png?raw=true">
525525

526526
You could try:
527527

@@ -627,9 +627,9 @@ docker pull thyrlian/android-sdk-firebase-test-lab
627627
# we'll persist all your gcloud configuration which would be created at ~/.config/gcloud/
628628

629629
# spin up a container with interactive mode
630-
docker run -it -v $(pwd)/sdk:/opt/android-sdk -v <your_private_key_dir>/firebase.json:/root/firebase.json -v $(pwd)/gcloud_config:/root/.config/gcloud thyrlian/android-sdk-firebase-test-lab /bin/bash
630+
docker run -it -v $(pwd)/sdk:/opt/android-sdk -v <your_private_key_dir>/firebase.json:/root/firebase.json -v $(pwd)/gcloud-config:/root/.config/gcloud thyrlian/android-sdk-firebase-test-lab /bin/bash
631631
# or spin up a container with SSH
632-
docker run -d -p 2222:22 -v $(pwd)/sdk:/opt/android-sdk -v <your_private_key_dir>/firebase.json:/root/firebase.json -v $(pwd)/gcloud_config:/root/.config/gcloud -v $(pwd)/authorized_keys:/root/.ssh/authorized_keys thyrlian/android-sdk-firebase-test-lab
632+
docker run -d -p 2222:22 -v $(pwd)/sdk:/opt/android-sdk -v <your_private_key_dir>/firebase.json:/root/firebase.json -v $(pwd)/gcloud-config:/root/.config/gcloud -v $(pwd)/authorized_keys:/root/.ssh/authorized_keys thyrlian/android-sdk-firebase-test-lab
633633

634634
# authorize access to Google Cloud Platform with a service account (by its private key)
635635
gcloud auth activate-service-account -q --key-file /root/firebase.json
@@ -883,16 +883,16 @@ sudo netstat -tulpn | grep LISTEN
883883
884884
* Go to the top-level directory of this project
885885
886-
* Execute [`image_publisher.sh`](https://github.com/thyrlian/AndroidSDK/blob/master/image_publisher.sh) script
886+
* Execute [`image-publisher.sh`](https://github.com/thyrlian/AndroidSDK/blob/master/image-publisher.sh) script
887887
888888
```console
889-
./image_publisher.sh [TAG]
889+
./image-publisher.sh [TAG]
890890
```
891891
892-
* Execute [`version_inspector.sh`](https://github.com/thyrlian/AndroidSDK/blob/master/android-sdk/version_inspector.sh) script inside a docker container from local machine to check versions of tools
892+
* Execute [`version-inspector.sh`](https://github.com/thyrlian/AndroidSDK/blob/master/android-sdk/version-inspector.sh) script inside a docker container from local machine to check versions of tools
893893
894894
```console
895-
cmd=$(cat ./android-sdk/version_inspector.sh) && docker run -it --rm android-sdk bash -c "$cmd"
895+
cmd=$(cat ./android-sdk/version-inspector.sh) && docker run -it --rm android-sdk bash -c "$cmd"
896896
```
897897
898898
* Update [Changelog](https://github.com/thyrlian/AndroidSDK/blob/master/CHANGELOG.md) based on the versions info printed by the above commands

android-sdk/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,16 @@ ENV LD_LIBRARY_PATH=${ANDROID_HOME}/emulator/lib64:${ANDROID_HOME}/emulator/lib6
5959
ENV QTWEBENGINE_DISABLE_SANDBOX=1
6060

6161
# accept the license agreements of the SDK components
62-
ADD license_accepter.sh /opt/
63-
RUN chmod +x /opt/license_accepter.sh && /opt/license_accepter.sh $ANDROID_HOME
62+
ADD license-accepter.sh /opt/
63+
RUN chmod +x /opt/license-accepter.sh && /opt/license-accepter.sh $ANDROID_HOME
6464

6565
# setup adb server
6666
EXPOSE 5037
6767

6868
# install and configure SSH server
6969
EXPOSE 22
7070
ADD sshd-banner /etc/ssh/
71-
ADD accredited_keys /tmp/
71+
ADD accredited-keys /tmp/
7272
RUN apt-get update && \
7373
apt-get install -y --no-install-recommends openssh-server supervisor locales && \
7474
mkdir -p /var/run/sshd /var/log/supervisord && \
File renamed without changes.
File renamed without changes.

android-sdk/vnc/Dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@ LABEL maintainer="thyrlian@gmail.com"
1414
ENV USER=root
1515
ENV DISPLAY=:1
1616
EXPOSE 5901
17-
ADD vncpass.sh /tmp/
18-
ADD vncserver_daemon.sh /usr/local/bin/
17+
ADD vnc-pass.sh /tmp/
18+
ADD vncserver-daemon.sh /usr/local/bin/
1919
ADD watchdog.sh /usr/local/bin/
20-
ADD supervisord_vncserver.conf /etc/supervisor/conf.d/
20+
ADD supervisord-vncserver.conf /etc/supervisor/conf.d/
2121
RUN apt-get update && \
2222
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends xfce4 xfce4-goodies xfonts-base dbus-x11 tightvncserver expect xauth && \
2323
touch /root/.Xauthority && chmod 600 /root/.Xauthority && \
2424
xauth generate :1 . trusted && \
25-
chmod +x /usr/local/bin/vncserver_daemon.sh && \
26-
chmod +x /tmp/vncpass.sh; sync && \
27-
/tmp/vncpass.sh && \
28-
rm /tmp/vncpass.sh && \
25+
chmod +x /usr/local/bin/vncserver-daemon.sh && \
26+
chmod +x /tmp/vnc-pass.sh; sync && \
27+
/tmp/vnc-pass.sh && \
28+
rm /tmp/vnc-pass.sh && \
2929
apt-get remove -y expect && apt-get autoremove -y && \
3030
FILE_SSH_ENV="/root/.ssh/environment" && \
3131
echo "DISPLAY=:1" >> $FILE_SSH_ENV

android-sdk/vnc/supervisord_vncserver.conf renamed to android-sdk/vnc/supervisord-vncserver.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pidfile=/var/run/supervisord.pid
44
user=root
55

66
[program:vncserver]
7-
command = /usr/local/bin/vncserver_daemon.sh
7+
command = /usr/local/bin/vncserver-daemon.sh
88
user=root
99
autostart=true
1010
autorestart=true
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

gradle-server/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ RUN apt-get update && \
1717
# install and configure the Apache Web Server
1818
ARG GRADLE_DOWNLOAD_AMOUNT=14
1919
ENV GRADLE_DIST /var/www/gradle.org/public_html/distributions
20-
ADD gradle_downloader.sh $GRADLE_DIST/
20+
ADD gradle-downloader.sh $GRADLE_DIST/
2121
RUN apt-get install -y apache2 && \
2222
sed -i 's%\(^\s*DocumentRoot\s*\).*%\1/var/www/gradle.org/public_html%g' /etc/apache2/sites-available/000-default.conf && \
2323
echo "\n<Directory /var/www/gradle.org>\n Options Indexes FollowSymLinks\n</Directory>\n" >> /etc/apache2/apache2.conf && \
@@ -28,7 +28,7 @@ RUN apt-get install -y apache2 && \
2828
sed -i 's%\(^\s*SSLCertificateFile\s*\).*%\1/etc/apache2/ssl/apache.crt%g' /etc/apache2/sites-available/default-ssl.conf && \
2929
sed -i 's%\(^\s*SSLCertificateKeyFile\s*\).*%\1/etc/apache2/ssl/apache.key%g' /etc/apache2/sites-available/default-ssl.conf && \
3030
a2ensite default-ssl.conf && \
31-
chmod +x $GRADLE_DIST/gradle_downloader.sh && \
32-
$GRADLE_DIST/gradle_downloader.sh $GRADLE_DIST $GRADLE_DOWNLOAD_AMOUNT
31+
chmod +x $GRADLE_DIST/gradle-downloader.sh && \
32+
$GRADLE_DIST/gradle-downloader.sh $GRADLE_DIST $GRADLE_DOWNLOAD_AMOUNT
3333
EXPOSE 80 443
3434
CMD ["/usr/sbin/apachectl", "-D", "FOREGROUND"]

image_publisher.sh renamed to image-publisher.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ SUB_IMAGE_VNC_DIR=vnc
1818
SUB_IMAGE_FIREBASE_TEST_LAB_NAME=android-sdk-firebase-test-lab
1919
SUB_IMAGE_FIREBASE_TEST_LAB_DIR=firebase-test-lab
2020
TAG_LATEST=latest
21-
KEYS_DIR=accredited_keys
22-
TEMP_DIR=temp_accredited_keys
21+
KEYS_DIR=accredited-keys
22+
TEMP_DIR=temp-accredited-keys
2323

2424
# extract base image name and tag from Dockerfile
2525
regex_name_and_tag='FROM[[:blank:]]([^:]*):([^:]*)'
@@ -36,7 +36,7 @@ cd $MAIN_IMAGE_DIR
3636
echo "Pulling the latest base image..."
3737
docker pull $BASE_IMAGE_NAME:$BASE_IMAGE_TAG
3838

39-
echo "Hiding files inside accredited_keys directory..."
39+
echo "Hiding files inside accredited-keys directory..."
4040
rm -r $TEMP_DIR 2> /dev/null
4141
mkdir -p $TEMP_DIR
4242
if [ ! -z "$(ls $KEYS_DIR)" ]; then
@@ -100,7 +100,7 @@ echo "Pushing the sub Firebase Test Lab image to Docker Hub..."
100100
docker push $DOCKER_HUB_ACCOUNT/$SUB_IMAGE_FIREBASE_TEST_LAB_NAME:$TAG
101101
docker push $DOCKER_HUB_ACCOUNT/$SUB_IMAGE_FIREBASE_TEST_LAB_NAME:$TAG_LATEST
102102

103-
echo "Unhiding files inside accredited_keys directory..."
103+
echo "Unhiding files inside accredited-keys directory..."
104104
if [ ! -z "$(ls $TEMP_DIR)" ]; then
105105
mv -v $TEMP_DIR/* $KEYS_DIR
106106
fi

0 commit comments

Comments
 (0)