Skip to content

Commit

Permalink
Merged 1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
6XGate committed Aug 19, 2024
1 parent 3f08231 commit 260421c
Show file tree
Hide file tree
Showing 11 changed files with 324 additions and 43 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
compose.override.yml

### Node template
# Logs
logs
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
12
44 changes: 44 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
FROM --platform=linux/arm/v7 debian:buster

# Install the basics.
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y && \
apt-get install -y apt-utils && \
apt-get upgrade -y && \
apt-get install -y curl wget bash libatomic1 build-essential bash-completion git python3 libnss3 && \
rm -rf /var/lib/apt/lists && \
rm -rf /var/cache/apt

# Install the Electron dependencies.
RUN apt-get update -y && \
apt-get install -y xorg gconf2 gconf-service libnotify4 libappindicator1 libxtst6 \
libxss1 libasound2 libgl1-mesa-glx libgl1-mesa-dri && \
rm -rf /var/lib/apt/lists && \
rm -rf /var/cache/apt

# Install the project dependencies.
RUN apt-get update -y && \
apt-get install -y unzip && \
rm -rf /var/lib/apt/lists && \
rm -rf /var/cache/apt

# Default environment.
ENV SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt

# Setup user.
RUN useradd -m builder
USER builder

# Install node.
SHELL ["/bin/bash", "-lc"]
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
RUN nvm install 12 && \
nvm use 12

# Setup entrypoint.
COPY docker /
ENTRYPOINT [ "/entrypoint.sh" ]
CMD ["bash", "-l"]

# Project
WORKDIR /project
11 changes: 11 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
services:
build:
image: bridgecmdr/build
build: .
privileged: true
environment:
- DISPLAY=host.docker.internal:0
volumes:
- ".:/project"
- "/tmp/.X11-unix:/tmp/.X11-unix"
- "$HOME/.Xauthority:/home/builder/.Xauthority:rw"
2 changes: 2 additions & 0 deletions docker/entrypoint.d/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
12 changes: 12 additions & 0 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -Eeuo pipefail

for entry in /entrypoint.d/*.sh; do
if [ -f "$entry" ] && [ -x "$entry" ]; then
echo "Calling '${entry}'..."
"$entry"
fi
done
unset entry

"$@"
3 changes: 2 additions & 1 deletion electron.packer.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@ packager.source(".").target("linux", "armhf").
new RegExp("^/[^/]+\\.dic", "u"),
new RegExp("^/[^/]+\\.packer\\.js", "u"),
new RegExp("^/[^/]+-lock\\.json", "u"),
new RegExp("^/node_modules/\\.", "u"),

// At all levels, exclude these patterns
new RegExp("/tsconfig.json$", "u"),
new RegExp("\\.ts", "u"),
new RegExp("\\.ts$", "u"),
).
installer({
productDescription: "Professional Raspberry Pi A/V switch and monitor controller for retro gaming.",
Expand Down
10 changes: 1 addition & 9 deletions main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import unhandled from "electron-unhandled";
unhandled();

import { app, BrowserWindow } from "electron";
import installExtension, { VUEJS_DEVTOOLS } from "electron-devtools-installer";

let window: BrowserWindow|null = null;

Expand Down Expand Up @@ -65,14 +64,7 @@ process.on("SIGTERM", () => {
});

app.on("ready", (): void => {
if (process.env.NODE_ENV !== "production") {
installExtension(VUEJS_DEVTOOLS).
then(name => { console.log(`Installing ${name}`); }).
then(() => { createWindow(); }).
catch(error => { console.error(error); });
} else {
createWindow();
}
createWindow();
});

app.on("window-all-closed", (): void => {
Expand Down
Loading

0 comments on commit 260421c

Please sign in to comment.