Skip to content

Commit

Permalink
Add inital offline install capabilities
Browse files Browse the repository at this point in the history
Supersedes openhab#985
Fixes openhab#984

Signed-off-by: Ethan Dye <[email protected]>
  • Loading branch information
ecdye committed Sep 23, 2020
1 parent 116468c commit 9536d23
Show file tree
Hide file tree
Showing 17 changed files with 314 additions and 190 deletions.
60 changes: 29 additions & 31 deletions .github/workflows/build-action.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
name: Build Image
name: Build openHABian images

# Trigger the workflow on push or pull request
on:
push:
paths:
- 'build.bash'
- 'build-image/openhabian-installer.service'
- 'includes/offline-image-modifications.bash'
pull_request:
paths:
- 'build.bash'
- 'build-image/openhabian-installer.service'
- 'includes/offline-image-modifications.bash'
workflow_dispatch:
inputs:
comments:
Expand All @@ -27,31 +29,29 @@ jobs:
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- name: Environment variables
run: sudo -E bash -c set
- name: Install required packages
run: sudo apt-get install git curl unzip libarchive-zip-perl dos2unix xz-utils kpartx
- name: getimagename
id: getimagename
- name: Setup environment
id: setup
run: |
sudo -E bash -c set
sudo apt-get update
sudo apt-get install --yes libarchive-zip-perl dos2unix kpartx systemd-container zerofree qemu-user-static
echo "::set-output name=image::$(basename "$(curl "https://downloads.raspberrypi.org/raspios_lite_armhf_latest" -s -L -I -o /dev/null -w '%{url_effective}')")"
- name: Cache Raspberry Pi OS image
uses: actions/cache@v2
with:
path: ${{ steps.getimagename.outputs.image }}
key: ${{ steps.getimagename.outputs.image }}
- name: Run build.bash rpi
path: ${{ steps.setup.outputs.image }}
key: ${{ steps.setup.outputs.image }}
- name: Build openHABian 32bit image
id: build
run: |
sudo -E ./ci-setup.bash github pi-raspios32
sudo -E ./build.bash rpi
- name: getfilename
id: getfilename
run: echo "::set-output name=file::$(ls openhabian-*.img.xz)"
- name: Archive
echo "::set-output name=file::$(ls openhabian-*.img.xz)"
- name: Archive openHABian 32bit image
uses: actions/upload-artifact@v2
with:
name: ${{ steps.getfilename.outputs.file }}
path: ${{ steps.getfilename.outputs.file }}
name: ${{ steps.build.outputs.file }}
path: ${{ steps.build.outputs.file }}
build64experimental:
# Using latest Ubuntu (not the GitHub Actions default) to get latest tool versions in GitHub Actions environment
runs-on: ubuntu-20.04
Expand All @@ -62,28 +62,26 @@ jobs:
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- name: Environment variables
run: sudo -E bash -c set
- name: Install required packages
run: sudo apt-get install git curl unzip libarchive-zip-perl dos2unix xz-utils kpartx
- name: getimagename
id: getimagename
- name: Setup environment
id: setup
run: |
sudo -E bash -c set
sudo apt-get update
sudo apt-get install --yes libarchive-zip-perl dos2unix kpartx systemd-container zerofree qemu-user-static
echo "::set-output name=image::$(basename "$(curl "https://downloads.raspberrypi.org/raspios_lite_arm64_latest" -s -L -I -o /dev/null -w '%{url_effective}')")"
- name: Cache Raspberry Pi OS image
uses: actions/cache@v2
with:
path: ${{ steps.getimagename.outputs.image }}
key: ${{ steps.getimagename.outputs.image }}
- name: Run build.bash rpi64
path: ${{ steps.setup.outputs.image }}
key: ${{ steps.setup.outputs.image }}
- name: Build openHABian 64bit image
id: build
run: |
sudo -E ./ci-setup.bash github pi-raspios64beta
sudo -E ./build.bash rpi64
- name: getfilename
id: getfilename
run: echo "::set-output name=file::$(ls openhabian-*.img.xz)"
- name: Archive
echo "::set-output name=file::$(ls openhabian-*.img.xz)"
- name: Archive openHABian 64bit image
uses: actions/upload-artifact@v2
with:
name: ${{ steps.getfilename.outputs.file }}
path: ${{ steps.getfilename.outputs.file }}
name: ${{ steps.build.outputs.file }}
path: ${{ steps.build.outputs.file }}
4 changes: 1 addition & 3 deletions .github/workflows/shellcheck-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Environment variables
- name: Setup environment
run: sudo -E bash -c set
- name: Install required packages
run: sudo apt-get install shellcheck
- name: "ShellCheck openhabian-setup.sh"
run: |
echo "ShellCheck openhabian-setup.sh..."
Expand Down
1 change: 1 addition & 0 deletions build-image/first-boot.bash
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ type openhabian_update &> /dev/null && if ! openhabian_update &> /dev/null; then
echo "FAILED"
echo "$(timestamp) [openHABian] The git repository on the public internet is not reachable."
echo "$(timestamp) [openHABian] We will continue trying to get your system installed, but this is not guaranteed to work."
export OFFLINE="1"
else
echo "OK"
fi
Expand Down
2 changes: 1 addition & 1 deletion build-image/openhabian.conf
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,5 @@ java_opt=Zulu8-64
#relaypass=secret
#smarthost=smtp.gmail.com
#smartport=587
#

# vim: filetype=sh
2 changes: 1 addition & 1 deletion build-image/openhabian.pi-raspios64beta.conf
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,5 @@ java_opt=Zulu11-64
#relaypass=secret
#smarthost=smtp.gmail.com
#smartport=587
#

# vim: filetype=sh
Loading

0 comments on commit 9536d23

Please sign in to comment.