Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[breaking] support default options .ultraman #44

Merged
merged 9 commits into from
Mar 27, 2022

Conversation

yukihirop
Copy link
Owner

@yukihirop yukihirop commented Mar 27, 2022

Summary

Resolve #37

  • support default options (.ultraman)
    • update man page

Breaking

For convenience of supporting default options
no-timestamp or n can no longer be treated as a flag.😅

Work

start

when .ultraman exits

env: ./tmp/.env
procfile: ./tmp/Procfile
port: 7000
no-timestamp: true
formation: loop=2
$ cargo run start
    Finished dev [unoptimized + debuginfo] target(s) in 0.17s
     Running `target/debug/ultraman start`
system    | loop.1    start at pid: 30427
system    | loop.2    start at pid: 30428
loop.2    | 7001
loop.1    | 7000
loop.1    | 7000
loop.2    | 7001
loop.2    | 7001
loop.1    | 7000
loop.1    | 7000
loop.2    | 7001
loop.1    | 7000
loop.2    | 7001
^Csystem  | SIGINT received, starting shutdown
system    | sending SIGTERM to all processes
system    | sending SIGTERM for loop.1    at pid 30427
system    | sending SIGTERM for loop.2    at pid 30428
loop.2    | terminated by SIGTERM
loop.1    | terminated by SIGTERM

not exits .ultraman

$ cargo run start \
  -m loop=2,exit_1=3 \
  -e ./.env \
  -f ./Procfile \
  -p 7000 \
  -t 10 \
  -n false
$ cargo run start \
  --formation all=2 \
  --env ./.env \
  --procfile ./Procfile \
  --port 7000 \
  --timeout 10 \
  --no-timestamp true

run

when .ultraman exits

env: ./tmp/.env
procfile: .tmp/Procfile
$ cargo run run sleep1
    Finished dev [unoptimized + debuginfo] target(s) in 0.22s
     Running `target/debug/ultraman run sleep1`
tmp hello
^C

not exists .ultraman

$ cargo run run loop \
  -e .env \
  -f Procfile
cargo run run exit_0 \
  --env .env \
  --procfile Procfile

export

when .ultraman exits

formation: loop=1,exit_0=2
env: .env
procfile: Procfile
port: 7000
app: example-app
log: ./tmp/supervisord/log
run: ./tmp/supervisord/run
template: ../../src/cmd/export/templates/supervisord
user: root
root: /home/app/
timeout: 10
$ cargo run export supervisord ./tmp/supervisord
    Finished dev [unoptimized + debuginfo] target(s) in 0.08s
     Running `target/debug/ultraman export supervisord ./tmp/supervisord`
[ultraman export] cleaning: ./tmp/supervisord/app.conf
[ultraman export] writing: ./tmp/supervisord/app.conf

not exits .ultraman

$ cargo run export supervisord ./tmp/supervisord \
  -m all=2 \
  -e .env \
  -f Procfile \
  -p 7000 \
  -a example-app \
  -l ./tmp/supervisord/log \
  -r ./tmp/supervisord/run \
  -T ../../src/cmd/export/templates/supervisord \
  -u root \
  -d /home/app \
  -t 10
cargo run export supervisord ./tmp/supervisord \
  --formation loop=1,exit_0=2 \
  --env .env \
  --procfile Procfile \
  --port 7000 \
  --app example-app \
  --log ./tmp/supervisord/log \
  --run ./tmp/supervisord/run \
  --template ../../src/cmd/export/templates/supervisord \
  --user root \
  --root /home/app \
  --timeout 10

Test

  • cargo test
  • cargo test -- --ignored
  • cargo test -- --nocapture

@yukihirop yukihirop self-assigned this Mar 27, 2022
@yukihirop yukihirop added this to the v0.2.0 milestone Mar 27, 2022
@yukihirop yukihirop changed the title Issues37/support dot ultraman [breaking] support default options .ultraman Mar 27, 2022
@yukihirop yukihirop merged commit 2dd8500 into feature/v0.2.0 Mar 27, 2022
@yukihirop yukihirop deleted the issues37/support_dot_ultraman branch March 27, 2022 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant