Browse Source

Housekeeping (#84)

swap
Mayank Chhabra 5 years ago
committed by GitHub
parent
commit
562abfccd8
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      .github/workflows/on-push.yml
  2. 2
      config
  3. 13
      stage2/04-install-docker/00-run.sh
  4. 0
      stage2/04-install-umbrel/00-packages
  5. 32
      stage2/04-install-umbrel/01-run.sh
  6. 0
      stage2/05-set-umbrel-os-version/00-patches/01-profile.diff
  7. 0
      stage2/05-set-umbrel-os-version/00-patches/series
  8. 2
      stage2/05-set-umbrel-os-version/01-run.sh
  9. 1
      stage2/05-set-umbrel-os-version/files/umbrel
  10. 1
      stage2/06-set-env-variables/01-run.sh
  11. 1
      stage2/06-set-env-variables/files/umbrel

6
.github/workflows/on-push.yml

@ -36,13 +36,15 @@ jobs:
- name: Set image name
run: |
IMAGE_NAME="umbrel-os-$(git describe --tags)"
UMBREL_OS_VERSION="$(git describe --tags)"
IMAGE_NAME="umbrel-os-${UMBREL_OS_VERSION}"
echo "::set-env name=UMBREL_OS_VERSION::$UMBREL_OS_VERSION"
echo "::set-env name=IMAGE_NAME::$IMAGE_NAME"
- name: Run build script
run: |
echo "Building $IMAGE_NAME"
sudo IMG_FILENAME=$IMAGE_NAME ZIP_FILENAME=$IMAGE_NAME ./build.sh
sudo IMG_FILENAME=$IMAGE_NAME ZIP_FILENAME=$IMAGE_NAME UMBREL_OS_VERSION=$UMBREL_OS_VERSION ./build.sh
- name: Copy ZIP to current working dir
run: cp deploy/*.zip ./

2
config

@ -4,4 +4,4 @@ TIMEZONE_DEFAULT="Etc/UTC"
FIRST_USER_NAME=umbrel
FIRST_USER_PASS=moneyprintergobrrr
ENABLE_SSH=1
UMBREL_VERSION=0.1.6-beta
UMBREL_VERSION=0.1.6-beta

13
stage2/04-install-docker/00-run.sh

@ -1,13 +0,0 @@
#!/bin/bash -e
echo "Installing Docker"
on_chroot << EOF
export CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
curl -fsSL https://get.docker.com | sh
EOF
echo "Adding user to the 'docker' group"
echo "Also fixing permissions on folders"
on_chroot << EOF
usermod -a -G docker $FIRST_USER_NAME
chown -R $FIRST_USER_NAME:$FIRST_USER_NAME /home/$FIRST_USER_NAME
EOF

0
stage2/05-docker-compose/00-packages → stage2/04-install-umbrel/00-packages

32
stage2/05-docker-compose/01-run.sh → stage2/04-install-umbrel/01-run.sh

@ -1,25 +1,47 @@
#!/bin/bash -e
# Install docker via pip3 (within chroot)
echo "Installing docker-compose from pip3, and also setting up the box folder structure"
# This script:
# - Installs Umbrel's dependencies
# - Installs Umbrel
# Install Docker
echo "Installing Docker..."
echo
on_chroot << EOF
curl -fsSL https://get.docker.com | sh
usermod -a -G docker $FIRST_USER_NAME
EOF
# Install Docker Compose with pip3
echo "Installing Docker Compose..."
echo
on_chroot << EOF
pip3 install docker-compose
EOF
# Install Umbrel
echo "Installing Umbrel..."
echo
on_chroot << EOF
mkdir /home/${FIRST_USER_NAME}/umbrel
cd /home/${FIRST_USER_NAME}/umbrel
git clone https://github.com/getumbrel/umbrel.git .
chown -R ${FIRST_USER_NAME}:${FIRST_USER_NAME} /home/${FIRST_USER_NAME}
EOF
echo "Pulling Docker images required to run Umbrel services"
# Bundle Umbrel's Docker images
echo "Pulling Umbrel's Docker images..."
echo
wget -q "https://raw.githubusercontent.com/getumbrel/umbrel/v${UMBREL_VERSION}/docker-compose.yml"
IMAGES=$(grep '^\s*image' docker-compose.yml | sed 's/image://' | sed 's/\"//g' | sed '/^$/d;s/[[:blank:]]//g' | sort | uniq)
echo "List of images to download: $IMAGES"
echo
echo "Images to bundle: $IMAGES"
echo
while IFS= read -r image; do
docker pull --platform=linux/arm64 $image
done <<< "$IMAGES"
# Copy the entire /var/lib/docker directory to image
mkdir -p ${ROOTFS_DIR}/var/lib/docker
rsync -qavPHSX /var/lib/docker ${ROOTFS_DIR}/var/lib/

0
stage2/06-set-env-variables/00-patches/01-profile.diff → stage2/05-set-umbrel-os-version/00-patches/01-profile.diff

0
stage2/06-set-env-variables/00-patches/series → stage2/05-set-umbrel-os-version/00-patches/series

2
stage2/05-set-umbrel-os-version/01-run.sh

@ -0,0 +1,2 @@
sed -i -e "s/UMBREL_OS=<version>/UMBREL_OS=$UMBREL_OS_VERSION/g" files/umbrel
install -m 644 files/umbrel "${ROOTFS_DIR}"/etc/default/umbrel

1
stage2/05-set-umbrel-os-version/files/umbrel

@ -0,0 +1 @@
UMBREL_OS=<version>

1
stage2/06-set-env-variables/01-run.sh

@ -1 +0,0 @@
install -m 644 files/umbrel "${ROOTFS_DIR}"/etc/default/umbrel

1
stage2/06-set-env-variables/files/umbrel

@ -1 +0,0 @@
UMBREL_OS="0.0.4.beta.5"
Loading…
Cancel
Save