Skip to content

Commit 50e9084

Browse files
Moved from Docker Hub to GitHub Container Registry for Docker compilations
1 parent 8b2ebf3 commit 50e9084

File tree

7 files changed

+72
-68
lines changed

7 files changed

+72
-68
lines changed

.azure.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@ jobs:
1010
vmImage: 'ubuntu-16.04'
1111
strategy:
1212
matrix:
13-
AMD64 (x64):
14-
dockerTag: 'amd64'
15-
dockerName: 'Debian Stretch (AMD64)'
13+
x86_64:
14+
dockerImage: 'x86_64'
15+
dockerName: 'Debian Stretch (x86_64)'
1616
platform: 'x11'
1717
ARMv6hf (Raspberry Pi v1 & ZERO):
18-
dockerTag: 'armv6hf'
18+
dockerImage: 'armv6l'
1919
dockerName: 'Debian Stretch (Raspberry Pi v1 & ZERO)'
2020
platform: 'rpi'
2121
ARMv7hf (Raspberry Pi 2 & 3):
22-
dockerTag: 'armv7hf'
22+
dockerImage: 'armv7l'
2323
dockerName: 'Debian Stretch (Raspberry Pi 2 & 3)'
2424
platform: 'rpi'
2525
ARMv8 (Generic AARCH64):
26-
dockerTag: 'aarch64'
26+
dockerImage: 'aarch64'
2727
dockerName: 'ARMv8 (Generic AARCH64)'
2828
platform: 'amlogic'
2929

@@ -35,7 +35,8 @@ jobs:
3535
- bash: ./.ci/ci_build.sh
3636
displayName: 'Build $(dockerName) packages'
3737
env:
38-
DOCKER_TAG: $(dockerTag)
38+
DOCKER_IMAGE: $(dockerImage)
39+
DOCKER_TAG: stretch
3940
DOCKER_NAME: $(dockerName)
4041
PLATFORM: $(platform)
4142

.ci/ci_build.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,17 @@ elif [[ $CI_NAME == *"mingw64_nt"* || "$CI_NAME" == 'windows_nt' ]]; then
4646
exit 0;
4747
exit 1 || { echo "---> Hyperion compilation failed! Abort"; exit 5; }
4848
elif [[ "$CI_NAME" == 'linux' ]]; then
49-
echo "Compile Hyperion with DOCKER_TAG = ${DOCKER_TAG} and friendly name DOCKER_NAME = ${DOCKER_NAME}"
49+
echo "Compile Hyperion with DOCKER_IMAGE = ${DOCKER_IMAGE}, DOCKER_TAG = ${DOCKER_TAG} and friendly name DOCKER_NAME = ${DOCKER_NAME}"
50+
# set GitHub Container Registry url
51+
REGISTRY_URL="ghcr.io/hyperion-project/${DOCKER_IMAGE}"
5052
# take ownership of deploy dir
5153
mkdir ${CI_BUILD_DIR}/deploy
5254

5355
# run docker
5456
docker run --rm \
5557
-v "${CI_BUILD_DIR}/deploy:/deploy" \
5658
-v "${CI_BUILD_DIR}:/source:ro" \
57-
hyperionproject/hyperion-ci:$DOCKER_TAG \
59+
$REGISTRY_URL:$DOCKER_TAG \
5860
/bin/bash -c "mkdir hyperion && cp -r source/. /hyperion &&
5961
cd /hyperion && mkdir build && cd build &&
6062
cmake -DPLATFORM=${PLATFORM} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ../ || exit 2 &&

.ci/ci_install.sh

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,4 @@ if [[ $CI_NAME == 'osx' || $CI_NAME == 'darwin' ]]; then
3838
brew update
3939
dependencies=("qt5" "python" "libusb" "cmake" "doxygen")
4040
installAndUpgrade "${dependencies[@]}"
41-
# github actions uname -> windows-2019 -> mingw64_nt-10.0-17763
42-
# TODO: Azure uname windows?
43-
elif [[ $CI_NAME == *"mingw64_nt"* ]]; then
44-
echo "Yes, we are Windows: $CI_NAME"
45-
# Windows has no dependency manager
46-
elif [[ $CI_NAME != 'linux' ]]; then
47-
echo "Unsupported platform: $CI_NAME"
48-
exit 5
4941
fi

.github/workflows/pull-request.yml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@ jobs:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
18-
dockerTag: [ amd64, armv6hf, armv7hf, aarch64 ]
18+
dockerImage: [ x86_64, armv6l, armv7l, aarch64 ]
1919
include:
20-
- dockerTag: amd64
21-
dockerName: Debian Stretch (AMD64)
20+
- dockerImage: x86_64
21+
dockerName: Debian Stretch (x86_64)
2222
platform: x11
23-
- dockerTag: armv6hf
23+
- dockerImage: armv6l
2424
dockerName: Debian Stretch (Raspberry Pi v1 & ZERO)
2525
platform: rpi
26-
- dockerTag: armv7hf
26+
- dockerImage: armv7l
2727
dockerName: Debian Stretch (Raspberry Pi 2 & 3)
2828
platform: rpi
29-
- dockerTag: aarch64
29+
- dockerImage: aarch64
3030
dockerName: Debian Stretch (Generic AARCH64)
3131
platform: amlogic
3232

@@ -46,7 +46,8 @@ jobs:
4646
# Build packages
4747
- name: Build packages
4848
env:
49-
DOCKER_TAG: ${{ matrix.dockerTag }}
49+
DOCKER_IMAGE: ${{ matrix.dockerImage }}
50+
DOCKER_TAG: stretch
5051
DOCKER_NAME: ${{ matrix.dockerName }}
5152
PLATFORM: ${{ matrix.platform }}
5253
shell: bash
@@ -56,17 +57,17 @@ jobs:
5657
- name: Collecting deployable artifacts
5758
shell: bash
5859
run: |
59-
mkdir -p ${{ matrix.dockerTag }}
60-
mv deploy/*.tar.gz ${{ matrix.dockerTag }}
61-
if: matrix.dockerTag != 'aarch64'
60+
mkdir -p ${{ matrix.dockerImage }}
61+
mv deploy/*.tar.gz ${{ matrix.dockerImage }}
62+
if: matrix.dockerImage != 'aarch64'
6263

6364
# Upload artifacts
6465
- name: Upload artifacts
6566
uses: actions/upload-artifact@v1
6667
with:
67-
name: ${{ matrix.dockerTag }}
68-
path: ${{ matrix.dockerTag }}
69-
if: matrix.dockerTag != 'aarch64'
68+
name: ${{ matrix.dockerImage }}
69+
path: ${{ matrix.dockerImage }}
70+
if: matrix.dockerImage != 'aarch64'
7071

7172
######################
7273
###### macOS #########

.github/workflows/push-master.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ jobs:
1818
runs-on: ubuntu-latest
1919
strategy:
2020
matrix:
21-
dockerTag: [ amd64, armv6hf, armv7hf, aarch64 ]
21+
dockerImage: [ x86_64, armv6l, armv7l, aarch64 ]
2222
include:
23-
- dockerTag: amd64
24-
dockerName: Debian Stretch (AMD64)
23+
- dockerImage: x86_64
24+
dockerName: Debian Stretch (x86_64)
2525
platform: x11
26-
- dockerTag: armv6hf
26+
- dockerImage: armv6l
2727
dockerName: Debian Stretch (Raspberry Pi v1 & ZERO)
2828
platform: rpi
29-
- dockerTag: armv7hf
29+
- dockerImage: armv7l
3030
dockerName: Debian Stretch (Raspberry Pi 2 & 3)
3131
platform: rpi
32-
- dockerTag: aarch64
32+
- dockerImage: aarch64
3333
dockerName: Debian Stretch (Generic AARCH64)
3434
platform: amlogic
3535

@@ -41,7 +41,8 @@ jobs:
4141
# build process
4242
- name: Build packages
4343
env:
44-
DOCKER_TAG: ${{ matrix.dockerTag }}
44+
DOCKER_IMAGE: ${{ matrix.dockerImage }}
45+
DOCKER_TAG: stretch
4546
DOCKER_NAME: ${{ matrix.dockerName }}
4647
PLATFORM: ${{ matrix.platform }}
4748
shell: bash

CompileHowto.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,44 +2,44 @@
22
If you are using [Docker](https://www.docker.com/), you can compile Hyperion inside a docker container. This keeps your system clean and with a simple script it's easy to use. Supported is also cross compiling for Raspberry Pi (Debian Stretch or higher). To compile Hyperion just execute one of the following commands.
33

44
The compiled binaries and packages will be available at the deploy folder next to the script.<br/>
5-
Note: call the script with `./docker-compile.sh -h` for more options
5+
Note: call the script with `./docker-compile.sh -h` for more options.
66

7-
## Native compiling on Raspberry Pi
7+
## Native compilation on Raspberry Pi for:
88

99
**Raspbian Stretch**
1010
```
11-
wget -qN https://raw.github.com/hyperion-project/hyperion.ng/master/bin/scripts/docker-compile.sh && chmod +x *.sh && ./docker-compile.sh -t rpi-raspbian-stretch
11+
wget -qN https://raw.github.com/hyperion-project/hyperion.ng/master/bin/scripts/docker-compile.sh && chmod +x *.sh && ./docker-compile.sh -i rpi-raspbian
1212
```
1313
**Raspbian Buster**
1414
```
15-
wget -qN https://raw.github.com/hyperion-project/hyperion.ng/master/bin/scripts/docker-compile.sh && chmod +x *.sh && ./docker-compile.sh -t rpi-raspbian-buster
15+
wget -qN https://raw.github.com/hyperion-project/hyperion.ng/master/bin/scripts/docker-compile.sh && chmod +x *.sh && ./docker-compile.sh -i rpi-raspbian -t buster
1616
```
1717

18-
## Cross compiling on X64_86 for:
18+
## Cross compilation on x86_64 for:
1919

20-
**X64:**
20+
**x86_64 (Debian Stretch):**
2121
```
22-
wget -qN https://raw.github.com/hyperion-project/hyperion.ng/master/bin/scripts/docker-compile.sh && chmod +x *.sh && ./docker-compile.sh
22+
wget -qN https://raw.github.com/hyperion-project/hyperion.ng/master/bin/scripts/docker-compile.sh && chmod +x *.sh && ./docker-compile.sh -i x86_64
2323
```
24-
**i386:**
24+
**x86_64 (Debian Buster):**
2525
```
26-
wget -qN https://raw.github.com/hyperion-project/hyperion.ng/master/bin/scripts/docker-compile.sh && chmod +x *.sh && ./docker-compile.sh -t i386
26+
wget -qN https://raw.github.com/hyperion-project/hyperion.ng/master/bin/scripts/docker-compile.sh && chmod +x *.sh && ./docker-compile.sh -i x86_64 -t buster
2727
```
28-
**Raspberry Pi v1 & ZERO (Raspbian Stretch)**
28+
**Raspberry Pi v1 & ZERO (Debian Stretch)**
2929
```
30-
wget -qN https://raw.github.com/hyperion-project/hyperion.ng/master/bin/scripts/docker-compile.sh && chmod +x *.sh && ./docker-compile.sh -t armv6hf
30+
wget -qN https://raw.github.com/hyperion-project/hyperion.ng/master/bin/scripts/docker-compile.sh && chmod +x *.sh && ./docker-compile.sh -i armv6l
3131
```
32-
**Raspberry Pi 2 & 3 (Raspbian Stretch)**
32+
**Raspberry Pi v1 & ZERO (Debian Buster)**
3333
```
34-
wget -qN https://raw.github.com/hyperion-project/hyperion.ng/master/bin/scripts/docker-compile.sh && chmod +x *.sh && ./docker-compile.sh -t armv7hf
34+
wget -qN https://raw.github.com/hyperion-project/hyperion.ng/master/bin/scripts/docker-compile.sh && chmod +x *.sh && ./docker-compile.sh -i armv6l -t buster
3535
```
36-
**Raspberry Pi v1 & ZERO (Raspbian Buster)**
36+
**Raspberry Pi 2/3/4 (Debian Stretch)**
3737
```
38-
wget -qN https://raw.github.com/hyperion-project/hyperion.ng/master/bin/scripts/docker-compile.sh && chmod +x *.sh && ./docker-compile.sh -t armv6hf-buster
38+
wget -qN https://raw.github.com/hyperion-project/hyperion.ng/master/bin/scripts/docker-compile.sh && chmod +x *.sh && ./docker-compile.sh -i armv7l
3939
```
40-
**Raspberry Pi 2 & 3 (Raspbian Buster**
40+
**Raspberry Pi 2/3/4 (Debian Buster)**
4141
```
42-
wget -qN https://raw.github.com/hyperion-project/hyperion.ng/master/bin/scripts/docker-compile.sh && chmod +x *.sh && ./docker-compile.sh -t armv7hf-buster
42+
wget -qN https://raw.github.com/hyperion-project/hyperion.ng/master/bin/scripts/docker-compile.sh && chmod +x *.sh && ./docker-compile.sh -i armv7l -t buster
4343
```
4444

4545
# The usual way
@@ -114,7 +114,7 @@ mkdir build
114114
cd build
115115
cmake -DCMAKE_BUILD_TYPE=Release ..
116116
make -j $(nproc)
117-
if this get stucked and dmseg says out of memory try:
117+
if this get stucked and dmesg says out of memory try:
118118
make -j 2
119119
# optional: install into your system
120120
sudo make install/strip

bin/scripts/docker-compile.sh

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@
33
DOCKER="docker"
44
# Git repo url of Hyperion
55
GIT_REPO_URL="https://github.com/hyperion-project/hyperion.ng.git"
6+
# GitHub Container Registry url
7+
REGISTRY_URL="ghcr.io/hyperion-project"
68
# cmake build type
79
BUILD_TYPE="Release"
8-
# the image tag at hyperionproject/hyperion-ci
9-
BUILD_TARGET="amd64"
10+
# the docker image at GitHub Container Registry
11+
BUILD_IMAGE="x86_64"
12+
# the docker tag at GitHub Container Registry
13+
BUILD_TAG="stretch"
1014
# build packages (.deb .zip ...)
1115
BUILD_PACKAGES=true
1216
# packages string inserted to cmake cmd
@@ -42,26 +46,28 @@ function printHelp {
4246
echo "########################################################
4347
## A script to compile Hyperion inside a docker container
4448
## Requires installed Docker: https://www.docker.com/
45-
## Without arguments it will compile Hyperion for Debain Stretch (x64) or higher.
46-
## Supports Raspberry Pi (armv6hf, armv7hf) cross compilation (Debian Stretch/Buster) and native compilation (Raspbian Stretch/Buster)
49+
## Without arguments it will compile Hyperion for Debian Stretch (x86_64).
50+
## Supports Raspberry Pi (armv6l, armv7l) cross compilation (Debian Stretch/Buster) and native compilation (Raspbian Stretch/Buster)
4751
##
4852
## Homepage: https://www.hyperion-project.org
4953
## Forum: https://forum.hyperion-project.org
5054
########################################################
5155
# These are possible arguments to modify the script behaviour with their default values
5256
#
5357
# docker-compile.sh -h # Show this help message
54-
# docker-compile.sh -t amd64 # The docker tag, one of amd64 | i386 | armv6hf | armv7hf | armv6hf-buster | armv7hf-buster | rpi-raspbian-stretch | rpi-raspbian-buster
58+
# docker-compile.sh -i x86_64 # The docker image, one of x86_64 | armv6l | armv7l | rpi-raspbian
59+
# docker-compile.sh -t stretch # The docker tag, stretch or buster
5560
# docker-compile.sh -b Release # cmake Release or Debug build
5661
# docker-compile.sh -p true # If true build packages with CPack
57-
# More informations to docker tags at: https://hub.docker.com/r/hyperionproject/hyperion-ci/"
62+
# More informations to docker tags at: https://github.com/Hyperion-Project/hyperion.docker-ci"
5863
}
5964

60-
while getopts t:b:p:h option
65+
while getopts i:t:b:p:h option
6166
do
6267
case "${option}"
6368
in
64-
t) BUILD_TARGET=${OPTARG};;
69+
i) BUILD_IMAGE=${OPTARG};;
70+
t) BUILD_TAG=${OPTARG};;
6571
b) BUILD_TYPE=${OPTARG};;
6672
p) BUILD_PACKAGES=${OPTARG};;
6773
h) printHelp; exit 0;;
@@ -73,7 +79,7 @@ if [ $BUILD_PACKAGES == "true" ]; then
7379
PACKAGES="package"
7480
fi
7581

76-
echo "---> Initialize with BUILD_TARGET=${BUILD_TARGET}, BUILD_TYPE=${BUILD_TYPE}, BUILD_PACKAGES=${BUILD_PACKAGES}"
82+
echo "---> Initialize with IMAGE:TAG=${BUILD_IMAGE}:${BUILD_TAG}, BUILD_TYPE=${BUILD_TYPE}, BUILD_PACKAGES=${BUILD_PACKAGES}"
7783

7884
# cleanup deploy folder, create folder for ownership
7985
sudo rm -fr $SCRIPT_PATH/deploy >/dev/null 2>&1
@@ -84,18 +90,19 @@ echo "---> Downloading Hyperion source code from ${GIT_REPO_URL}"
8490
sudo rm -fr $SCRIPT_PATH/hyperion >/dev/null 2>&1
8591
git clone --recursive --depth 1 -q $GIT_REPO_URL $SCRIPT_PATH/hyperion || { echo "---> Failed to download Hyperion source code! Abort"; exit 1; }
8692

87-
# start compilation
93+
# Steps:
94+
# Update lokal docker image
8895
# Remove container after stop
8996
# Mount /deploy to /deploy
9097
# Mount source dir to /source
91-
# Target docker image
98+
# Use target docker image
9299
# execute inside container all commands on bash
100+
93101
echo "---> Startup docker..."
94-
$DOCKER pull hyperionproject/hyperion-ci:$BUILD_TARGET
95102
$DOCKER run --rm \
96103
-v "${SCRIPT_PATH}/deploy:/deploy" \
97104
-v "${SCRIPT_PATH}/hyperion:/source:ro" \
98-
hyperionproject/hyperion-ci:$BUILD_TARGET \
105+
$REGISTRY_URL/$BUILD_IMAGE:$BUILD_TAG \
99106
/bin/bash -c "mkdir hyperion && cp -r /source/. /hyperion &&
100107
cd /hyperion && mkdir build && cd build &&
101108
cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} .. || exit 2 &&

0 commit comments

Comments
 (0)