Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Pull request
on:
- push
- pull_request
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Build
run: make build
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Test
run: make test
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,12 @@ Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

# Editors
*~
.*.swp
.*sw?

# Added by cargo

/target
8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "s3-active-storage"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# syntax=docker/dockerfile:1

# Adapted from the multi-stage build example in https://hub.docker.com/_/rust

# Stage 1: builder
FROM rust:1.66 as builder
WORKDIR /usr/src/s3-active-storage
COPY . .
RUN cargo install --path .

# Stage 2: final image
FROM debian:bullseye-slim
COPY --from=builder /usr/local/cargo/bin/s3-active-storage /usr/local/bin/s3-active-storage
CMD ["s3-active-storage"]
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.PHONY: build
build:
@docker buildx build -t s3-active-storage .

.PHONY: test
test:
@docker buildx build --target builder -t s3-active-storage-test .
@docker run --rm s3-active-storage-test cargo check --color always
@docker run --rm s3-active-storage-test cargo test --color always

.PHONY: run
run:
@docker run -it --rm --name s3-active-storage s3-active-storage
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,21 @@
# rusty-s3-active-storage
# Rusty S3 Active Storage

S3 Active Storage server

## Build

```bash
make build
```

## Test

```bash
make test
```

## Run

```bash
make run
```
3 changes: 3 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}