mirror of https://github.com/LemmyNet/lemmy.git
* publish docker images from main * try with separate step * redo, lots of boilerplate * try to fix syntax * unique step names * fix docker tags, remove cargo-chef * only build dev image on main branch * use `ref` for condition, as `branch` uses the target branch for PRs * consistent indents * fix tag * use lemmy-ui:dev image for `docker/dev` and `docker/federation`remove_extra_save_user_fields
parent
c3d64f996e
commit
b8a6592369
72
.drone.yml
72
.drone.yml
|
@ -55,7 +55,39 @@ steps:
|
||||||
- yarn
|
- yarn
|
||||||
- yarn api-test
|
- yarn api-test
|
||||||
|
|
||||||
- name: make release build and push to docker hub
|
- name: publish dev docker image
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
dockerfile: docker/prod/Dockerfile
|
||||||
|
username:
|
||||||
|
from_secret: docker_username
|
||||||
|
password:
|
||||||
|
from_secret: docker_password
|
||||||
|
repo: dessalines/lemmy
|
||||||
|
tags:
|
||||||
|
- dev-linux-amd64
|
||||||
|
when:
|
||||||
|
ref:
|
||||||
|
- refs/heads/main
|
||||||
|
|
||||||
|
- name: publish dev docker manifest
|
||||||
|
image: plugins/manifest
|
||||||
|
settings:
|
||||||
|
username:
|
||||||
|
from_secret: docker_username
|
||||||
|
password:
|
||||||
|
from_secret: docker_password
|
||||||
|
target: "dessalines/lemmy:dev"
|
||||||
|
template: "dessalines/lemmy:dev-OS-ARCH"
|
||||||
|
platforms:
|
||||||
|
- linux/amd64
|
||||||
|
- linux/arm64
|
||||||
|
ignore_missing: true
|
||||||
|
when:
|
||||||
|
ref:
|
||||||
|
- refs/heads/main
|
||||||
|
|
||||||
|
- name: publish release docker image
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
settings:
|
settings:
|
||||||
dockerfile: docker/prod/Dockerfile
|
dockerfile: docker/prod/Dockerfile
|
||||||
|
@ -70,7 +102,7 @@ steps:
|
||||||
ref:
|
ref:
|
||||||
- refs/tags/*
|
- refs/tags/*
|
||||||
|
|
||||||
- name: push to docker manifest
|
- name: publish release docker manifest
|
||||||
image: plugins/manifest
|
image: plugins/manifest
|
||||||
settings:
|
settings:
|
||||||
username:
|
username:
|
||||||
|
@ -140,7 +172,39 @@ steps:
|
||||||
- yarn
|
- yarn
|
||||||
- yarn api-test
|
- yarn api-test
|
||||||
|
|
||||||
- name: make release build and push to docker hub
|
- name: publish dev docker image
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
dockerfile: docker/prod/Dockerfile.arm
|
||||||
|
username:
|
||||||
|
from_secret: docker_username
|
||||||
|
password:
|
||||||
|
from_secret: docker_password
|
||||||
|
repo: dessalines/lemmy
|
||||||
|
tags:
|
||||||
|
- dev-linux-arm64
|
||||||
|
when:
|
||||||
|
ref:
|
||||||
|
- refs/heads/main
|
||||||
|
|
||||||
|
- name: publish dev docker manifest
|
||||||
|
image: plugins/manifest
|
||||||
|
settings:
|
||||||
|
username:
|
||||||
|
from_secret: docker_username
|
||||||
|
password:
|
||||||
|
from_secret: docker_password
|
||||||
|
target: "dessalines/lemmy:dev"
|
||||||
|
template: "dessalines/lemmy:dev-OS-ARCH"
|
||||||
|
platforms:
|
||||||
|
- linux/amd64
|
||||||
|
- linux/arm64
|
||||||
|
ignore_missing: true
|
||||||
|
when:
|
||||||
|
ref:
|
||||||
|
- refs/heads/main
|
||||||
|
|
||||||
|
- name: publish release docker image
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
settings:
|
settings:
|
||||||
dockerfile: docker/prod/Dockerfile.arm
|
dockerfile: docker/prod/Dockerfile.arm
|
||||||
|
@ -155,7 +219,7 @@ steps:
|
||||||
ref:
|
ref:
|
||||||
- refs/tags/*
|
- refs/tags/*
|
||||||
|
|
||||||
- name: push to docker manifest
|
- name: publish release docker manifest
|
||||||
image: plugins/manifest
|
image: plugins/manifest
|
||||||
settings:
|
settings:
|
||||||
username:
|
username:
|
||||||
|
|
|
@ -17,7 +17,7 @@ services:
|
||||||
- iframely
|
- iframely
|
||||||
|
|
||||||
lemmy-ui:
|
lemmy-ui:
|
||||||
image: dessalines/lemmy-ui:0.10.3
|
image: dessalines/lemmy-ui:dev
|
||||||
ports:
|
ports:
|
||||||
- "1235:1234"
|
- "1235:1234"
|
||||||
restart: always
|
restart: always
|
||||||
|
|
|
@ -8,4 +8,5 @@ set -e
|
||||||
mkdir -p volumes/pictrs
|
mkdir -p volumes/pictrs
|
||||||
sudo chown -R 991:991 volumes/pictrs
|
sudo chown -R 991:991 volumes/pictrs
|
||||||
sudo docker build ../../ --file ../dev/Dockerfile -t lemmy-dev:latest
|
sudo docker build ../../ --file ../dev/Dockerfile -t lemmy-dev:latest
|
||||||
|
sudo docker-compose pull --ignore-pull-failures || true
|
||||||
sudo docker-compose up -d
|
sudo docker-compose up -d
|
||||||
|
|
|
@ -8,4 +8,5 @@ set -e
|
||||||
mkdir -p volumes/pictrs
|
mkdir -p volumes/pictrs
|
||||||
sudo chown -R 991:991 volumes/pictrs
|
sudo chown -R 991:991 volumes/pictrs
|
||||||
sudo docker build ../../ --file ../dev/volume_mount.dockerfile -t lemmy-dev:latest
|
sudo docker build ../../ --file ../dev/volume_mount.dockerfile -t lemmy-dev:latest
|
||||||
|
sudo docker-compose pull --ignore-pull-failures || true
|
||||||
sudo docker-compose up
|
sudo docker-compose up
|
||||||
|
|
|
@ -29,7 +29,7 @@ services:
|
||||||
- ./volumes/pictrs_alpha:/mnt
|
- ./volumes/pictrs_alpha:/mnt
|
||||||
|
|
||||||
lemmy-alpha-ui:
|
lemmy-alpha-ui:
|
||||||
image: dessalines/lemmy-ui:0.10.3
|
image: dessalines/lemmy-ui:dev
|
||||||
environment:
|
environment:
|
||||||
- LEMMY_INTERNAL_HOST=lemmy-alpha:8541
|
- LEMMY_INTERNAL_HOST=lemmy-alpha:8541
|
||||||
- LEMMY_EXTERNAL_HOST=localhost:8541
|
- LEMMY_EXTERNAL_HOST=localhost:8541
|
||||||
|
@ -58,7 +58,7 @@ services:
|
||||||
- ./volumes/postgres_alpha:/var/lib/postgresql/data
|
- ./volumes/postgres_alpha:/var/lib/postgresql/data
|
||||||
|
|
||||||
lemmy-beta-ui:
|
lemmy-beta-ui:
|
||||||
image: dessalines/lemmy-ui:0.10.3
|
image: dessalines/lemmy-ui:dev
|
||||||
environment:
|
environment:
|
||||||
- LEMMY_INTERNAL_HOST=lemmy-beta:8551
|
- LEMMY_INTERNAL_HOST=lemmy-beta:8551
|
||||||
- LEMMY_EXTERNAL_HOST=localhost:8551
|
- LEMMY_EXTERNAL_HOST=localhost:8551
|
||||||
|
@ -87,7 +87,7 @@ services:
|
||||||
- ./volumes/postgres_beta:/var/lib/postgresql/data
|
- ./volumes/postgres_beta:/var/lib/postgresql/data
|
||||||
|
|
||||||
lemmy-gamma-ui:
|
lemmy-gamma-ui:
|
||||||
image: dessalines/lemmy-ui:0.10.3
|
image: dessalines/lemmy-ui:dev
|
||||||
environment:
|
environment:
|
||||||
- LEMMY_INTERNAL_HOST=lemmy-gamma:8561
|
- LEMMY_INTERNAL_HOST=lemmy-gamma:8561
|
||||||
- LEMMY_EXTERNAL_HOST=localhost:8561
|
- LEMMY_EXTERNAL_HOST=localhost:8561
|
||||||
|
@ -117,7 +117,7 @@ services:
|
||||||
|
|
||||||
# An instance with only an allowlist for beta
|
# An instance with only an allowlist for beta
|
||||||
lemmy-delta-ui:
|
lemmy-delta-ui:
|
||||||
image: dessalines/lemmy-ui:0.10.3
|
image: dessalines/lemmy-ui:dev
|
||||||
environment:
|
environment:
|
||||||
- LEMMY_INTERNAL_HOST=lemmy-delta:8571
|
- LEMMY_INTERNAL_HOST=lemmy-delta:8571
|
||||||
- LEMMY_EXTERNAL_HOST=localhost:8571
|
- LEMMY_EXTERNAL_HOST=localhost:8571
|
||||||
|
@ -147,7 +147,7 @@ services:
|
||||||
|
|
||||||
# An instance who has a blocklist, with lemmy-alpha blocked
|
# An instance who has a blocklist, with lemmy-alpha blocked
|
||||||
lemmy-epsilon-ui:
|
lemmy-epsilon-ui:
|
||||||
image: dessalines/lemmy-ui:0.10.3
|
image: dessalines/lemmy-ui:dev
|
||||||
environment:
|
environment:
|
||||||
- LEMMY_INTERNAL_HOST=lemmy-epsilon:8581
|
- LEMMY_INTERNAL_HOST=lemmy-epsilon:8581
|
||||||
- LEMMY_EXTERNAL_HOST=localhost:8581
|
- LEMMY_EXTERNAL_HOST=localhost:8581
|
||||||
|
|
|
@ -8,4 +8,5 @@ for Item in alpha beta gamma delta epsilon ; do
|
||||||
sudo chown -R 991:991 volumes/pictrs_$Item
|
sudo chown -R 991:991 volumes/pictrs_$Item
|
||||||
done
|
done
|
||||||
|
|
||||||
|
sudo docker-compose pull --ignore-pull-failures || true
|
||||||
sudo docker-compose up
|
sudo docker-compose up
|
||||||
|
|
|
@ -1,38 +1,11 @@
|
||||||
ARG RUST_BUILDER_IMAGE=ekidd/rust-musl-builder:1.50.0
|
|
||||||
|
|
||||||
# Cargo chef plan
|
|
||||||
FROM $RUST_BUILDER_IMAGE as planner
|
|
||||||
WORKDIR /app
|
|
||||||
RUN cargo install cargo-chef
|
|
||||||
|
|
||||||
# Copy dirs
|
|
||||||
COPY ./ ./
|
|
||||||
|
|
||||||
RUN sudo chown -R rust:rust .
|
|
||||||
RUN cargo chef prepare --recipe-path recipe.json
|
|
||||||
|
|
||||||
# Cargo chef cache dependencies
|
|
||||||
FROM $RUST_BUILDER_IMAGE as cacher
|
|
||||||
ARG CARGO_BUILD_TARGET=x86_64-unknown-linux-musl
|
|
||||||
WORKDIR /app
|
|
||||||
RUN cargo install cargo-chef
|
|
||||||
COPY --from=planner /app/recipe.json ./recipe.json
|
|
||||||
RUN sudo chown -R rust:rust .
|
|
||||||
RUN cargo chef cook --release --target ${CARGO_BUILD_TARGET} --recipe-path recipe.json
|
|
||||||
|
|
||||||
# Build the project
|
# Build the project
|
||||||
FROM $RUST_BUILDER_IMAGE as builder
|
FROM ekidd/rust-musl-builder:1.50.0 as builder
|
||||||
|
|
||||||
ARG CARGO_BUILD_TARGET=x86_64-unknown-linux-musl
|
ARG CARGO_BUILD_TARGET=x86_64-unknown-linux-musl
|
||||||
ARG RUSTRELEASEDIR="release"
|
ARG RUSTRELEASEDIR="release"
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy over the cached dependencies
|
|
||||||
COPY --from=cacher /app/target target
|
|
||||||
COPY --from=cacher /home/rust/.cargo /home/rust/.cargo
|
|
||||||
|
|
||||||
# Copy the rest of the dirs
|
|
||||||
COPY ./ ./
|
COPY ./ ./
|
||||||
|
|
||||||
RUN sudo chown -R rust:rust .
|
RUN sudo chown -R rust:rust .
|
||||||
|
|
|
@ -12,14 +12,6 @@ echo "pub const VERSION: &str = \"$new_tag\";" > "crates/utils/src/version.rs"
|
||||||
git add "crates/utils/src/version.rs"
|
git add "crates/utils/src/version.rs"
|
||||||
popd
|
popd
|
||||||
|
|
||||||
# Changing various references to the Lemmy version
|
|
||||||
sed -i "s/dessalines\/lemmy:.*/dessalines\/lemmy:$new_tag/" ../dev/docker-compose.yml
|
|
||||||
sed -i "s/dessalines\/lemmy-ui:.*/dessalines\/lemmy-ui:$new_tag/" ../dev/docker-compose.yml
|
|
||||||
sed -i "s/dessalines\/lemmy:.*/dessalines\/lemmy:$new_tag/" ../federation/docker-compose.yml
|
|
||||||
sed -i "s/dessalines\/lemmy-ui:.*/dessalines\/lemmy-ui:$new_tag/" ../federation/docker-compose.yml
|
|
||||||
git add ../dev/docker-compose.yml
|
|
||||||
git add ../federation/docker-compose.yml
|
|
||||||
|
|
||||||
# The ansible and docker installs should only update for non release-candidates
|
# The ansible and docker installs should only update for non release-candidates
|
||||||
# IE, when the third semver is a number, not '2-rc'
|
# IE, when the third semver is a number, not '2-rc'
|
||||||
if [ ! -z "${third_semver##*[!0-9]*}" ]; then
|
if [ ! -z "${third_semver##*[!0-9]*}" ]; then
|
||||||
|
|
Loading…
Reference in New Issue