]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Added branch switching for SPS docker build.
authorCharles <32498151+charlesomer@users.noreply.github.com>
Thu, 20 May 2021 11:42:58 +0000 (12:42 +0100)
committerCharles <32498151+charlesomer@users.noreply.github.com>
Thu, 20 May 2021 11:42:58 +0000 (12:42 +0100)
.github/workflows/docker-build.yaml
docker/Dockerfile
docker/README.md

index 355d71b010b840b9813ac7f0ebccb81072024e8b..772586e139d59e911028e32359bfeefc8d648e5d 100644 (file)
@@ -13,8 +13,8 @@ jobs:
     steps:
       - name: Checkout
         uses: actions/checkout@v2
-      - name: Set branch env.
-        run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
+      - 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:
@@ -36,7 +36,7 @@ jobs:
           file: ./docker/Dockerfile
           platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm64,linux/arm/v7
           push: true
-          tags: registry.nova.do/shairport-sync:unstable-${{ env.BRANCH }}
+          tags: registry.nova.do/shairport-sync:unstable-${{ env.SHAIRPORT_SYNC_BRANCH }}
           build-args: |
-            BRANCH=${{ env.BRANCH }}
+            SHAIRPORT_SYNC_BRANCH=${{ env.SHAIRPORT_SYNC_BRANCH }}
           ssh: github=${{ env.SSH_AUTH_SOCK }} # Can be removed when no longer pulling from private repos.
\ No newline at end of file
index 723b7f8c31ae20d69fb90e537a83b8b17e6c8cf7..17ed2451ccf8f4050b70bc1ccd63912e10f917ae 100644 (file)
@@ -42,8 +42,10 @@ RUN make install
 # Shairport Sync Build System:
 FROM builder-base AS builder-sps
 
-# This may be modified by the Github Action Workflow.
-ARG SHAIRPORT_SYNC_BRANCH=development
+# This will be modified by the Github Action Workflow and is required
+# to ensure the correct branch is being used.
+ARG SHAIRPORT_SYNC_BRANCH
+RUN test -n "$SHAIRPORT_SYNC_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
@@ -64,7 +66,7 @@ WORKDIR /
 
 WORKDIR /shairport-sync
 COPY . .
-RUN git status
+RUN git checkout $SHAIRPORT_SYNC_BRANCH
 RUN git submodule init
 RUN git submodule update
 RUN autoreconf -fi
index 74b986ca9bd130be6dff35e9bc51699fa8d5673a..8172ec08ce66294f44f989f3ee2c19ff9b148a74 100644 (file)
@@ -1,3 +1,12 @@
 # Shairport Sync Docker Image
 
-https://hub.docker.com/r/mikebrady/shairport-sync
\ No newline at end of file
+Available at: https://hub.docker.com/r/mikebrady/shairport-sync
+
+## Build Example (for arm7 devices)
+
+TODO: remove `--ssh` when going public as this is only for private repos.
+```
+docker buildx build --ssh github=$SSH_AUTH_SOCK --platform linux/arm/v7 -f ./docker/Dockerfile --build-arg SHAIRPORT_SYNC_BRANCH=development -t registry.nova.do/shairport-sync:unstable-development .
+```
+
+`SHAIRPORT_SYNC_BRANCH` is required to ensure the image is built using the expected branch.
\ No newline at end of file