mirror of
https://github.com/nextcloud/nextcloudpi.git
synced 2026-01-09 14:42:01 -03:30
build-lxd.yml: Change to custom geckodriver install script for arm support
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
This commit is contained in:
parent
7c7d5a25f9
commit
6a93bb14e3
95
.github/workflows/build-lxd.yml
vendored
95
.github/workflows/build-lxd.yml
vendored
@ -81,7 +81,7 @@ jobs:
|
||||
env:
|
||||
USE_INCUS: "${{ needs.determine-runner.outputs.lxc_cmd == 'incus' && 'yes' || 'no' }}"
|
||||
run: |
|
||||
LXD_EXTRA_PROFILE="$LXD_EXTRA_PROFILE" BRANCH="${VERSION##refs/heads/}" ./build/build-LXD.sh
|
||||
LXD_EXTRA_PROFILE="$LXD_EXTRA_PROFILE" BRANCH="${VERSION##refs/heads/}" CI="$CI" ./build/build-LXD.sh
|
||||
- name: Pack LXD image
|
||||
id: pack-lxd
|
||||
run: |
|
||||
@ -156,7 +156,7 @@ jobs:
|
||||
# env:
|
||||
# USE_INCUS: "${{ needs.determine-runner.outputs.lxc_cmd == 'incus' && 'yes' || 'no' }}"
|
||||
# run: |
|
||||
# BRANCH="${VERSION##refs/heads/}" ./build/build-LXD.sh
|
||||
# LXD_EXTRA_PROFILE="$LXD_EXTRA_PROFILE" BRANCH="${VERSION##refs/heads/}" CI="$CI" ./build/build-LXD.sh
|
||||
# - name: Pack LXD image
|
||||
# id: pack-lxd
|
||||
# run: |
|
||||
@ -205,9 +205,17 @@ jobs:
|
||||
# run: |
|
||||
# sudo apt-get install -y --no-install-recommends firefox
|
||||
# - name: Setup GeckoDriver
|
||||
# uses: ChlodAlejandro/setup-geckodriver@latest
|
||||
# with:
|
||||
# token: ${{ secrets.GITHUB_TOKEN }}
|
||||
# env:
|
||||
# GH_TOKEN: ${{ github.token }}
|
||||
# run: |
|
||||
# arch=linux64
|
||||
# if [[ "$RUNNER_ARCH" == "ARM64" ]]
|
||||
# then
|
||||
# arch="linux-aarch64"
|
||||
# fi
|
||||
# gh release download -R mozilla/geckodriver -p 'geckodriver-*-'"$arch.tar.gz"
|
||||
# tar xf "geckodriver-"*"-$arch.tar.gz"
|
||||
# sudo mv geckodriver /usr/local/bin/
|
||||
# - name: Setup Selenium
|
||||
# run: pip install selenium
|
||||
# - name: download LXD image from artifact store
|
||||
@ -233,7 +241,8 @@ jobs:
|
||||
# sleep 30
|
||||
# ip="$(sudo "$LXC" list -c n4 -f csv | grep '^ncp' | cut -d ',' -f2)"
|
||||
# ip="${ip/% *}"
|
||||
# echo "${ip} nextcloudpi.local" | sudo tee /etc/hosts
|
||||
# sudo sed -i 's/^.*nextcloudpi.local.*$//g' /etc/hosts
|
||||
# echo "${ip} nextcloudpi.local" | sudo tee -a /etc/hosts
|
||||
# - name: Activate and Test LXD Image
|
||||
# working-directory: ./tests
|
||||
# run: |
|
||||
@ -297,13 +306,14 @@ jobs:
|
||||
# - name: Relaunch container
|
||||
# run: |
|
||||
# set -x
|
||||
# systemd-run --user --scope -p "Delegate=yes" "$LXC" start -q "ncp/test" ncp || \
|
||||
# sudo systemd-run --scope -p "Delegate=yes" "$LXC" start -q "ncp/test" ncp
|
||||
# systemd-run --user --scope -p "Delegate=yes" "$LXC" start -q ncp || \
|
||||
# sudo systemd-run --scope -p "Delegate=yes" "$LXC" start -q ncp
|
||||
# sudo "$LXC" exec ncp -- bash -c 'while [ "$(systemctl is-system-running 2>/dev/null)" != "running" ] && [ "$(systemctl is-system-running 2>/dev/null)" != "degraded" ]; do :; done'
|
||||
# sleep 30
|
||||
# ip="$(sudo "$LXC" list -c n4 -f csv | grep '^ncp' | cut -d ',' -f2)"
|
||||
# ip="${ip/% *}"
|
||||
# echo "${ip} nextcloudpi.local" | sudo tee /etc/hosts
|
||||
# sudo sed -i 's/^.*nextcloudpi.local.*$//g' /etc/hosts
|
||||
# echo "${ip} nextcloudpi.local" | sudo tee -a /etc/hosts
|
||||
# - name: Test LXD Image
|
||||
# working-directory: ./tests
|
||||
# run: |
|
||||
@ -334,7 +344,8 @@ jobs:
|
||||
VERSION: "${{ inputs.git_ref || github.ref }}"
|
||||
LXC: "${{ needs.determine-runner.outputs.lxc_cmd }}"
|
||||
LXD_EXTRA_PROFILE: "${{ needs.determine-runner.outputs.lxd_extra_profile }}"
|
||||
PREVIOUS_IMAGE_URL: "https://github.com/nextcloud/nextcloudpi/releases/download/v1.53.2/NextcloudPi_LXD_x86_v1.53.2.tar.gz"
|
||||
PREVIOUS_IMAGE_URL_ARM64: "https://github.com/nextcloud/nextcloudpi/releases/download/v1.53.2/NextcloudPi_LXD_arm64_v1.53.2.tar.gz"
|
||||
PREVIOUS_IMAGE_URL_AMD64: "https://github.com/nextcloud/nextcloudpi/releases/download/v1.53.2/NextcloudPi_LXD_x86_v1.53.2.tar.gz"
|
||||
USE_INCUS: "${{ needs.determine-runner.outputs.lxc_cmd == 'incus' && 'yes' || 'no' }}"
|
||||
steps:
|
||||
- name: Setup incus
|
||||
@ -357,28 +368,43 @@ jobs:
|
||||
run: |
|
||||
sudo apt-get install -y --no-install-recommends firefox
|
||||
- name: Setup GeckoDriver
|
||||
uses: ChlodAlejandro/setup-geckodriver@latest
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
arch=linux64
|
||||
if [[ "$RUNNER_ARCH" == "ARM64" ]]
|
||||
then
|
||||
arch="linux-aarch64"
|
||||
fi
|
||||
gh release download -R mozilla/geckodriver -p 'geckodriver-*-'"$arch.tar.gz"
|
||||
tar xf "geckodriver-"*"-$arch.tar.gz"
|
||||
sudo mv geckodriver /usr/local/bin/
|
||||
- name: Setup Selenium
|
||||
run: pip install selenium
|
||||
- name: download LXD image
|
||||
run: |
|
||||
wget -qO ./ncp.tar.gz "${PREVIOUS_IMAGE_URL?}"
|
||||
image_url="${PREVIOUS_IMAGE_URL_AMD64?}"
|
||||
if [[ "$RUNNER_ARCH" == "ARM64" ]]
|
||||
then
|
||||
image_url="${PREVIOUS_IMAGE_URL_ARM64?}"
|
||||
fi
|
||||
wget -qO ./ncp.tar.gz "${image_url?}"
|
||||
- name: Launch ncp container
|
||||
run: |
|
||||
set -x
|
||||
sudo "$LXC" delete -q -f ncp || true
|
||||
sudo "$LXC" image import -q "./ncp.tar.gz" --alias "ncp/update"
|
||||
LXC_ARGS=()
|
||||
LXC_ARGS=(-p default)
|
||||
[[ -z "$LXD_EXTRA_PROFILE" ]] || LXC_ARGS+=(-p "$LXD_EXTRA_PROFILE")
|
||||
systemd-run --user --scope -p "Delegate=yes" sudo "$LXC" launch "${LXC_ARGS[@]}" -q "ncp/update" ncp
|
||||
systemd-run --user --scope -p "Delegate=yes" "$LXC" launch -q "${LXC_ARGS[@]}" "ncp/update" ncp || \
|
||||
sudo systemd-run --scope -p "Delegate=yes" "$LXC" launch -q "${LXC_ARGS[@]}" "ncp/update" ncp
|
||||
sudo "$LXC" exec ncp -- bash -c 'while [ "$(systemctl is-system-running 2>/dev/null)" != "running" ] && [ "$(systemctl is-system-running 2>/dev/null)" != "degraded" ]; do :; done'
|
||||
sudo "$LXC" exec ncp -- rm -f /opt/ncdata/data/nextcloud.log
|
||||
sleep 30
|
||||
ip="$(sudo "$LXC" list -c n4 -f csv | grep '^ncp' | cut -d ',' -f2)"
|
||||
ip="${ip/% *}"
|
||||
echo "${ip} nextcloudpi.local" | sudo tee /etc/hosts
|
||||
sudo sed -i 's/^.*nextcloudpi.local.*$//g' /etc/hosts
|
||||
echo "${ip} nextcloudpi.local" | sudo tee -a /etc/hosts
|
||||
- name: Activate and Test LXD Image
|
||||
working-directory: ./tests
|
||||
run: |
|
||||
@ -445,12 +471,14 @@ jobs:
|
||||
set -x
|
||||
LXC_ARGS=()
|
||||
[[ -z "$LXD_EXTRA_PROFILE" ]] || LXC_ARGS+=(-p "$LXD_EXTRA_PROFILE")
|
||||
systemd-run --user --scope -p "Delegate=yes" sudo "$LXC" "${LXD_ARGS[@]}" start ncp
|
||||
systemd-run --user --scope -p "Delegate=yes" "$LXC" start ncp || \
|
||||
sudo systemd-run --scope -p "Delegate=yes" "$LXC" start ncp
|
||||
sudo "$LXC" exec ncp -- bash -c 'while [ "$(systemctl is-system-running 2>/dev/null)" != "running" ] && [ "$(systemctl is-system-running 2>/dev/null)" != "degraded" ]; do :; done'
|
||||
sleep 30
|
||||
ip="$(sudo "$LXC" list -c n4 -f csv | grep '^ncp' | cut -d ',' -f2)"
|
||||
ip="${ip/% *}"
|
||||
echo "${ip} nextcloudpi.local" | sudo tee /etc/hosts
|
||||
sudo sed -i 's/^.*nextcloudpi.local.*$//g' /etc/hosts
|
||||
echo "${ip} nextcloudpi.local" | sudo tee -a /etc/hosts
|
||||
- name: Test LXD Image
|
||||
working-directory: ./tests
|
||||
run: |
|
||||
@ -490,12 +518,14 @@ jobs:
|
||||
set -x
|
||||
LXC_ARGS=()
|
||||
[[ -z "$LXD_EXTRA_PROFILE" ]] || LXC_ARGS+=(-p "$LXD_EXTRA_PROFILE")
|
||||
systemd-run --user --scope -p "Delegate=yes" sudo "$LXC" "${LXC_ARGS[@]}" start ncp
|
||||
systemd-run --user --scope -p "Delegate=yes" "$LXC" start ncp || \
|
||||
sudo systemd-run --scope -p "Delegate=yes" "$LXC" start ncp
|
||||
sudo "$LXC" exec ncp -- bash -c 'while [ "$(systemctl is-system-running 2>/dev/null)" != "running" ] && [ "$(systemctl is-system-running 2>/dev/null)" != "degraded" ]; do :; done'
|
||||
sleep 30
|
||||
ip="$(sudo "$LXC" list -c n4 -f csv | grep '^ncp' | cut -d ',' -f2)"
|
||||
ip="${ip/% *}"
|
||||
echo "${ip} nextcloudpi.local" | sudo tee /etc/hosts
|
||||
sudo sed -i 's/^.*nextcloudpi.local.*$//g' /etc/hosts
|
||||
echo "${ip} nextcloudpi.local" | sudo tee -a /etc/hosts
|
||||
- name: Test LXD Image
|
||||
working-directory: ./tests
|
||||
run: |
|
||||
@ -530,6 +560,7 @@ jobs:
|
||||
ARTIFACT_FILE: ${{ needs.build-current.outputs.artifact_file }}
|
||||
LXC: "${{ needs.determine-runner.outputs.lxc_cmd }}"
|
||||
USE_INCUS: "${{ needs.determine-runner.outputs.lxc_cmd == 'incus' && 'yes' || 'no' }}"
|
||||
LXD_EXTRA_PROFILE: "${{ needs.determine-runner.outputs.lxd_extra_profile }}"
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
@ -551,10 +582,17 @@ jobs:
|
||||
run: |
|
||||
sudo apt-get install -y --no-install-recommends firefox
|
||||
- name: Setup GeckoDriver
|
||||
uses: ChlodAlejandro/setup-geckodriver@latest
|
||||
continue-on-error: true
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
arch=linux64
|
||||
if [[ "$RUNNER_ARCH" == "ARM64" ]]
|
||||
then
|
||||
arch="linux-aarch64"
|
||||
fi
|
||||
gh release download -R mozilla/geckodriver -p 'geckodriver-*-'"$arch.tar.gz"
|
||||
tar xf "geckodriver-"*"-$arch.tar.gz"
|
||||
sudo mv geckodriver /usr/local/bin/
|
||||
- name: Setup Selenium
|
||||
run: pip install selenium
|
||||
- name: download LXD image from artifact store
|
||||
@ -574,15 +612,16 @@ jobs:
|
||||
. ./build/buildlib.sh
|
||||
sudo "$LXC" delete -q -f ncp || true
|
||||
sudo "$LXC" image import -q "./${ARTIFACT_FILE?}" --alias "ncp/test" || true
|
||||
LXC_ARGS=()
|
||||
LXC_ARGS=(-p default)
|
||||
[[ -z "$LXD_EXTRA_PROFILE" ]] || LXC_ARGS+=(-p "$LXD_EXTRA_PROFILE")
|
||||
systemd-run --user --scope -p "Delegate=yes" "$LXC" launch -q "${LXC_ARGS[@]}" "ncp/test" ncp || \
|
||||
sudo systemd-run --scope -p "Delegate=yes" "$LXC" launch -q "${LXC_ARGS[@]}" "ncp/test" ncp
|
||||
sudo systemd-run --scope -p "Delegate=yes" "$LXC" launch -q "${LXC_ARGS[@]}" "ncp/test" ncp
|
||||
sudo "$LXC" exec ncp -- bash -c 'while [ "$(systemctl is-system-running 2>/dev/null)" != "running" ] && [ "$(systemctl is-system-running 2>/dev/null)" != "degraded" ]; do :; done'
|
||||
sleep 30
|
||||
ip="$(sudo "$LXC" list -c n4 -f csv | grep '^ncp' | cut -d ',' -f2)"
|
||||
ip="${ip/% *}"
|
||||
echo "${ip} nextcloudpi.local" | sudo tee /etc/hosts
|
||||
sudo sed -i 's/^.*nextcloudpi.local.*$//g' /etc/hosts
|
||||
echo "${ip} nextcloudpi.local" | sudo tee -a /etc/hosts
|
||||
- name: Test LXD Image
|
||||
working-directory: ./tests
|
||||
run: |
|
||||
|
||||
@ -28,7 +28,7 @@ export PATH="/usr/local/sbin:/usr/sbin:/sbin:${PATH}"
|
||||
type mysqld &>/dev/null && echo ">>> WARNING: existing mysqld configuration will be changed <<<"
|
||||
type mysqld &>/dev/null && mysql -e 'use nextcloud' &>/dev/null && { echo "The 'nextcloud' database already exists. Aborting"; exit 1; }
|
||||
|
||||
[[ "$DEBIAN_FRONTEND" == "noninteractive" ]] || {
|
||||
[[ "$CI" == "true" ]] || {
|
||||
echo "WARNING: This installer will disable SSH login for the root user and reset its password.
|
||||
If you need to login with root, you should make sure, you have a root session open that you can use,
|
||||
to revert these changes afterwards (set PermitRootLogin to 'yes' in /etc/ssh/sshd_config and run passwd as root)."
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user