Skip to content
This repository was archived by the owner on Apr 16, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
56a8150
some script testing
chrismusilek Mar 25, 2025
df041ac
script modifications to properly add env-variables
chrismusilek Mar 25, 2025
66f2920
make script work properly on mac and ubuntu...cannot test on win, no …
chrismusilek Mar 25, 2025
2d8c903
extend script
chrismusilek Mar 29, 2025
b1adfdf
huge rewrite, make it more flexible
chrismusilek Mar 29, 2025
bd0554d
Merge branch 'main' into private/script_testing_chris
chrismusilek Mar 29, 2025
ddbe8c1
resolve conflicts
chrismusilek Apr 11, 2025
0915292
make script work properly on mac and ubuntu...cannot test on win, no …
chrismusilek Mar 25, 2025
69641f4
extend script
chrismusilek Mar 29, 2025
747f907
huge rewrite, make it more flexible
chrismusilek Mar 29, 2025
3b30f94
Dockerfile extended for future use
chrismusilek Apr 11, 2025
5f20bde
Merge branch 'private/script_testing_chris' of https://github.com/sec…
chrismusilek Apr 11, 2025
16c150e
commit testwise
chrismusilek Apr 13, 2025
30547f5
changes for running on rp4
chrismusilek Apr 13, 2025
2bb3a07
resolve merge conflict
chrismusilek May 10, 2025
f7803e3
raspberry compatibility test
chrismusilek May 10, 2025
ccb53ca
No extra action needed; Docker will fetch the ARM version
chrismusilek May 10, 2025
bad3cc2
fix platformtools version
chrismusilek May 10, 2025
11bd042
some fixes
chrismusilek May 10, 2025
a6dde7e
some fixes
chrismusilek May 10, 2025
1723c33
some fixes
chrismusilek May 11, 2025
595560e
update to java 23
Oct 7, 2025
94c9969
documentation
Oct 9, 2025
051403d
added appium config
boris779 Oct 11, 2025
72f1429
rewrote whole setup. only one script necessary. works in Docker as we…
Oct 11, 2025
5a697d6
appium.conf.json is loaded properly. enhanced README.md and provide f…
Oct 12, 2025
6430d0d
trivial - formatting only
Oct 12, 2025
6a76355
update documentation according to new setup
Oct 12, 2025
5c25c47
mv appium config to dedicated folder. makes setup clearer
Nov 1, 2025
04ea9ad
fixed various things
Nov 1, 2025
58965d2
path adaptions
Nov 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 42 additions & 31 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,36 +1,47 @@
# Start with a minimal Ubuntu image
FROM ubuntu:22.04

# Set non-interactive front-end for installing dependencies
# Set non-interactive frontend to avoid prompts during package installation
ENV DEBIAN_FRONTEND=noninteractive
# for using chrome on your host machine
# ENV DISPLAY=:0
# ENV XAUTHORITY=/root/.Xauthority

# 🔥🔥 TODO install chrome in docker container 🔥🔥

# Install required dependencies
# Update package list and install essential dependencies
RUN apt-get update && apt-get install -y \
curl \
wget \
sudo \
bash \
tzdata \
gnupg \
build-essential \
git && \
rm -rf /var/lib/apt/lists/*

# Set up a working directory
WORKDIR /app

# Copy the scripts into the container
COPY install_tools.sh /app/install_tools.sh
COPY install_android_sdk.sh /app/install_android_sdk.sh

# Make the script executable
RUN chmod +x /app/install_tools.sh
RUN chmod +x /app/install_android_sdk.sh

# Run bash as the default shell
CMD ["/bin/bash"]
curl \
wget \
unzip \
zip \
sudo \
bash \
ca-certificates \
git \
&& rm -rf /var/lib/apt/lists/*

# Create a test user with sudo privileges
RUN useradd -m -s /bin/bash appiumuser && \
echo "appiumuser ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers

# Set working directory
WORKDIR /home/appiumuser

# Copy the installation script, startup script, and Appium config
COPY setup_environment.sh ./

COPY appium/ ./appium/

# Make scripts executable and change ownership
RUN chmod +x setup_environment.sh appium/start-appium.sh && \
chown appiumuser:appiumuser setup_environment.sh appium/

# Switch to test user
USER appiumuser

# Run the setup script during build time
RUN ./setup_environment.sh

# Set environment variables for interactive shells
ENV NVM_DIR=/home/appiumuser/.nvm \
SDKMAN_DIR=/home/appiumuser/.sdkman \
ANDROID_SDK_ROOT=/home/appiumuser/android_sdk \
TERM=xterm

# start appium
CMD ["./appium/start-appium.sh"]
120 changes: 63 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,91 +1,97 @@
# Workshop Setup

# Prerequisites
Install Java for your OS (recommended Version 21 or above)

make the script executable via `chmod u+x install_tools.sh` and execute it afterwards via `./install_tools.sh`


### Android SDK and build-tools

make the script executable via `chmod u+x install_android_sdk.sh` and execute it afterwards via `./install_android_sdk.sh`.
It will download all necessary files and edit your `~/.bashrc` or `~/.zshrc` or `~/.profile` with following env-variables.
### Build Image

```shell
# Build locally
docker build -t workshop-env:latest .

export ANDROID_HOME=$HOME/installed/android_sdk
export ANDROID_PLATFORM_TOOLS=$ANDROID_HOME/platform-tools
export ANDROID_CMD_LINE_TOOLS=$ANDROID_HOME/cmdline-tools/latest
export ANDROID_BUILD_TOOLS_34=$ANDROID_HOME/build-tools/34.0.0

export PATH=$ANDROID_HOME:$ANDROID_PLATFORM_TOOLS:$ANDROID_CMD_LINE_TOOLS/bin:$ANDROID_BUILD_TOOLS_34
# Build on NAS and monitor output
docker --context ubuntu-nas build --progress=plain -t workshop-env:latest . 2>&1 | tee /tmp/docker_build.log

# Build locally and monitor output
docker --context default build --progress=plain -t workshop-env:latest . 2>&1 | tee /tmp/docker_build.log
```

## Installation for Windows
**Build time:** 5-15 minutes (setup runs during build)
**Image size:** ~2-3GB (all tools pre-installed)

### node installation
https://nodejs.org/en/download/
### Run Image

The container automatically starts Appium server on port 4723 when launched:

e.g.
### Android SDK with Android Studio
https://developer.android.com/studio/index.html
Goto Configure environment variables:

```System Properties -> Environment Variables -> System Variables -> New -> ANDROID_HOME```
```shell
# Run locally: USB + port + daemon mode
docker run -d --name appium-server --privileged -p 4723:4723 -v /dev/bus/usb:/dev/bus/usb workshop-env:latest

and set value as **C:Users\YourUser\AppData\Local\Android\SDK** (path where SDK is installed)
# Run on NAS context
docker --context ubuntu-nas run -d --name appium-server --privileged -p 4723:4723 -v /dev/bus/usb:/dev/bus/usb workshop-env:latest
```

Add the Android SDK paths into your existing PATH variable value as `%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools;%ANDROID_HOME%\build-tools`
**Startup:** Instant - Appium server starts automatically!

---
### Verify Appium Server

## fallback for nvm (https://www.freecodecamp.org/news/node-version-manager-nvm-install-guide/)
```shell
# Check if container is running
docker ps

execute in terminal
# Check Appium server logs
docker logs appium-server

```
brew install nvm
# or via
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
# Test Appium server endpoint
curl http://localhost:4723/status
```

if not automatically added during installation, do manually after install
### Container Management

```
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
```
```shell
# Stop the server
docker stop appium-server

## fallback for sdkman (https://sdkman.io/install/)
# Restart the server
docker start appium-server

```
curl -s "https://get.sdkman.io" | bash
# Remove container (to recreate)
docker rm -f appium-server
```

Follow the on-screen instructions to wrap up the installation. Afterward, open a new terminal or run the following in the same shell:
### Interactive Access (Optional)

```
source "$HOME/.sdkman/bin/sdkman-init.sh"
```
If you need to access the container shell for debugging:

### working mvn command running the tests
```
mvn test -Dbrowser=chrome -DbaseUrl="https://www.wikipedia.org" -Dcucumber.filter.tags=@all -Dcucumber.glue=at.ucaat.demo.stepdefinitions -Dcucumber.features=src/test/resources/features
```

### selenium-server download
```shell
# Execute bash in running container
docker exec -it appium-server bash

# Or run a new container in interactive mode
docker run -it --rm --privileged -p 4723:4723 -v /dev/bus/usb:/dev/bus/usb workshop-env:latest bash
```
java -jar selenium-server-4.30.0.jar standalone
```

## Technical Info

### Script Features

`setup_environment.sh` works on both bare metal Ubuntu and Docker containers:

---
✅ **Color-coded output** - Uses tput with ANSI fallback for Docker builds
✅ **Smart terminal detection** - Automatically handles missing TERM variable
✅ **Package manager support** - Works with apt-get and yum
✅ **Shell detection** - Configures bash/zsh appropriately
✅ **Dynamic version detection** - Automatically installs latest Android build-tools
✅ **User-level installation** - Installs to $HOME (NVM, SDKMAN, Android SDK)
✅ **Sudo support** - Uses sudo only for system packages
✅ **Idempotent** - Safe to run multiple times

### Docker Build

- **Build time:** 5-15 minutes (setup runs during `docker build`)
- **Image size:** ~2-3GB (all tools pre-installed)
- **Container startup:** Instant (no runtime setup)
- **Tools included:** Node.js, Appium, Java 23, Maven, Android SDK

### Bare Metal Installation

Works on any Linux system with a standard package manager. Run as a regular user with sudo privileges:

```bash
./setup_environment.sh
```
Loading