* 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`
- - 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
settings:
dockerfile: docker/prod/Dockerfile
image: plugins/docker
settings:
dockerfile: docker/prod/Dockerfile
auto_tag_suffix: linux-amd64
when:
ref:
auto_tag_suffix: linux-amd64
when:
ref:
- - name: push to docker manifest
+ - name: publish release docker manifest
image: plugins/manifest
settings:
username:
image: plugins/manifest
settings:
username:
ignore_missing: true
when:
ref:
ignore_missing: true
when:
ref:
services:
- name: database
services:
- name: database
- - 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
settings:
dockerfile: docker/prod/Dockerfile.arm
image: plugins/docker
settings:
dockerfile: docker/prod/Dockerfile.arm
- - name: push to docker manifest
+ - name: publish release docker manifest
image: plugins/manifest
settings:
username:
image: plugins/manifest
settings:
username:
ignore_missing: true
when:
ref:
ignore_missing: true
when:
ref:
services:
- name: database
services:
- name: database
- image: dessalines/lemmy-ui:0.10.3
+ image: dessalines/lemmy-ui:dev
ports:
- "1235:1234"
restart: always
ports:
- "1235:1234"
restart: always
mkdir -p volumes/pictrs
sudo chown -R 991:991 volumes/pictrs
sudo docker build ../../ --file ../dev/Dockerfile -t lemmy-dev:latest
mkdir -p volumes/pictrs
sudo chown -R 991:991 volumes/pictrs
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
mkdir -p volumes/pictrs
sudo chown -R 991:991 volumes/pictrs
sudo docker build ../../ --file ../dev/volume_mount.dockerfile -t lemmy-dev:latest
mkdir -p volumes/pictrs
sudo chown -R 991:991 volumes/pictrs
sudo docker build ../../ --file ../dev/volume_mount.dockerfile -t lemmy-dev:latest
+sudo docker-compose pull --ignore-pull-failures || true
- ./volumes/pictrs_alpha:/mnt
lemmy-alpha-ui:
- ./volumes/pictrs_alpha:/mnt
lemmy-alpha-ui:
- image: dessalines/lemmy-ui:0.10.3
+ image: dessalines/lemmy-ui:dev
environment:
- LEMMY_INTERNAL_HOST=lemmy-alpha:8541
- LEMMY_EXTERNAL_HOST=localhost:8541
environment:
- LEMMY_INTERNAL_HOST=lemmy-alpha:8541
- LEMMY_EXTERNAL_HOST=localhost:8541
- ./volumes/postgres_alpha:/var/lib/postgresql/data
lemmy-beta-ui:
- ./volumes/postgres_alpha:/var/lib/postgresql/data
lemmy-beta-ui:
- image: dessalines/lemmy-ui:0.10.3
+ image: dessalines/lemmy-ui:dev
environment:
- LEMMY_INTERNAL_HOST=lemmy-beta:8551
- LEMMY_EXTERNAL_HOST=localhost:8551
environment:
- LEMMY_INTERNAL_HOST=lemmy-beta:8551
- LEMMY_EXTERNAL_HOST=localhost:8551
- ./volumes/postgres_beta:/var/lib/postgresql/data
lemmy-gamma-ui:
- ./volumes/postgres_beta:/var/lib/postgresql/data
lemmy-gamma-ui:
- image: dessalines/lemmy-ui:0.10.3
+ image: dessalines/lemmy-ui:dev
environment:
- LEMMY_INTERNAL_HOST=lemmy-gamma:8561
- LEMMY_EXTERNAL_HOST=localhost:8561
environment:
- LEMMY_INTERNAL_HOST=lemmy-gamma:8561
- LEMMY_EXTERNAL_HOST=localhost:8561
# An instance with only an allowlist for beta
lemmy-delta-ui:
# An instance with only an allowlist for beta
lemmy-delta-ui:
- image: dessalines/lemmy-ui:0.10.3
+ image: dessalines/lemmy-ui:dev
environment:
- LEMMY_INTERNAL_HOST=lemmy-delta:8571
- LEMMY_EXTERNAL_HOST=localhost:8571
environment:
- LEMMY_INTERNAL_HOST=lemmy-delta:8571
- LEMMY_EXTERNAL_HOST=localhost:8571
# An instance who has a blocklist, with lemmy-alpha blocked
lemmy-epsilon-ui:
# An instance who has a blocklist, with lemmy-alpha blocked
lemmy-epsilon-ui:
- image: dessalines/lemmy-ui:0.10.3
+ image: dessalines/lemmy-ui:dev
environment:
- LEMMY_INTERNAL_HOST=lemmy-epsilon:8581
- LEMMY_EXTERNAL_HOST=localhost:8581
environment:
- LEMMY_INTERNAL_HOST=lemmy-epsilon:8581
- LEMMY_EXTERNAL_HOST=localhost:8581
sudo chown -R 991:991 volumes/pictrs_$Item
done
sudo chown -R 991:991 volumes/pictrs_$Item
done
+sudo docker-compose pull --ignore-pull-failures || true
-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
-
-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 RUSTRELEASEDIR="release"
WORKDIR /app
ARG CARGO_BUILD_TARGET=x86_64-unknown-linux-musl
ARG RUSTRELEASEDIR="release"
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 ./ ./
RUN sudo chown -R rust:rust .
COPY ./ ./
RUN sudo chown -R rust:rust .
git add "crates/utils/src/version.rs"
popd
git add "crates/utils/src/version.rs"
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
# IE, when the third semver is a number, not '2-rc'
if [ ! -z "${third_semver##*[!0-9]*}" ]; then
# The ansible and docker installs should only update for non release-candidates
# IE, when the third semver is a number, not '2-rc'
if [ ! -z "${third_semver##*[!0-9]*}" ]; then