Skip to content

Commit 9099b34

Browse files
authored
Updated build and added custom config.ini support to docker scripts (#220) (#221)
1 parent 19899c5 commit 9099b34

5 files changed

Lines changed: 34 additions & 13 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,6 @@ platforms_idmap_local.csv
7373
# VS Code
7474
*.code-workspace
7575
.vscode
76+
77+
# docker config
78+
docker/config.ini

docker/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ RUN rm -rf /var/lib/apt/lists/*
2323
RUN useradd -m docker && echo "docker:docker" | chpasswd && adduser docker sudo
2424

2525
# Building skyscraper
26-
COPY ./* ./
26+
RUN mkdir -p /opt/skyscraper
27+
WORKDIR /opt/skyscraper
28+
COPY . .
2729
RUN rm -f ./VERSION.ini
2830
RUN chmod +x update_skyscraper.sh && ./update_skyscraper.sh
2931

docker/process_dir.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
11
#!/bin/bash
22

33
# Usage:
4-
# ./process_dir.sh [ROMS_DIR]
4+
# ./process_dir.sh [ROMS_DIR] {source1} {source2} ...
55
# Example
66
# ./process_dir.sh ~/roms
7-
# ./process_dir.sh ~/roms > output.txt
7+
# ./process_dir.sh ~/roms screenscraper > output.txt
88
#
9-
# Note: can be use for Emulation Station roms folder, but platform name can be different. ES's genesis is megadrive for skyscraper,
9+
# Note: can be use for Emulation Station roms folder, but platform name can be different. ES's genesis is megadrive for skyscraper.
10+
# Defaults to screenscraper and thegamesdb sources if none are specified.
1011

1112
TAG=skyscraper
1213

1314
PLATFORMS=$1/*
15+
shift
16+
17+
SOURCES=("$@")
18+
if [ ${#SOURCES[@]} -eq 0 ]; then
19+
SOURCES=(screenscraper thegamesdb)
20+
fi
1421

1522
mkdir cache
1623

@@ -23,7 +30,7 @@ for file_name in $PLATFORMS; do
2330
echo "Processing ${PLATFORM}..."
2431
echo "Mounting $file_name:./roms/$PLATFORM..."
2532

26-
for source in "screenscraper" "thegamesdb"; do
33+
for source in "${SOURCES[@]}"; do
2734
echo "Processing $PLATFORM on $source..."
2835

2936
./scrape.sh $file_name $PLATFORM $source

docker/save.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/bin/bash
22

33
# Usage:
4-
# ./scrape.sh [ROMS_DIR] [PLATFORM]
4+
# ./save.sh [ROMS_DIR] [PLATFORM]
55
# Example
6-
# ./scrape.sh ./roms/snes snes
6+
# ./save.sh ./roms/snes snes
77

88
TAG=skyscraper
99

@@ -14,4 +14,4 @@ docker run \
1414
-v "$ROMS_DIR:/tmp/roms/$PLATFORM" \
1515
-v "$(pwd)/cache:/tmp/skyscraper_cache" \
1616
$TAG \
17-
-p $PLATFORM -i /tmp/roms/$PLATFORM -d /tmp/skyscraper_cache --flags relative,unattendskip
17+
-p $PLATFORM -i /tmp/roms/$PLATFORM -g /tmp/roms/$PLATFORM -o /tmp/roms/$PLATFORM/media -d /tmp/skyscraper_cache --flags relative,unattend

docker/scrape.sh

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,17 @@ ROMS_DIR=$1
1111
PLATFORM=$2
1212
SOURCE=$3
1313

14-
docker run \
15-
-v "$ROMS_DIR:/tmp/roms/$PLATFORM" \
16-
-v "$(pwd)/cache:/tmp/skyscraper_cache" \
17-
$TAG \
18-
-p $PLATFORM -s $SOURCE -i /tmp/roms/$PLATFORM -d /tmp/skyscraper_cache
14+
if [ -f ./config.ini ]; then
15+
docker run \
16+
-v "$ROMS_DIR:/tmp/roms/$PLATFORM" \
17+
-v "$(pwd)/cache:/tmp/skyscraper_cache" \
18+
-v "$(pwd)/config.ini:/root/.skyscraper/config.ini" \
19+
$TAG \
20+
-p $PLATFORM -s $SOURCE -i /tmp/roms/$PLATFORM -d /tmp/skyscraper_cache
21+
else
22+
docker run \
23+
-v "$ROMS_DIR:/tmp/roms/$PLATFORM" \
24+
-v "$(pwd)/cache:/tmp/skyscraper_cache" \
25+
$TAG \
26+
-p $PLATFORM -s $SOURCE -i /tmp/roms/$PLATFORM -d /tmp/skyscraper_cache
27+
fi

0 commit comments

Comments
 (0)