Compare commits
6 Commits
1b2862dea5
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
| dde33ca5c3 | |||
| d12b4da065 | |||
| 3992a77c78 | |||
| 512b683d55 | |||
| fc74dc5d9b | |||
| edaac93dfd |
-15
@@ -31,18 +31,3 @@ assets = ["resources"]
|
||||
icon = "resources/icon.png"
|
||||
desktop_entry = "other/rs-dublinbus.desktop"
|
||||
auto-link=true
|
||||
|
||||
[target.aarch64-unknown-linux-gnu]
|
||||
cc = "aarch64-linux-gnu-gcc"
|
||||
cxx = "aarch64-linux-gnu-g++"
|
||||
ar = "aarch64-linux-gnu-ar"
|
||||
ranlib = "aarch64-linux-gnu-ranlib"
|
||||
linker = "aarch64-linux-gnu-ld"
|
||||
|
||||
|
||||
[target.arm-unknown-linux-gnueabihf]
|
||||
cc = "arm-linux-gnueabihf-gcc"
|
||||
cxx = "arm-linux-gnueabihf-g++"
|
||||
ar = "arm-linux-gnueabihf-ar"
|
||||
# ranlib = "arm-linux-gnueabihf-ranlib"
|
||||
linker = "arm-linux-gnueabihf-gcc"
|
||||
@@ -0,0 +1,97 @@
|
||||
# The deployment process works like this:
|
||||
# 1. Build locally just to make sure that things work
|
||||
# 2. SSH into the machine that will build the AppImage for ARM. There:
|
||||
# 2.1. run git pull to get the latest version of the code
|
||||
# 2.2. run argo appimage to build the image
|
||||
# 3. SCP the appimage back to the local machine
|
||||
# 4. SCP the files to the Raspberry Pi running the display:
|
||||
# AppImage
|
||||
# systemd service file
|
||||
# 5. SSH into the display machine as root and:
|
||||
# 5.1. Copy the AppImage file to /opt/dublinbus-display (create the directory if necessary)
|
||||
# 5.2. If the service exists, restart it and exit
|
||||
# 5.3. Copy the service file to /etc/systemd/system
|
||||
# 5.4. Enable and activate the service
|
||||
|
||||
|
||||
|
||||
# Variables
|
||||
GIT_REPO_URL="http://git.nahuellofeudo.com/nahuel/rs-dublinbus.git"
|
||||
|
||||
# For the build machine
|
||||
BUILD_MACHINE_NAME=raspi-ssd.localnet
|
||||
BUILD_MACHINE_USER=nahuel
|
||||
BUILD_MACHINE_SOURCE_DIRECTORY=/home/nahuel/Documents/sources
|
||||
|
||||
DEPLOY_MACHINE_NAME=dublinbus-display.local
|
||||
DEPLOY_MACHINE_USER=display
|
||||
DEPLOY_MACHINE_TARGET_DIRECTORY=/opt/dublinbus
|
||||
|
||||
|
||||
# 1. Build locally
|
||||
cargo appimage
|
||||
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo
|
||||
echo
|
||||
echo "-------------------------------------------------------"
|
||||
echo "\"cargo appimage\" failed. Check the logs"
|
||||
echo "-------------------------------------------------------"
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo
|
||||
echo
|
||||
echo "-------------------------------------------------------"
|
||||
echo "Local build successful "
|
||||
echo "-------------------------------------------------------"
|
||||
|
||||
|
||||
# 2. Build remotely on the ARM machine
|
||||
ssh $BUILD_MACHINE_USER@$BUILD_MACHINE_NAME << EOF
|
||||
echo Entering ${BUILD_MACHINE_SOURCE_DIRECTORY}
|
||||
cd ${BUILD_MACHINE_SOURCE_DIRECTORY}
|
||||
if [[ ! -d rs-dublinbus ]]; then
|
||||
git clone ${GIT_REPO_URL}
|
||||
cd rs-dublinbus
|
||||
else
|
||||
cd rs-dublinbus
|
||||
git reset --hard
|
||||
git pull
|
||||
fi
|
||||
|
||||
cargo appimage
|
||||
EOF
|
||||
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo
|
||||
echo
|
||||
echo "-------------------------------------------------------"
|
||||
echo "Remote build failed. Check the logs"
|
||||
echo "-------------------------------------------------------"
|
||||
exit $?
|
||||
fi
|
||||
|
||||
|
||||
echo
|
||||
echo
|
||||
echo "-------------------------------------------------------"
|
||||
echo "Remote build successful "
|
||||
echo "-------------------------------------------------------"
|
||||
|
||||
# 3. SCP the appimage back to the local machine
|
||||
scp $BUILD_MACHINE_USER@$BUILD_MACHINE_NAME:Documents/sources/rs-dublinbus/target/appimage/rs-dublinbus.AppImage /tmp
|
||||
|
||||
# 4. SCP the files to the Raspberry Pi running the display:
|
||||
scp /tmp/rs-dublinbus.AppImage $DEPLOY_MACHINE_USER@$DEPLOY_MACHINE_NAME:$DEPLOY_MACHINE_TARGET_DIRECTORY
|
||||
|
||||
# Set up the service
|
||||
ssh $DEPLOY_MACHINE_USER@$DEPLOY_MACHINE_NAME << EOF
|
||||
sudo systemctl restart dublinbus
|
||||
EOF
|
||||
|
||||
echo
|
||||
echo
|
||||
echo "-------------------------------------------------------"
|
||||
echo "Service deployed and restarted "
|
||||
echo "-------------------------------------------------------"
|
||||
@@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=Start Dublin Bus display
|
||||
After=multi-user.target
|
||||
Wants=multi-user.target
|
||||
|
||||
[Service]
|
||||
Restart=always
|
||||
Type=exec
|
||||
WorkingDirectory=/opt/dublinbus
|
||||
ExecStart=/opt/dublinbus/rs-dublinbus.AppImage
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -1,7 +1,7 @@
|
||||
screen:
|
||||
width: 1920
|
||||
height: 720
|
||||
font-path: "resources/jd_lcd_rounded/jd-lcd-rounded.ttf"
|
||||
font-path: "resources/jd-lcd-rounded.ttf"
|
||||
|
||||
gtfs:
|
||||
routes:
|
||||
@@ -11,7 +11,7 @@ gtfs:
|
||||
stops:
|
||||
- 1114
|
||||
- 2410
|
||||
data-folder: "/home/nahuel/Downloads"
|
||||
data-folder: "/tmp"
|
||||
gtfs-url: "https://www.transportforireland.ie/transitData/Data/GTFS_Realtime.zip"
|
||||
realtime-url: "https://api.nationaltransport.ie/gtfsr/v2/gtfsr"
|
||||
realtime-api-key: "aa8509902455412e886b9df11f0e21ec"
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
JECKO DEVELOPMENT FONT
|
||||
|
||||
This font was created by Jecko Development (http://www.jeckodevelopment.com)
|
||||
This font has a homepage where this archive and other versions may be found ::
|
||||
http://www.jeckodevelopment.com/fonts/
|
||||
This font is released under a Creative Commons Attribution Non-commercial No Derivatives
|
||||
license (http://creativecommons.org/licenses/by-nc-nd/3.0/).
|
||||
NOTE FOR FLASH USERS: This font is optimized for
|
||||
Flash. If the font in this archive is a pixel font, it is best displayed at a
|
||||
font-size of 64.
|
||||
|
||||
Feel free to write us at info@jeckodevelopment.com or visit our website http://www.jeckodevelopment.com
|
||||
|
||||
|
||||
+1
-1
@@ -101,7 +101,7 @@ impl Gtfs<'_> {
|
||||
|
||||
|
||||
/// Load a GTFS structure from a zip file
|
||||
pub fn load(prefs: &Preferences) -> Result<Gtfs, Error> {
|
||||
pub fn load(prefs: &Preferences) -> Result<Gtfs<'_>, Error> {
|
||||
|
||||
_ = refresher::refresh(prefs);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user