Browse Source

drone CD

riir
Cadey Ratio 2 years ago
parent
commit
8097cc9b75
  1. 37
      .drone.yml
  2. 25
      README.md
  3. 4
      src/main.rs

37
.drone.yml

@ -1,8 +1,41 @@
kind: pipeline
name: nix builds
name: nix build and push
steps:
- name: docker image
image: lnl7/nix:2020-03-07
image: "monacoremo/nix:2020-04-05-05f09348-circleci"
commands:
- nix-build docker.nix
volumes:
- name: result
path: /result
- name: push image
image: docker:dind
volumes:
- name: result
path: /result
- name: dockersock
path: /var/run
commands:
- docker load -i /result/docker.tgz
- echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin
- docker push xena/quickserv
environment:
DOCKER_USERNAME:
from_secret: DOCKER_USERNAME
DOCKER_PASSWORD:
from_secret: DOCKER_PASSWORD
services:
- name: docker
image: docker:dind
privileged: true
volumes:
- name: dockersock
path: /var/run
volumes:
- name: result
temp: {}
- name: dockersock
temp: {}

25
README.md

@ -1,13 +1,28 @@
# quickserv
[![built with
nix](https://builtwithnix.org/badge.svg)](https://builtwithnix.org)
A quick HTTP server for when you have given up on life.
`quickserv` serves `.` on port `3000`. Customizable with flags:
```
Usage of quickserv:
-dir string
directory to serve (default ".")
-port string
port to use (default "3000")
quickserv 0.1.0
A quick HTTP fileserver
USAGE:
quickserv [OPTIONS]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-d, --dir <dir> [env: DIR=] [default: .]
-p, --port <port> [env: PORT=] [default: 3000]
```
## Docker

4
src/main.rs

@ -1,12 +1,12 @@
use std::path::PathBuf;
use structopt::StructOpt;
/// A basic example
/// A quick HTTP fileserver
#[derive(StructOpt, Debug)]
#[structopt(name = "quickserv")]
struct Opt {
// The HTTP port to listen on
#[structopt(short, long, env="PORT", default_value="9001")]
#[structopt(short, long, env="PORT", default_value="3000")]
port: u16,
// The path to serve

Loading…
Cancel
Save