]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Updates from public SPS repo.
authorCharles <32498151+charlesomer@users.noreply.github.com>
Thu, 15 Jul 2021 11:39:56 +0000 (12:39 +0100)
committerCharles <32498151+charlesomer@users.noreply.github.com>
Thu, 15 Jul 2021 11:39:56 +0000 (12:39 +0100)
.github/workflows/docker-build-releases.yaml
.github/workflows/docker-build.yaml
docker/Dockerfile
docker/README.md
docker/airplay1/README.md
docker/docker-compose.yaml

index 80e6d2638f0166fe7389209fb728d3479fa3c458..ef355fa857f9447f83006b83b7ae2b4e3b02a18d 100644 (file)
@@ -8,8 +8,11 @@ name: Build and push docker images on releases.
 
 on:
   release:
-    types: [ published ]
+    types: [ ]
  
+env:
+  DOCKER_PLATFORMS: linux/386,linux/amd64,linux/arm/v6,linux/arm64,linux/arm/v7
+
 jobs:
   main:
     runs-on: ubuntu-latest
@@ -22,11 +25,14 @@ jobs:
       - name: Set SHAIRPORT_SYNC_BRANCH env.
         run: echo "SHAIRPORT_SYNC_BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
 
-      - name: Set up ssh agent
-        uses: webfactory/ssh-agent@v0.5.2 # Can be removed when no longer pulling from private repos.
-        with:
-          ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
-
+      - name: Determine NQPTP env (part 1).
+        if: ${{ env.SHAIRPORT_SYNC_BRANCH == 'development' }}
+        run: echo "NQPTP_BRANCH=development" >> $GITHUB_ENV
+      
+      - name: Determine NQPTP env (part 2).
+        if: ${{ env.SHAIRPORT_SYNC_BRANCH != 'development' }}
+        run: echo "NQPTP_BRANCH=master" >> $GITHUB_ENV
+        
       - name: Set up QEMU
         uses: docker/setup-qemu-action@v1
 
@@ -36,7 +42,7 @@ jobs:
       - name: Login to Docker Registry
         uses: docker/login-action@v1
         with:
-          registry: registry.nova.do
+          registry: ${{ secrets.DOCKER_REGISTRY }}
           username: ${{ secrets.DOCKER_REGISTRY_USER }}
           password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}
 
@@ -45,20 +51,20 @@ jobs:
         with:
           context: ./
           file: ./docker/Dockerfile
-          platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm64,linux/arm/v7
+          platforms: ${{ env.PLATFORMS }}
           push: true
-          tags: registry.nova.do/shairport-sync:latest registry.nova.do/shairport-sync:${{ github.event.release.tag_name }}
+          tags: ${{ secrets.DOCKER_IMAGE_NAME }}:latest ${{ secrets.DOCKER_IMAGE_NAME }}:${{ github.event.release.tag_name }}
           build-args: |
             SHAIRPORT_SYNC_BRANCH=${{ env.SHAIRPORT_SYNC_BRANCH }}
-          ssh: default=${{ env.SSH_AUTH_SOCK }} # Can be removed when no longer pulling from private repos.
+            NQPTP_BRANCH=${{ env.NQPTP_BRANCH }}
 
       - name: Build and push (AirPlay 1)
         uses: docker/build-push-action@v2
         with:
           context: ./
           file: ./docker/airplay1/Dockerfile-AirPlay1
-          platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm64,linux/arm/v7
+          platforms: ${{ env.PLATFORMS }}
           push: true
-          tags: registry.nova.do/shairport-sync:latest-airplay1, registry.nova.do/shairport-sync:${{ github.event.release.tag_name }}-airplay1
+          tags: ${{ secrets.DOCKER_IMAGE_NAME }}:latest-airplay1, ${{ secrets.DOCKER_IMAGE_NAME }}:${{ github.event.release.tag_name }}-airplay1
           build-args: |
             SHAIRPORT_SYNC_BRANCH=${{ env.SHAIRPORT_SYNC_BRANCH }}
\ No newline at end of file
index a5a5f68c147177c160bb1a580de90b3cc521b3ad..27cb034266098c29ee099cc744bf8c333c22356d 100644 (file)
@@ -1,5 +1,5 @@
 # Builds & pushes a docker image when a commit is made to one of the branches specified below.
-# Tag pattern: 'unstable-[BRANCH NAME]'.
+# Tag pattern: 'unstable-[BRANCH NAME]' & 'unstable-[BRANCH NAME]-airplay1'
 # See docker-build-releases.yaml for release build process.
 
 name: Build and push docker image based on commit to specified branches.
@@ -7,6 +7,9 @@ name: Build and push docker image based on commit to specified branches.
 on:
   push:
     branches: [ master, development, charles-dev ]
+
+env:
+  DOCKER_PLATFORMS: linux/386,linux/amd64,linux/arm/v6,linux/arm64,linux/arm/v7
  
 jobs:
   main:
@@ -20,11 +23,14 @@ jobs:
       - name: Set SHAIRPORT_SYNC_BRANCH env.
         run: echo "SHAIRPORT_SYNC_BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
 
-      - name: Set up ssh agent
-        uses: webfactory/ssh-agent@v0.5.2 # Can be removed when no longer pulling from private repos.
-        with:
-          ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
-
+      - name: Determine NQPTP env (part 1).
+        if: ${{ env.SHAIRPORT_SYNC_BRANCH == 'development' }}
+        run: echo "NQPTP_BRANCH=development" >> $GITHUB_ENV
+      
+      - name: Determine NQPTP env (part 2).
+        if: ${{ env.SHAIRPORT_SYNC_BRANCH != 'development' }}
+        run: echo "NQPTP_BRANCH=master" >> $GITHUB_ENV
+        
       - name: Set up QEMU
         uses: docker/setup-qemu-action@v1
 
@@ -34,7 +40,7 @@ jobs:
       - name: Login to Docker Registry
         uses: docker/login-action@v1
         with:
-          registry: registry.nova.do
+          registry: ${{ secrets.DOCKER_REGISTRY }}
           username: ${{ secrets.DOCKER_REGISTRY_USER }}
           password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}
 
@@ -43,20 +49,20 @@ jobs:
         with:
           context: ./
           file: ./docker/Dockerfile
-          platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm64,linux/arm/v7
+          platforms: ${{ env.DOCKER_PLATFORMS }}
           push: true
-          tags: registry.nova.do/shairport-sync:unstable-${{ env.SHAIRPORT_SYNC_BRANCH }}
+          tags: ${{ secrets.DOCKER_IMAGE_NAME }}:unstable-${{ env.SHAIRPORT_SYNC_BRANCH }}
           build-args: |
             SHAIRPORT_SYNC_BRANCH=${{ env.SHAIRPORT_SYNC_BRANCH }}
-          ssh: default=${{ env.SSH_AUTH_SOCK }} # Can be removed when no longer pulling from private repos.
+            NQPTP_BRANCH=${{ env.NQPTP_BRANCH }}
 
       - name: Build and push (AirPlay 1)
         uses: docker/build-push-action@v2
         with:
           context: ./
           file: ./docker/airplay1/Dockerfile
-          platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm64,linux/arm/v7
+          platforms: ${{ env.DOCKER_PLATFORMS }}
           push: true
-          tags: registry.nova.do/shairport-sync:unstable-${{ env.SHAIRPORT_SYNC_BRANCH }}-airplay1
+          tags: ${{ secrets.DOCKER_IMAGE_NAME }}:unstable-${{ env.SHAIRPORT_SYNC_BRANCH }}-airplay1
           build-args: |
             SHAIRPORT_SYNC_BRANCH=${{ env.SHAIRPORT_SYNC_BRANCH }}
\ No newline at end of file
index 1203b1c670f1f994c2d07e5bb9fac2a294f9c465..98a3900c6902da1db93a7893f741e58fecf334f2 100644 (file)
@@ -43,22 +43,21 @@ RUN make install
 # Shairport Sync Build System:
 FROM builder-base AS builder-sps
 
-# This will be modified by the Github Action Workflow and is required
-# to ensure the correct branch is being used.
+# These will be modified by the Github Action Workflow and are required
+# to ensure the correct branches are being used.
 ARG SHAIRPORT_SYNC_BRANCH
 RUN test -n "$SHAIRPORT_SYNC_BRANCH"
+ARG NQPTP_BRANCH
+RUN test -n "$NQPTP_BRANCH"
 
 COPY --from=builder-alac /usr/local/lib/libalac.* /usr/local/lib/
 COPY --from=builder-alac /usr/local/lib/pkgconfig/alac.pc /usr/local/lib/pkgconfig/alac.pc
 COPY --from=builder-alac /usr/local/include /usr/local/include
 
-# TODO: Remove when no longer pulling from private repos.
-RUN mkdir -p -m 0600 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts
-
-RUN --mount=type=ssh git clone git@github.com:mikebrady/nqptp.git
+RUN git clone https://github.com/mikebrady/nqptp
 WORKDIR /nqptp
 # Use development branch for now.
-RUN git checkout development
+RUN git checkout "$NQPTP_BRANCH"
 RUN autoreconf -fi
 RUN ./configure
 RUN make
index ccb691a23ea9fb976b7a3d4a14e2af8bc1aec3a7..6043cc44be96da61d2629184e56c47301b5e7e61 100644 (file)
@@ -28,12 +28,20 @@ Edit the configuration file `/etc/shairport-sync.conf` in the container (or use
 
 ## Build Example (for arm7 devices)
 
-TODO: remove `--ssh` when going public as this is only for private repos.
 ```
-docker buildx build --ssh default=$SSH_AUTH_SOCK --platform linux/arm/v7 -f ./docker/Dockerfile --build-arg SHAIRPORT_SYNC_BRANCH=development -t registry.nova.do/shairport-sync:unstable-development .
+docker buildx build --platform linux/arm/v7 -f ./docker/Dockerfile --build-arg SHAIRPORT_SYNC_BRANCH=development --build-arg NQPTP_BRANCH=development -t shairport-sync:unstable-development .
 ```
 
 `SHAIRPORT_SYNC_BRANCH` is required to ensure the image is built using the expected branch.
 
 ## AirPlay 1 Only
-The AirPlay1 only dockerfile is in the `airplay1` folder. This also includes the `start.sh` script used by the container.
\ No newline at end of file
+
+The AirPlay1 only dockerfile is in the `airplay1` folder. This also includes the `start.sh` script used by the container. Please note that the AirPlay 1 image build via the AirPlay 2 branch does not work with multiple instances on the same hardware.
+
+## GitHub Action Builds
+
+Requires the following secrets to be set in the repo:
+- `DOCKER_REGISTRY` - docker.io if using Docker Hub, else set to your registry URL.
+- `DOCKER_REGISTRY_TOKEN` - Access token for your registry.
+- `DOCKER_REGISTRY_USER` - Login user for your registry.
+- `DOCKER_IMAGE_NAME` - The name of the image, for example `your-registry.com/shairport-sync` or just `your-username/shairport-sync` if using Docker Hub.
\ No newline at end of file
index 247754e65bf0a9887cf7f0556973505d3f8224bc..f8335d76ba608805c07946f975d606038a0631bf 100644 (file)
@@ -1,3 +1,3 @@
 # AirPlay 1 Only Docker Image
 
-See the [Shairport Sync Docker Hub Repo](https://hub.docker.com/r/mikebrady/shairport-sync) for available tags. For the latest build, use `latest-airplay1`.
\ No newline at end of file
+See the [Shairport Sync Docker Hub Repo](https://hub.docker.com/r/mikebrady/shairport-sync) for available tags.
index abcce4bc62f67e597a8a11664eb8f1a650bce4e6..74ed09acec7f391ea5d07a9fcf937ac9a2ecf56b 100644 (file)
@@ -2,7 +2,7 @@
 
 services:
   shairport-sync:
-    image: registry.nova.do/shairport-sync:unstable-development
+    image: mikebrady/shairport-sync:unstable-development
     network_mode: host
     restart: unless-stopped
     devices: