Compare commits

..

3 Commits

Author SHA1 Message Date
m0veax
6cab009b3a test script failes on purpose 2024-06-29 00:45:21 +02:00
m0veax
41c111569d add build / deploy instructions to readme 2024-06-29 00:41:16 +02:00
m0veax
baf9d87556 build docker container with git clone to enable automation 2024-06-29 00:14:38 +02:00
4 changed files with 36 additions and 3 deletions

View File

@ -1,7 +1,9 @@
FROM rust:1.75.0 as builder
WORKDIR /usr/src/chaospott-status
COPY . .
# git clone anstatt copy, damit Dockerfile in extra repository liegen kann. Danke @a3x
# git ist im image enthalten, da rust image hiervon abstammt https://hub.docker.com/layers/library/buildpack-deps/bookworm-scm/images/sha256-25f20fd3e3c8be1e9626c246986beb400ccfe19b0ab13d57127399927801d499?context=explore
RUN git clone https://git.chaospott.de/Chaospott/chaospott-status.git .
# use musl to create a truly static binary https://bxbrenden.github.io/
RUN rustup component add rust-std-x86_64-unknown-linux-musl

View File

@ -16,6 +16,19 @@ To start the app, just `cargo run --release` as usual.
Find scripts for testing in [`scripts/`](scripts/).
## Build / Deploy
While building the Docker Container, the sources will be cloned from this repository.
Set the environment variables to set the update secrets.
```shell
export consumer_key=foo
export consumer_secret=bar
docker compose up
```
## Need help?
Ask chfkch, starblue, m0veax, CyReVolt or your favourite Rustacean. 🦀

18
docker-compose.yaml Normal file
View File

@ -0,0 +1,18 @@
version: '3'
services:
spaceapi-v2:
build: .
container_name: spaceapi-v2
restart: always
labels:
- traefik.frontend.rule=Host:status-v2.chaospott.de
- traefik.port=3000
- traefik.frontend.passHostHeader=true
- traefik.enable=true
networks:
- extern
networks:
extern:
external:
name: web

View File

@ -3,7 +3,7 @@
## starte server mit env vars passend zum ersten aufruf
## TODO das muss noch gescripted werden
# should return 201
# should return 201 if env vars are set like this payload states
curl -XPOST \
-H "Content-Type: application/json" \
--data '{"consumer_key": "test123","consumer_secret":"123test","aerie":true }' \
@ -12,5 +12,5 @@ curl -XPOST \
#should return 500
curl -XPOST \
-H "Content-Type: application/json" \
--data '{"consumer_key": "test123","consumer_secret":"123test","aerie":true }' \
--data '{"consumer_key": "foo","consumer_secret":"bar","aerie":true }' \
http://localhost:3000/api/update -vvv