Invidious is an alternative front-end to YouTube
Make building in release mode optional (#2368)
syeopitedd141daefdf3
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex fa6f9e33..3bb4c491 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -86,6 +86,9 @@ jobs:- uses: actions/checkout@v2- name: Build Docker+ run: docker-compose build --build-arg release=0++ - name: Run Dockerrun: docker-compose up -d- name: Test Docker@@ -112,6 +115,7 @@ jobs:context: .file: docker/Dockerfile.arm64platforms: linux/arm64/v8+ build-args: release=0- name: Test Dockerrun: while curl -Isf http://localhost:3000; do sleep 1; donediff --git a/.github/workflows/container-release.yml b/.github/workflows/container-release.ymlindex 9cc39783..8945ef7a 100644--- a/.github/workflows/container-release.yml+++ b/.github/workflows/container-release.yml@@ -40,6 +40,7 @@ jobs:labels: quay.expires-after=12wpush: truetags: quay.io/invidious/invidious:${{ github.sha }},quay.io/invidious/invidious:latest+ build-args: release=1- name: Build and push Docker ARM64 image for Push Eventif: github.ref == 'refs/heads/master'@@ -50,4 +51,5 @@ jobs:platforms: linux/arm64/v8labels: quay.expires-after=12wpush: true- tags: quay.io/invidious/invidious:${{ github.sha }}-arm64,quay.io/invidious/invidious:latest-arm64\ No newline at end of file+ tags: quay.io/invidious/invidious:${{ github.sha }}-arm64,quay.io/invidious/invidious:latest-arm64+ build-args: release=1\ No newline at end of filediff --git a/docker/Dockerfile b/docker/Dockerfileindex 2caa9abe..08feb554 100644--- a/docker/Dockerfile+++ b/docker/Dockerfile@@ -1,6 +1,8 @@FROM crystallang/crystal:1.1.1-alpine AS builderRUN apk add --no-cache sqlite-static yaml-static+ARG release+WORKDIR /invidiousCOPY ./shard.yml ./shard.ymlCOPY ./shard.lock ./shard.lock@@ -16,10 +18,17 @@ COPY ./.git/ ./.git/RUN crystal spec --warnings all \--link-flags "-lxml2 -llzma"-RUN crystal build ./src/invidious.cr \- --release \- --static --warnings all \- --link-flags "-lxml2 -llzma"+RUN if [ ${release} == 1 ] ; then \+ crystal build ./src/invidious.cr \+ --release \+ --static --warnings all \+ --link-flags "-lxml2 -llzma"; \+ else \+ crystal build ./src/invidious.cr \+ --static --warnings all \+ --link-flags "-lxml2 -llzma"; \+ fi+FROM alpine:latestRUN apk add --no-cache librsvg ttf-opensansdiff --git a/docker/Dockerfile.arm64 b/docker/Dockerfile.arm64index fc82c6df..4d212d8b 100644--- a/docker/Dockerfile.arm64+++ b/docker/Dockerfile.arm64@@ -1,6 +1,8 @@FROM alpine:3.14 AS builderRUN apk add --no-cache 'crystal<2' shards sqlite-static yaml-static yaml-dev libxml2-dev zlib-static openssl-libs-static openssl-dev musl-dev+ARG release+WORKDIR /invidiousCOPY ./shard.yml ./shard.ymlCOPY ./shard.lock ./shard.lock@@ -16,10 +18,16 @@ COPY ./.git/ ./.git/RUN crystal spec --warnings all \--link-flags "-lxml2 -llzma"-RUN crystal build ./src/invidious.cr \- --release \- --static --warnings all \- --link-flags "-lxml2 -llzma"+RUN if [ ${release} == 1 ] ; then \+ crystal build ./src/invidious.cr \+ --release \+ --static --warnings all \+ --link-flags "-lxml2 -llzma"; \+ else \+ crystal build ./src/invidious.cr \+ --static --warnings all \+ --link-flags "-lxml2 -llzma"; \+ fiFROM alpine:latestRUN apk add --no-cache librsvg ttf-opensans