...
 
Commits (7)
......@@ -11,13 +11,39 @@ stages:
- test
- release
#####################
# CI Variables
#####################
# - CI_JRIVER_RELEASE=24/25
# Major Version of JRiver MediaCenter
#
# - CI_JRIVER_RELEASE_TAG=latest/stable
# Repository latest or stable
#
# - CI_IMAGE_PREFIX=jriver
# Some prefix for images that are built in the build stage and later used
# to prevent accidently pushing the wrong image to the wrong repo when pipelines run at the same time
#
# - CI_REGISTRY
# Docker registry to use
#
# - CI_REGISTRY_IMAGE=index.docker.io/shiomax/jrivermc25
# Where to push to.
#
# - CI_REGISTRY_IMAGE_NAME=shiomax/jrivermc25
# Needed for tagging. Could be extracted from $CI_REGISTRY_IMAGE
#
# - CI_REGISTRY_USER
# - CI_REGISTRY_PASSWORD
#####################
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
build:
stage: build
script:
- ./scripts/build.sh "$CI_JRIVER_RELEASE" "$CI_JRIVER_RELEASE_TAG"
- ./scripts-ci/build.sh
only:
- triggers
- schedules
......@@ -25,7 +51,7 @@ build:
test:
stage: test
script:
- ./scripts/test.sh "jrivermc$CI_JRIVER_RELEASE:$CI_JRIVER_RELEASE_TAG"
- ./scripts-ci/test.sh
only:
- triggers
- schedules
......@@ -33,7 +59,7 @@ test:
release:
stage: release
script:
- ./scripts/release.sh "jrivermc$CI_JRIVER_RELEASE:$CI_JRIVER_RELEASE_TAG" "$CI_JRIVER_RELEASE_TAG"
- ./scripts-ci/release.sh
only:
- triggers
- schedules
\ No newline at end of file
FROM jlesage/baseimage-gui:debian-9
FROM jlesage/baseimage-gui:debian-9-v3.5.2
ARG jriver_tag
ARG jriver_release
......@@ -31,10 +31,14 @@ ENV KEEP_APP_RUNNING=1 \
DISPLAY_WIDTH=1280 \
DISPLAY_HEIGHT=768 \
APP_NAME="JRiver MediaCenter ${jriver_release}" \
ENABLE_SIGNATURE=1 \
MAXIMIZE_POPUPS=0 \
S6_KILL_GRACETIME=8000
# Modify startapp.sh with jriver release version
RUN sed-patch s/%%mediacenter%%/mediacenter${jriver_release}/g \
/startapp.sh
# Modify startapp.sh and rc.xml with JRiver version
RUN sed-patch s/%%MC_VERSION%%/${jriver_release}/g \
/startapp.sh && \
sed-patch s/%%MC_VERSION%%/${jriver_release}/g \
/etc/xdg/openbox/rc.xml
EXPOSE 5800 5900 52100 52101 52199 1900/udp
\ No newline at end of file
......@@ -191,6 +191,13 @@ ports=5800,52199,52100,52101,5900/tcp|1900/udp
# Environment Variables
Specific to this image
| Variable | Description | Default |
|----------------|----------------------------------------------|---------|
| `ENABLE_SIGNATURE` | When set to `1` some ASCII art is printed to the console when JRiver starts. | `1` |
| `MAXIMIZE_POPUPS` | When set to `1` maximizes JRiver popup Windows. | `0` |
Those are inherited from the base image [jlesage/baseimage-gui](https://github.com/jlesage/docker-baseimage-gui). Some have their default values changed.
| Variable | Description | Default |
......@@ -210,4 +217,24 @@ Those are inherited from the base image [jlesage/baseimage-gui](https://github.c
|`SECURE_CONNECTION`| When set to `1`, an encrypted connection is used to access the application's GUI (either via web browser or VNC client). See the [Security](https://github.com/jlesage/docker-baseimage-gui#security) section for more details. | `0` |
|`VNC_PASSWORD`| Password needed to connect to the application's GUI. See the [VNC Password](https://github.com/jlesage/docker-baseimage-gui#vnc-password) section for more details. | (unset) |
|`X11VNC_EXTRA_OPTS`| Extra options to pass to the x11vnc server running in the Docker container. **WARNING**: For advanced users. Do not use unless you know what you are doing. | (unset) |
|`ENABLE_CJK_FONT`| When set to `1`, open source computer font `WenQuanYi Zen Hei` is installed. This font contains a large range of Chinese/Japanese/Korean characters. | `0` |
\ No newline at end of file
|`ENABLE_CJK_FONT`| When set to `1`, open source computer font `WenQuanYi Zen Hei` is installed. This font contains a large range of Chinese/Japanese/Korean characters. | `0` |
# Changelog
### Version 2
- xpropspy now uses sh instead of bash (microoptimization sh is faster, but can do less)
- ascii art on startup and environment variable ENABLE_SIGNATURE (1 by default)
- specifying debian-9-v3.5.2 instead of latest, witch is currently equivalent (to avoid breaking the image on automated builds)
- removed portion for main jriver window from rc.xml as no longer needed (also seems to have fixed some ui gliches in the integrated webgui)
- added option MAXIMIZE_POPUPS to maximize every window that has the name "JRiver Popup Class" (0 by default)
### Version 1
- added image version
# Donations
**Paypal**
[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=AV2PUTYBEJXL4)
Donations are totally optional. You are not obligated to do anything! But if you like the project, I'd not complain about a free cup of coffee.
\ No newline at end of file
......@@ -9,7 +9,9 @@ if [ ! -d "./config" ]; then
fi
# Build image
docker build -t jrivertest --build-arg jriver_tag=stable .
docker build -t jrivertest \
--build-arg jriver_tag=latest \
--build-arg jriver_release=25 .
if [ "$1" == "-a" ]; then
# Run image mapping all ports
......@@ -29,8 +31,8 @@ else
docker run -d \
--name=jrivertest \
--net=bridge \
-p 5800:5800 \
-p 52199:52199 \
-p 5801:5800 \
-p 52200:52199 \
-v config:/config \
jrivertest
fi;
\ No newline at end of file
1
\ No newline at end of file
2
\ No newline at end of file
#!/usr/bin/with-contenv sh
if [ "$MAXIMIZE_POPUPS" = "1" ]; then
sed -i '/<\/applications>/{
r /templates/max-popups.xml
a \</applications>
d
}' /etc/xdg/openbox/rc.xml
fi;
\ No newline at end of file
#!/bin/bash
#!/usr/bin/with-contenv sh
while read line; do
search=$(echo "$line" | grep "_NET_ACTIVE_WINDOW(WINDOW): window id # ")
......@@ -6,7 +6,7 @@ while read line; do
hex=$(echo "$line" | cut -c41-)
clients=$(obxprop --root | grep '^_NET_CLIENT_LIST(WINDOW)' | grep -o '[0-9]\+')
if [ "$hex" == "0x0" ]; then
if [ "$hex" = "0x0" ]; then
switch_to=$(echo $clients | awk '{print $NF}')
echo "[$(date +%d-%m-%Y_%H-%M-%S)] Changing Window to: $switch_to" >> /tmp/xpropspy.log
wmctrl -i -a $switch_to
......
......@@ -373,10 +373,10 @@
</menu>
<applications>
<application type="normal" title="JRiver Media Center 25">
<decor>no</decor>
<application type="normal" title="JRiver Media Center %%MC_VERSION%%">
<!--<decor>no</decor>-->
<maximized>true</maximized>
<layer>below</layer>
<!--<layer>below</layer>-->
</application>
</applications>
......
#!/bin/sh
export HOME=/config
exec env HOME=/config %%mediacenter%% /mediaserver
\ No newline at end of file
if [ "$ENABLE_SIGNATURE" = "1" ]; then
echo '--------------------------------------------------'
cat << "EOF"
___ _ _
/ __| |_ (_)___
\__ \ ' \| / _ \
|___/_||_|_\___/
EOF
echo 'Unofficial JRiver MC Image brought to you by shio!'
echo "Image Version: $(cat /VERSION)"
echo ''
echo 'Source: https://gitlab.shio.at/max/jrivermc-docker'
echo 'Dockerhub: https://hub.docker.com/u/shiomax'
echo ''
echo '--------------------------------------------------'
fi;
exec env HOME=/config mediacenter%%MC_VERSION%% /mediaserver
\ No newline at end of file
<application type="normal" name="JRiver Popup Class">
<decor>no</decor>
<maximized>true</maximized>
</application>
\ No newline at end of file
......@@ -5,22 +5,8 @@
#############
# NOTE: This script is intended to be run from the root of repo
if [ "$1" == "" ]; then
echo "JRiver release was not supplied. Exiting."
exit 1
else
JRIVER_MAJOR_RELEASE="$1"
fi;
if [ "$1" == "" ]; then
echo "JRiver tag was not supplied. Exiting."
exit 1
else
JRIVER_BUILD_TAG="$2"
fi;
docker build \
--no-cache --pull \
--build-arg jriver_tag=$JRIVER_BUILD_TAG \
--build-arg jriver_release=$JRIVER_MAJOR_RELEASE \
-t "jrivermc$JRIVER_MAJOR_RELEASE:$JRIVER_BUILD_TAG" .
\ No newline at end of file
--build-arg jriver_tag=$CI_JRIVER_RELEASE_TAG \
--build-arg jriver_release=$CI_JRIVER_RELEASE \
-t "$CI_IMAGE_PREFIX$CI_JRIVER_RELEASE:$CI_JRIVER_RELEASE_TAG" .
\ No newline at end of file
......@@ -5,22 +5,6 @@
#############
# NOTE: This script is intended to be run from the root of repo
# Name of the container that was built in the build stage
if [ "$1" == "" ]; then
echo "Container to release was not supplied. Exiting."
exit 1
else
IMAGE_TO_RELEASE="$1"
fi;
# Get input variables
if [ "$2" == "latest" ] || [ "$2" == "stable" ]; then
JRIVER_TARGET="$2"
else
echo "JRiver target (latest or stable) was not supplied."
exit 1
fi
# Version of the container
IMAGE_VERSION=$(cat rootfs/VERSION)
......@@ -40,7 +24,7 @@ function start_container() {
--name=$CONTAINER_NAME \
--net=bridge \
-p 52199:52199 \
"$IMAGE_TO_RELEASE"
"$CI_IMAGE_PREFIX$CI_JRIVER_RELEASE:$CI_JRIVER_RELEASE_TAG"
# Giving the container some time to start
sleep 60
......@@ -58,7 +42,7 @@ function determine_jriver_version() {
fi;
# Release tag in form of 25.0.50-stable-1
RELEASE_TAG="$JRIVER_VERSION-$JRIVER_TARGET-$IMAGE_VERSION"
RELEASE_TAG="$JRIVER_VERSION-$CI_JRIVER_RELEASE_TAG-$IMAGE_VERSION"
echo "RELEASE TAG: $RELEASE_TAG"
# Check if tag really is what's expected
......@@ -78,15 +62,15 @@ function push_versioned_container() {
echo "Image exists already. Skipping push."
else
echo "Image does not exist. Pushing versioned container."
docker tag "$IMAGE_TO_RELEASE" "$CI_REGISTRY_IMAGE_NAME:$RELEASE_TAG"
docker tag "$CI_IMAGE_PREFIX$CI_JRIVER_RELEASE:$CI_JRIVER_RELEASE_TAG" "$CI_REGISTRY_IMAGE_NAME:$RELEASE_TAG"
docker push "$CI_REGISTRY_IMAGE_NAME:$RELEASE_TAG"
fi;
}
function push_rolling_container() {
echo "Pushing rolling container."
docker tag "$IMAGE_TO_RELEASE" "$CI_REGISTRY_IMAGE_NAME:$JRIVER_TARGET"
docker push "$CI_REGISTRY_IMAGE_NAME:$JRIVER_TARGET"
docker tag "$CI_IMAGE_PREFIX$CI_JRIVER_RELEASE:$CI_JRIVER_RELEASE_TAG" "$CI_REGISTRY_IMAGE_NAME:$CI_JRIVER_RELEASE_TAG"
docker push "$CI_REGISTRY_IMAGE_NAME:$CI_JRIVER_RELEASE_TAG"
}
start_container
......
......@@ -4,13 +4,6 @@
# shiomax/jrivermc test script
#############
if [ "$1" == "" ]; then
echo "Container to test was not supplied. Exiting."
exit 1
else
TEST_TAG="$1"
fi;
CONTAINER_NAME="jriver_pipeline_test"
function cleanup() {
......@@ -26,7 +19,7 @@ function start_container() {
--name=$CONTAINER_NAME \
--net=bridge \
-p 52199:52199 \
"$TEST_TAG"
"$CI_IMAGE_PREFIX$CI_JRIVER_RELEASE:$CI_JRIVER_RELEASE_TAG"
# Giving the container some time to start
sleep 60
......