forked from iv-org/invidious
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master'
* upstream/master: (36 commits) docker: use alpine:edge base image for building Refactor geo-bypass shard: update to crystal 0.30.1 shard: update dependencies Format Crystal files Fix annoying typo in Preferences view travis: also test Docker build Fix typo in ConfigPreferences Update videojs-http-source-selector Force redirect for videos without audio Add support for player styles Format history.ecr Update icon for unlisted videos Fix detection of unavailable videos shard: update dependencies Fix detection of premium content Fix overflow for channel description Bump Crystal version Add Travis CI and pin dependencies (iv-org#655) docker: various improvements to Dockerfile ...
- Loading branch information
Showing
27 changed files
with
352 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
dist: bionic | ||
|
||
jobs: | ||
include: | ||
- stage: build | ||
language: crystal | ||
crystal: latest | ||
before_install: | ||
- shards update | ||
- shards install | ||
install: | ||
- crystal build --error-on-warnings src/invidious.cr | ||
script: | ||
- crystal tool format --check | ||
- crystal spec | ||
|
||
- stage: build_docker | ||
language: minimal | ||
services: | ||
- docker | ||
install: | ||
- docker-compose build | ||
script: | ||
- docker-compose up -d | ||
- sleep 15 # Wait for cluster to become ready, TODO: do not sleep | ||
- HEADERS="$(curl -I -s http://localhost:3000/)" | ||
- STATUS="$(echo $HEADERS | head -n1)" | ||
- if [[ "$STATUS" != *"200 OK"* ]]; then echo "$HEADERS"; exit 1; fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,28 @@ | ||
FROM archlinux/base | ||
|
||
RUN pacman -Sy --noconfirm shards crystal imagemagick librsvg \ | ||
which pkgconf gcc ttf-liberation glibc | ||
# base-devel contains many other basic packages, that are normally assumed to already exist on a clean arch system | ||
|
||
ADD . /invidious | ||
|
||
FROM alpine:edge AS builder | ||
RUN apk add -u crystal shards libc-dev \ | ||
yaml-dev libxml2-dev sqlite-dev sqlite-static zlib-dev openssl-dev | ||
WORKDIR /invidious | ||
COPY ./shard.yml ./shard.yml | ||
RUN shards update && shards install | ||
COPY ./src/ ./src/ | ||
# TODO: .git folder is required for building – this is destructive. | ||
# See definition of CURRENT_BRANCH, CURRENT_COMMIT and CURRENT_VERSION. | ||
COPY ./.git/ ./.git/ | ||
RUN crystal build --static --release \ | ||
# TODO: Remove next line, see https://github.com/crystal-lang/crystal/issues/7946 | ||
-Dmusl \ | ||
./src/invidious.cr | ||
|
||
RUN sed -i 's/host: localhost/host: postgres/' config/config.yml && \ | ||
shards update && shards install && \ | ||
crystal build src/invidious.cr | ||
|
||
FROM alpine:latest | ||
RUN apk add -u imagemagick ttf-opensans | ||
WORKDIR /invidious | ||
RUN addgroup -g 1000 -S invidious && \ | ||
adduser -u 1000 -S invidious -G invidious | ||
COPY ./assets/ ./assets/ | ||
COPY ./config/config.yml ./config/config.yml | ||
COPY ./config/sql/ ./config/sql/ | ||
COPY ./locales/ ./locales/ | ||
RUN sed -i 's/host: localhost/host: postgres/' config/config.yml | ||
COPY --from=builder /invidious/invidious . | ||
USER invidious | ||
CMD [ "/invidious/invidious" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.