-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
36,342 additions
and
43 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,6 @@ | ||
target/ | ||
tmp/ | ||
|
||
Cargo.lock | ||
Dockerfile | ||
Makefile.toml |
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,39 @@ | ||
FROM rust:alpine as chef | ||
RUN apk add musl-dev pkgconfig openssl openssl-dev | ||
ENV OPENSSL_DIR=/usr | ||
# RUN rustup default nightly | ||
# RUN rustup target add x86_64-unknown-linux-musl | ||
RUN cargo install cargo-chef | ||
WORKDIR /src | ||
|
||
FROM chef as planner | ||
COPY . . | ||
RUN cargo chef prepare --recipe-path recipe.json | ||
|
||
FROM chef as builder | ||
COPY --from=planner /src/recipe.json recipe.json | ||
RUN cargo chef cook --target=x86_64-unknown-linux-musl --release --recipe-path=recipe.json | ||
COPY . . | ||
RUN cargo build --target=x86_64-unknown-linux-musl --release | ||
|
||
FROM scratch as chef-sitemap-generator | ||
COPY --from=builder /src/target/x86_64-unknown-linux-musl/release/sitemap-generator /sitemap-generator | ||
CMD [ "/sitemap-generator" ] | ||
LABEL service=chef-sitemap-generator | ||
LABEL org.opencontainers.image.title="djkato/saleor-sitemap-generator"\ | ||
org.opencontainers.image.description="Creates and keeps Sitemap.xml uptodate with Saleor." \ | ||
org.opencontainers.image.url="https://github.com/djkato/saleor-apps-rs"\ | ||
org.opencontainers.image.source="https://github.com/djkato/saleor-apps-rs"\ | ||
org.opencontainers.image.authors="Djkáťo <[email protected]>"\ | ||
org.opencontainers.image.licenses="PolyForm-Noncommercial-1.0.0" | ||
|
||
FROM scratch as chef-simple-payment-gateway | ||
COPY --from=builder /src/target/x86_64-unknown-linux-musl/release/simple-payment-gateway /simple-payment-gateway | ||
CMD [ "/simple-payment-gateway" ] | ||
LABEL service=chef-simple-payment-gateway | ||
LABEL org.opencontainers.image.title="djkato/saleor-simple-payment-gateway"\ | ||
org.opencontainers.image.description="Payment gateway that adds payment methods that don't need actual verification: Cash on delivery, Cash on warehouse pickup, bank tranfer." \ | ||
org.opencontainers.image.url="https://github.com/djkato/saleor-apps-rs"\ | ||
org.opencontainers.image.source="https://github.com/djkato/saleor-apps-rs"\ | ||
org.opencontainers.image.authors="Djkáťo <[email protected]>"\ | ||
org.opencontainers.image.licenses="PolyForm-Noncommercial-1.0.0" |
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,39 @@ | ||
# Configures the default task to run | ||
[tasks.default] | ||
alias = "build-containers" | ||
|
||
# Overrides the default build task | ||
[tasks.build] | ||
alias = "build-containers" | ||
|
||
[tasks.build-sitemap-generator] | ||
workspace = false | ||
script = ''' | ||
docker build --rm --target chef-sitemap-generator . | ||
docker tag $(docker image ls -q --filter=label=service=chef-sitemap-generator) ghcr.io/djkato/saleor-sitemap-generator | ||
''' | ||
|
||
[tasks.build-simple-payment-gateway] | ||
workspace = false | ||
script = ''' | ||
docker build --rm --target chef-simple-payment-gateway . | ||
docker tag $(docker image ls -q --filter=label=service=chef-simple-payment-gateway) ghcr.io/djkato/saleor-simple-payment-gateway | ||
''' | ||
|
||
[tasks.build-containers] | ||
workspace = false | ||
dependencies = ["build-sitemap-generator", "build-simple-payment-gateway"] | ||
|
||
[tasks.push-containers] | ||
workspace = false | ||
script = ''' | ||
docker push ghcr.io/djkato/saleor-sitemap-generator:latest | ||
docker push ghcr.io/djkato/saleor-simple-payment-gateway:latest | ||
''' | ||
|
||
[tasks.delete-containers] | ||
workspace = false | ||
script = ''' | ||
docker image rm $(docker image ls -q --filter=label=service=chef-simple-payment-gateway) | ||
docker image rm $(docker image ls -q --filter=label=service=chef-sitemap-generator) | ||
''' |
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 was deleted.
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[toolchain] | ||
channel = "nightly" | ||
targets = ["x86_64-unknown-linux-musl"] |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.