~mapperr/dockerfiles

fad87039103bd29ad3a1bc408f51bfeda602f84c — mapperr 28 days ago 8d6af1a master
stuff
2 files changed, 22 insertions(+), 7 deletions(-)

M laminarCI/build.sh
M laminarCI/entry.sh
M laminarCI/build.sh => laminarCI/build.sh +13 -1
@@ 1,4 1,4 @@
#!/bin/sh -eu
#!/bin/sh -e

laminar_version="$1"
build_number="$2"


@@ 15,10 15,22 @@ tag_base="mapperr/laminar:$laminar_version-$build_number"
tag_laminar_version="mapperr/laminar:$laminar_version"
tag_latest="mapperr/laminar:latest"

echo "building laminar base image"
laminar_srcdir=/tmp/laminar
test -d $laminar_srcdir && rm -rf $laminar_srcdir
git clone --depth 1 -b $laminar_version \
    https://github.com/ohwgiles/laminar.git \
    $laminar_srcdir
cd $laminar_srcdir
docker build -f docker/Dockerfile -t laminarci/laminar:$laminar_version .
cd -

echo "building laminar enhanced image"
docker build -t $tag_base .
docker tag $tag_base $tag_laminar_version
test "$is_latest" = "y" && docker tag $tag_base $tag_latest

echo "pushing laminar enhanced image"
docker push $tag_base
docker push $tag_laminar_version
test "$is_latest" = "y" && docker push $tag_latest

M laminarCI/entry.sh => laminarCI/entry.sh +9 -6
@@ 1,12 1,15 @@
#!/bin/sh -ex

if ! test -z "$LAMINAR_ENABLE_SSH"; then
	rm -rf /var/lib/laminar/.ssh/authorized_keys
    authkeys_file=/var/lib/laminar/.ssh/authorized_keys
	test -f $authkeys_file &&
	    rm -rf $authkeys_file
	for pubkey in $(ls /etc/authorized_keys); do
		cat /etc/authorized_keys/$pubkey \
			>>/var/lib/laminar/.ssh/authorized_keys
			>>$authkeys_file
	done
	chown laminar:users /var/lib/laminar/.ssh/authorized_keys
	test -f $authkeys_file &&
	    chown laminar:users $authkeys_file
	exec /usr/sbin/sshd -D -e "$@" &
fi



@@ 14,9 17,9 @@ if ! test -z "$LAMINAR_ENABLE_WEBHOOKS"; then
    laminar_config=$LAMINAR_HOME/cfg
    test -z "$LAMINAR_HOME" &&
        laminar_config=/var/lib/laminar/cfg
    test -z "$WHD_SCRIPTS" &&
        WHD_SCRIPTS=$laminar_config/webhooks
    export WHD_SCRIPTS
    test -z "$WHD_HOOK_SCRIPTS" &&
        export WHD_HOOK_SCRIPTS=$laminar_config/webhooks
    export WHD_HOOK_SCRIPTS
    export WHD_LISTEN_ADDR=":9090"
    su laminar -c webhookd &
fi