/
Vagrantfile
54 lines (40 loc) · 2.32 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
config.vm.box = "debian/bullseye64"
config.ssh.forward_agent = true
config.ssh.insert_key = false
config.vm.provider "virtualbox" do |vb|
# Customize the amount of memory on the VM:
vb.memory = "4096"
end
config.vm.provision "shell", inline: <<-SHELL
wget -qO - https://deb.nodesource.com/setup_16.x | bash -
apt-get install -qqy nodejs
sudo -iu vagrant npx -y saltcorn-install -y
apt update && apt install -y wget unzip openjdk-11-jdk openjdk-11-demo openjdk-11-doc openjdk-11-jre-headless openjdk-11-source
cd /home/saltcorn
sudo -u saltcorn wget https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip
sudo -u saltcorn unzip commandlinetools-linux-8512546_latest.zip
sudo -u saltcorn mkdir /home/saltcorn/android_sdk
yes | sudo -u saltcorn cmdline-tools/bin/sdkmanager --sdk_root=/home/saltcorn/android_sdk --install "cmdline-tools;latest"
sudo -u saltcorn /home/saltcorn/android_sdk/cmdline-tools/latest/bin/sdkmanager --list
sudo -u saltcorn /home/saltcorn/android_sdk/cmdline-tools/latest/bin/sdkmanager "platforms;android-11"
sudo -u saltcorn /home/saltcorn/android_sdk/cmdline-tools/latest/bin/sdkmanager "build-tools;30.0.3"
npm install -g npm@9.2.0
sudo -u saltcorn wget -q https://services.gradle.org/distributions/gradle-7.1.1-all.zip
unzip gradle-7.1.1-all.zip -d /opt
npm install -g cordova
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
export ANDROID_SDK_ROOT=/home/saltcorn/android_sdk
export GRADLE_HOME=/opt/gradle-7.1.1
export PATH=$PATH:/opt/gradle-7.1.1/bin
export CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL=file\:/home/saltcorn/gradle-7.1.1-all.zip
sudo -u saltcorn /home/saltcorn/.local/bin/saltcorn install-pack -n "Address book"
sudo --preserve-env=JAVA_HOME,ANDROID_SDK_ROOT,GRADLE_HOME,PATH,CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL -u saltcorn /home/saltcorn/.local/bin/saltcorn build-app -p "android" -s "http://10.0.2.2" -b "/home/saltcorn/build_dir" -e "EditPerson"
SHELL
end