-
Notifications
You must be signed in to change notification settings - Fork 4
74 create install script #77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
05762c6
First version of install script
btimbermont fadc8b0
74: Make sure appium inspector is added to the path correctly
eoudsen e19e5d0
74-create-install-script: Copy workshop install scripts
Angelina-C 715dd8a
74-create-install-script: Merge branch '74-create-install-script' of …
Angelina-C c18d689
74-create-install-script: Rename workshop_env to python_env and remov…
Angelina-C 2335bae
74-create-install-script: Remove git, checkout, ipython from windows
Angelina-C 4dec622
74-create-install-script: remove url
Angelina-C 260186c
Add check for correct python version in Linux script
btimbermont f9a0c99
Merge remote-tracking branch 'origin/74-create-install-script' into 7…
btimbermont b60921d
74-create-install-script: Make all linux scripts executable
Angelina-C f0a3673
Fix windows install script
btimbermont 9bf1da3
Merge branch '74-create-install-script' of https://github.com/Netherl…
btimbermont e6aaa7f
Add adb to path
btimbermont 80b0ba2
74-create-install-script: create funciton for env variables
Angelina-C 94191da
74-create-install-script: Merge branch '74-create-install-script' of …
Angelina-C 299813b
74-create-install-script: Fix python3.x installation
Angelina-C ea3bdf9
74-create-install-script: Remove todos
Angelina-C 8c53cc2
Set Linux env values for adb
btimbermont 9befce6
Merge remote-tracking branch 'origin/74-create-install-script' into 7…
btimbermont acd5f8a
74-create-install-script: Check env variables in mac
Angelina-C d309eac
Rewrite manual for installation scripts
btimbermont 2ed5f88
Merge remote-tracking branch 'origin/74-create-install-script' into 7…
btimbermont e76e1fe
Merge branch 'main' into 74-create-install-script
btimbermont 0e66692
Fix typos in install readme
Angelina-C 9a36809
Write windows install logs to file
Angelina-C 8119037
Revert "Write windows install logs to file"
Angelina-C 5df5329
Small fix in windows install script
btimbermont File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # Installation script instructions | ||
|
|
||
| To install all required dependencies and configure your machine to run Puma, simply run the installation script for your | ||
| operating system (`install_windows.bat`, `install_linux.sh` or `install_macos.sh`). | ||
|
|
||
| # What does the script do? | ||
|
|
||
| These scripts will: | ||
| 1. Install ADB and setup the required environmental values | ||
| 2. Install NodeJS and Appium | ||
| 3. Install Python 3.12 | ||
| 4. Install Appium Inspector | ||
| 5. Install all requirements in your python virtual environment | ||
|
|
||
| When software is installed (ADB, Node, Appium, Python, Appium Inspector), the scripts will only install the missing | ||
| components. Python 3.12 will not be installed if you already have python 3.10, 3.11 or 3.12 installed. | ||
|
|
||
| ## ADB and environmental values | ||
| Puma needs ADB to be installed and either be available on your path, or on `ANDROID_SDK_ROOT/platform-tools/adb`. | ||
| Appium **requires** the environmental values `ANDROID_SDK_ROOT` or `ANDROID_HOME` to be set. | ||
|
|
||
| The script will set these values if they aren't already set, and download the latest Android SDK platform tools and | ||
| extract them to your home folder (`~/Android/Sdk/platform-tools/adb`) . | ||
|
|
||
| ## NodeJS and Appium | ||
| Puma needs Appium, which is a Node.JS application. | ||
| The script will install Node.JS (through NVM on Linux and MacOS) and then use NPM to install Appium globally. | ||
|
|
||
| ## Python | ||
| Puma is tested on Python 3.10, 3.11 and 3.12. The script will install 3.12 if none of these versions are installed. | ||
|
|
||
| ## Appium inspector | ||
| Appium Inspector is a tool that can help you develop new Puma code, either for new apps, or to expand functionality in | ||
| existing apps. | ||
|
|
||
| On Windows and MacOS, it will be installed as a regular application (through an installer), on Linux a portable binary | ||
| will be placed in `~/.appium-inspector/appium-inspector.AppImage` and an alias will be made so you can run it from | ||
| the terminal using `appium_inspector`. | ||
|
|
||
| ## Installing requirements in the python virtual environment | ||
| The script will create and activate [a python venv](https://docs.python.org/3/library/venv.html) in the root of this | ||
| repository, and then run `pip install -r requirements.txt`. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| #!/bin/bash | ||
|
eoudsen marked this conversation as resolved.
|
||
|
|
||
| shell_profile() { | ||
| SHELL_PROFILE="" | ||
| case "$SHELL" in | ||
| *bash*) | ||
| SHELL_PROFILE="$HOME/.bash_profile" | ||
| if [ ! -f "$SHELL_PROFILE" ]; then | ||
| SHELL_PROFILE="$HOME/.bashrc" | ||
| fi | ||
| ;; | ||
| *zsh*) | ||
| SHELL_PROFILE="$HOME/.zshrc" | ||
| ;; | ||
| *ksh*) | ||
| SHELL_PROFILE="$HOME/.kshrc" | ||
| ;; | ||
| *fish*) | ||
| SHELL_PROFILE="$HOME/.config/fish/config.fish" | ||
| ;; | ||
| *dash*) | ||
| SHELL_PROFILE="$HOME/.profile" | ||
| ;; | ||
| *sh*) | ||
| SHELL_PROFILE="$HOME/.profile" | ||
| ;; | ||
| *) | ||
| echo "Unsupported shell: $CURRENT_SHELL" | ||
| exit 1 | ||
| ;; | ||
| esac | ||
| echo "$SHELL_PROFILE" | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| #!/bin/bash | ||
| CURRENT_DIR=$(dirname "$(realpath "$0")") | ||
|
|
||
| # Exit on error | ||
| set -e | ||
|
|
||
| echo "Starting setup of Android SDK Platform Tools, Node.js, and Appium for Linux..." | ||
| now=$(date +"%Y%m%d_%H:%M:%S") | ||
| mkdir -p "$CURRENT_DIR/logs" | ||
| log_path="$CURRENT_DIR/logs/$now.log" | ||
| touch "$log_path" | ||
|
|
||
| "$CURRENT_DIR"/linux/install_adb.sh | tee -a "$log_path" | ||
| "$CURRENT_DIR"/linux/install_node_appium.sh | tee -a "$log_path" | ||
| "$CURRENT_DIR"/linux/install_appium_inspector.sh | tee -a "$log_path" | ||
| "$CURRENT_DIR"/linux/setup_python_env.sh | tee -a "$log_path" | ||
|
|
||
| echo "Installation complete!" | ||
| echo "To verify the installation, please open a new terminal and run:" | ||
| echo "- adb version (to check Android SDK Platform Tools)" | ||
| echo "- node -v (to check Node.js version - should be v19.x.x)" | ||
| echo "- appium -v (to check Appium version)" | ||
| echo "- appium_inspector (to launch Appium Inspector)" | ||
| echo "" | ||
| echo "Note: You may need to install additional dependencies for AppImage to run properly." | ||
| echo "If you encounter errors running appium_inspector, try installing:" | ||
| echo "sudo apt-get install libfuse2" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| #!/bin/bash | ||
| CURRENT_DIR=$(dirname "$(realpath "$0")") | ||
|
|
||
| # Exit on error | ||
| set -e | ||
|
|
||
| echo "Starting setup of Android SDK Platform Tools, Node.js, Appium, and Git for macOS..." | ||
| now=$(date +"%Y%m%d_%H:%M:%S") | ||
| mkdir -p "$CURRENT_DIR/logs" | ||
| log_path="$CURRENT_DIR/logs/$now.log" | ||
| touch "$log_path" | ||
|
|
||
| "$CURRENT_DIR"/macos/install_adb.sh | tee -a "$log_path" | ||
| "$CURRENT_DIR"/macos/install_node_appium.sh | tee -a "$log_path" | ||
| "$CURRENT_DIR"/macos/install_appium_inspector.sh | tee -a "$log_path" | ||
| "$CURRENT_DIR"/macos/setup_python_env.sh | tee -a "$log_path" | ||
|
|
||
| #TODO actually check instead of print | ||
| echo "Installation complete!" | ||
| echo "To verify the installation, please open a new terminal and run:" | ||
| echo "- adb version (to check Android SDK Platform Tools)" | ||
| echo "- node -v (to check Node.js version - should be v19.x.x)" | ||
| echo "- appium -v (to check Appium version)" | ||
| echo "- open -a 'Appium Inspector' (to launch Appium Inspector)" | ||
| echo "- git --version (to check Git version)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| @echo off | ||
| cd /d "%~dp0\windows" | ||
|
|
||
| :: Initialize success flags | ||
| set "python_success=false" | ||
| set "adb_success=false" | ||
| set "node_success=false" | ||
| set "setup_python_env_success=false" | ||
| set "appium_install_success=false" | ||
| set "appium_inspector_install_success=false" | ||
|
|
||
| :: Run Python installation script | ||
| echo Running Python installation... | ||
| call install_python.bat | ||
| IF %ERRORLEVEL% EQU 0 ( | ||
| set "python_success=true" | ||
| ) ELSE ( | ||
| echo Python installation failed. | ||
| ) | ||
|
|
||
| :: Run ADB installation script | ||
| echo Running ADB installation... | ||
| call install_adb.bat | ||
| IF %ERRORLEVEL% EQU 0 ( | ||
| set "adb_success=true" | ||
| ) ELSE ( | ||
| echo ADB installation failed. | ||
| ) | ||
|
|
||
| :: Run Node.js installation script | ||
| echo Running Node.js installation... | ||
| call install_node.bat | ||
| IF %ERRORLEVEL% EQU 0 ( | ||
| set "node_success=true" | ||
| ) ELSE ( | ||
| echo Node.js installation failed. | ||
| ) | ||
|
|
||
| :: Install Appium | ||
| echo Running Appium installation... | ||
| call install_appium.bat | ||
| IF %ERRORLEVEL% EQU 0 ( | ||
| set "appium_install_success=true" | ||
| ) ELSE ( | ||
| echo Appium installation failed. | ||
| ) | ||
|
|
||
| :: Install Appium Inspector | ||
| echo Running Appium Inspector installation... | ||
| call install_appium_inspector.bat | ||
| IF %ERRORLEVEL% EQU 0 ( | ||
| set "appium_inspector_install_success=true" | ||
| ) ELSE ( | ||
| echo Appium Inspector installation failed. | ||
| ) | ||
|
|
||
| :: Run python setup | ||
| echo Running python environment setup... | ||
| call setup_python_env.bat | ||
| IF %ERRORLEVEL% EQU 0 ( | ||
| set "setup_python_env_success=true" | ||
| ) ELSE ( | ||
| echo Python environment setup failed. | ||
| ) | ||
|
|
||
| :: Summary of installations | ||
| echo | ||
| echo ---------------------- | ||
| echo Installation Summary: | ||
| echo ---------------------- | ||
|
|
||
| IF "%python_success%"=="true" ( | ||
| echo Python installation succeeded. | ||
| ) ELSE ( | ||
| echo Python installation failed. | ||
| ) | ||
|
|
||
| IF "%adb_success%"=="true" ( | ||
| echo ADB installation succeeded. | ||
| ) ELSE ( | ||
| echo ADB installation failed. | ||
| ) | ||
|
|
||
| IF "%node_success%"=="true" ( | ||
| echo Node.js installation succeeded. | ||
| ) ELSE ( | ||
| echo Node.js installation failed. | ||
| ) | ||
| IF "%appium_install_success%"=="true" ( | ||
| echo Appium installation succeeded. | ||
| ) ELSE ( | ||
| echo Appium installation failed. | ||
| ) | ||
| IF "%appium_inspector_install_success%"=="true" ( | ||
| echo Appium Inspector installation succeeded. | ||
| ) ELSE ( | ||
| echo Appium Inspector installation failed. | ||
| ) | ||
| IF "%setup_python_env_success%"=="true" ( | ||
| echo Puma environment setup succeeded. | ||
| ) ELSE ( | ||
| echo Puma environment setup failed. | ||
| ) | ||
|
|
||
| pause |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| #!/bin/bash | ||
| # Exit on error | ||
| set -e | ||
|
|
||
| echo "Starting install of android-sdk and platform-tools" | ||
|
|
||
| # Set up environment variables | ||
| echo "Setting up environment variables..." | ||
| ENV_SETUP=" | ||
| # Android SDK Environment Variables | ||
| export ANDROID_HOME=\$HOME/Android/Sdk | ||
| export ANDROID_SDK_ROOT=\$HOME/Android/Sdk | ||
| export PATH=\$PATH:\$ANDROID_HOME/platform-tools | ||
| " | ||
|
|
||
| echo "Setting environment variables" | ||
|
|
||
| current_dir=$(dirname "$(realpath "$0")") | ||
| source "$current_dir"/../common/get_shell.sh | ||
| SHELL_PROFILE=$(shell_profile) | ||
|
|
||
| if [ -n "$SHELL_PROFILE" ]; then | ||
| # Check if variables already exist in the profile | ||
| if ! grep -q "ANDROID_HOME" "$SHELL_PROFILE"; then | ||
| echo "$ENV_SETUP" >> "$SHELL_PROFILE" | ||
| echo "Added environment variables to $SHELL_PROFILE" | ||
| else | ||
| echo "Environment variables already exist in $SHELL_PROFILE" | ||
| fi | ||
| else | ||
| echo "Warning: Could not find shell profile. You may need to manually add environment variables." | ||
| echo "Please add the following to your shell profile:" | ||
| echo "$ENV_SETUP" | ||
| fi | ||
|
|
||
| source "$SHELL_PROFILE" | ||
|
|
||
| # setup adb | ||
| ANDROID_SDK_DIR="$HOME/Android/Sdk" | ||
| if [ -e "$ANDROID_SDK_DIR/platform-tools/adb" ] | ||
| then | ||
| echo "[INFO] ADB is already installed. Skipping installation" | ||
| exit 0 | ||
| fi | ||
|
|
||
| ANDROID_SDK_DIR=$HOME/Android/Sdk | ||
| TEMP_DIR=$(mktemp -d) | ||
|
|
||
| # Create Android SDK directory | ||
| mkdir -p "$ANDROID_SDK_DIR" | ||
|
|
||
| # Download and extract Android SDK Platform Tools | ||
| echo "Downloading Android SDK Platform Tools..." | ||
| PLATFORM_TOOLS_URL="https://dl.google.com/android/repository/platform-tools-latest-linux.zip" | ||
| curl -L $PLATFORM_TOOLS_URL -o "$TEMP_DIR"/platform-tools.zip | ||
|
|
||
| echo "Extracting Platform Tools to $ANDROID_SDK_DIR..." | ||
| unzip -q "$TEMP_DIR"/platform-tools.zip -d "$ANDROID_SDK_DIR" | ||
|
|
||
| echo "Cleaning up temporary files..." | ||
| rm -rf "$TEMP_DIR" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.