Compare commits
4 Commits
fc74dc5d9b
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
| dde33ca5c3 | |||
| d12b4da065 | |||
| 3992a77c78 | |||
| 512b683d55 |
-15
@@ -31,18 +31,3 @@ assets = ["resources"]
|
|||||||
icon = "resources/icon.png"
|
icon = "resources/icon.png"
|
||||||
desktop_entry = "other/rs-dublinbus.desktop"
|
desktop_entry = "other/rs-dublinbus.desktop"
|
||||||
auto-link=true
|
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"
|
|
||||||
@@ -23,6 +23,10 @@ BUILD_MACHINE_NAME=raspi-ssd.localnet
|
|||||||
BUILD_MACHINE_USER=nahuel
|
BUILD_MACHINE_USER=nahuel
|
||||||
BUILD_MACHINE_SOURCE_DIRECTORY=/home/nahuel/Documents/sources
|
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
|
# 1. Build locally
|
||||||
cargo appimage
|
cargo appimage
|
||||||
@@ -42,19 +46,20 @@ echo "-------------------------------------------------------"
|
|||||||
echo "Local build successful "
|
echo "Local build successful "
|
||||||
echo "-------------------------------------------------------"
|
echo "-------------------------------------------------------"
|
||||||
|
|
||||||
|
|
||||||
# 2. Build remotely on the ARM machine
|
# 2. Build remotely on the ARM machine
|
||||||
ssh $BUILD_MACHINE_USER@$BUILD_MACHINE_NAME << EOF
|
ssh $BUILD_MACHINE_USER@$BUILD_MACHINE_NAME << EOF
|
||||||
echo Entering ${BUILD_MACHINE_SOURCE_DIRECTORY}
|
echo Entering ${BUILD_MACHINE_SOURCE_DIRECTORY}
|
||||||
cd ${BUILD_MACHINE_SOURCE_DIRECTORY}
|
cd ${BUILD_MACHINE_SOURCE_DIRECTORY}
|
||||||
if [[ ! -n rs-dublinbus ]]; then
|
if [[ ! -d rs-dublinbus ]]; then
|
||||||
git clone ${GIT_REPO_URL}
|
git clone ${GIT_REPO_URL}
|
||||||
cd rs-dublinbus
|
cd rs-dublinbus
|
||||||
else
|
else
|
||||||
cd rs-dublinbus
|
cd rs-dublinbus
|
||||||
|
git reset --hard
|
||||||
git pull
|
git pull
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cargo clean
|
|
||||||
cargo appimage
|
cargo appimage
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
@@ -67,8 +72,26 @@ if [[ $? -ne 0 ]]; then
|
|||||||
exit $?
|
exit $?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo
|
echo
|
||||||
echo "-------------------------------------------------------"
|
echo "-------------------------------------------------------"
|
||||||
echo "Remote build successful "
|
echo "Remote build successful "
|
||||||
echo "-------------------------------------------------------"
|
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 "-------------------------------------------------------"
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ Wants=multi-user.target
|
|||||||
[Service]
|
[Service]
|
||||||
Restart=always
|
Restart=always
|
||||||
Type=exec
|
Type=exec
|
||||||
|
WorkingDirectory=/opt/dublinbus
|
||||||
ExecStart=/opt/dublinbus/rs-dublinbus.AppImage
|
ExecStart=/opt/dublinbus/rs-dublinbus.AppImage
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
screen:
|
screen:
|
||||||
width: 1920
|
width: 1920
|
||||||
height: 720
|
height: 720
|
||||||
font-path: "resources/jd_lcd_rounded/jd-lcd-rounded.ttf"
|
font-path: "resources/jd-lcd-rounded.ttf"
|
||||||
|
|
||||||
gtfs:
|
gtfs:
|
||||||
routes:
|
routes:
|
||||||
@@ -11,7 +11,7 @@ gtfs:
|
|||||||
stops:
|
stops:
|
||||||
- 1114
|
- 1114
|
||||||
- 2410
|
- 2410
|
||||||
data-folder: "/home/nahuel/Downloads"
|
data-folder: "/tmp"
|
||||||
gtfs-url: "https://www.transportforireland.ie/transitData/Data/GTFS_Realtime.zip"
|
gtfs-url: "https://www.transportforireland.ie/transitData/Data/GTFS_Realtime.zip"
|
||||||
realtime-url: "https://api.nationaltransport.ie/gtfsr/v2/gtfsr"
|
realtime-url: "https://api.nationaltransport.ie/gtfsr/v2/gtfsr"
|
||||||
realtime-api-key: "aa8509902455412e886b9df11f0e21ec"
|
realtime-api-key: "aa8509902455412e886b9df11f0e21ec"
|
||||||
|
|||||||
+1
-1
@@ -101,7 +101,7 @@ impl Gtfs<'_> {
|
|||||||
|
|
||||||
|
|
||||||
/// Load a GTFS structure from a zip file
|
/// 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);
|
_ = refresher::refresh(prefs);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user