Skip to content

Commit

Permalink
Use TravisCI to build SPK (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
oznu authored Nov 22, 2017
1 parent ad03302 commit 3d53253
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 3 deletions.
12 changes: 12 additions & 0 deletions .ci/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

set -x

cd /toolkit

# move build files into source dir
mkdir -p /toolkit/source
cp -R $TRAVIS_BUILD_DIR /toolkit/source/homebridge-syno-spk

# build spk
./pkgscripts-ng/PkgCreate.py -c homebridge-syno-spk
9 changes: 9 additions & 0 deletions .ci/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

set -x

PKG_VERSION=$(cat $TRAVIS_BUILD_DIR/INFO.sh | grep version | awk -F '"' '{ print $2 }')

mkdir $TRAVIS_BUILD_DIR/github-release

cp /toolkit/result_spk/HomebridgeDocker-${PKG_VERSION}/HomebridgeDocker-x86_64-${PKG_VERSION}.spk $TRAVIS_BUILD_DIR/github-release/
36 changes: 36 additions & 0 deletions .ci/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

set -x

# create base
mkdir /toolkit
cd /toolkit

# get syno build tools
git clone https://github.com/SynologyOpenSource/pkgscripts-ng.git

# deploy chroot env
./pkgscripts-ng/EnvDeploy -q -v 6.0 -p x64

# this gpg key is never going to be validated so it does not need to be secure
cat >foo <<EOF
Key-Type: RSA
Key-Length: 2048
Subkey-Type: RSA
Subkey-Length: 2048
Name-Real: @oznu
Name-Comment: not my real gpg key
Name-Email: [email protected]
Expire-Date: 0
%commit
%echo done
EOF

gpg --batch --gen-key foo

# copy gpg keys into chroot env
mkdir -p /toolkit/build_env/ds.x64-6.0/home/travis/
cp -R /home/travis/.gnupg /toolkit/build_env/ds.x64-6.0/root/.gnupg
cp -R /home/travis/.gnupg /toolkit/build_env/ds.x64-6.0/home/travis/.gnupg
chown -R root:root /toolkit/build_env/ds.x64-6.0/root/.gnupg /toolkit/build_env/ds.x64-6.0/home/travis/.gnupg
chmod -R 600 /toolkit/build_env/ds.x64-6.0/root/.gnupg /toolkit/build_env/ds.x64-6.0/home/travis/.gnupg
22 changes: 22 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
language: bash

sudo: required

before_install:
- sudo ./.ci/setup.sh

script:
- sudo ./.ci/build.sh

before_deploy:
- sudo ./.ci/deploy.sh

deploy:
provider: releases
api_key:
secure: pUrHhrroypJpRJ9AJnxdzuktAv/ToJRtB4qxxjnNBWmBWDIhw2SQbcEODDOVtnxWaVEzKMqEpkr211gAZ/vYVG7WSawQNZLtCaohpicjutOMftu1ZcnGPSMG5jctYY1SIPnLDCPp4w2TdoeLPP3FrSrwugjmAUgZEJclf69en1+dafZZYII/nQGHALfupeWzoADDGYNfMbXethrQai7Wt24w6itopuVLmH/Cvaj4zpDvaXIty7kaF+ihb3Vy6eZof8U3CAVIFqEdsBmfYnjQ285H2RcFkV67YVQn0L6xtHpz4yikyX2FwToUDkrt9WSHuVZJoK1oVW3paNxTYlpF48+BQ7C3ZIMa1008D5yJVqizWsLlnRKf3iNC5i0f5tpJnHwuTfOEhKW8hDh18C54GmYGBzNl+Zhi3mp5LPzBDhTy1EYf9jsr1Lbmsdk0EZhyDK3BXcD8nNKNl3W0ynLpBStMCM5X079Tbjhc0jprtS/aHhfO4zaYuanAXd/imLtBm17Fe0LSf93QhKoQ8uKip1BY37fGM3p7FO5NiCoYk6ThLcgZow3FoZqdsdVZb6ipVDYwucfUYRT61v2lnKzMXNlV27JAF9AMk/UGoF3FcJbwBmjNxCg7nX4KrDzEYfRXLRstJRgJAlqJ2VgptgNozgOsR2s4p+sxLXxIVrPIN40=
file_glob: true
file: github-release/*
skip_cleanup: true
on:
tags: true
2 changes: 1 addition & 1 deletion INFO.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
source /pkgscripts/include/pkg_util.sh

package="HomebridgeDocker"
version="1.7.2"
version="1.0.0"
maintainer="oznu"
displayname="Homebridge Docker"
description="HomeKit support for the impatient using Docker on Synology DSM."
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Synology Package for Homebridge Docker.
# Synology Package for Homebridge Docker

This third-party Synology Package simplifies the process of running [oznu/docker-homebridge](https://github.com/oznu/docker-homebridge) on DSM 6.1.4 or later.

Expand All @@ -8,7 +8,7 @@ This package will deploy the [oznu/homebridge](https://hub.docker.com/r/oznu/hom
* `-e TZ` variable is set based on your current timezone of your Synology NAS.
* `-e PUID` variable is set to the same UID as the user who installs the package in DSM.
* `-e PGID` variable is set to the same GID as the user who isntalls the package in DSM.
* `-v /homebridge` is setup automatically using a share choosen by you during the installation. If the share does not exist it will create it for you.
* `-v /homebridge` is setup automatically using a share chosen by you during the installation. If the share does not exist it will create it for you.

## How to install

Expand Down

0 comments on commit 3d53253

Please sign in to comment.