Skip to content

Commit

Permalink
Solve bug trying to print exit code when config from yml cannot find …
Browse files Browse the repository at this point in the history
…a file. Update README.md
  • Loading branch information
acostapazo committed Apr 8, 2020
1 parent 53c9e09 commit 5640215
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 20 deletions.
44 changes: 26 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ optional arguments:
If you want to save your lume file in another folder or change the name, you can do it with the Environment Variable `LUME_CONFIG_FILENAME`.

```console
>> export LUME_CONFIG_FILENAME=configs/deploy-lume.yml; lume -h
>> export LUME_CONFIG_FILENAME=examples/lume-sample.yml; lume -h
```

#### Run Defined Steps
Expand All @@ -89,44 +89,52 @@ To run install:
```console
>> lume -install
🔥 Step: install
👩‍💻 >> install >> echo "Installing..."
👩‍💻 >> Installing...
👩‍💻 install >> echo "Installing..."
Installing...
```

To run all the steps:

```console
lume -all
>> lume -all
🔥 Step: clean
👩‍💻 >> clean >> echo "Cleaning..."
👩‍💻 >> Cleaning...
👩‍💻 clean >> echo "Cleaning..."
Cleaning...
🔥 Step: build
👩‍💻 >> build >> echo "Building..."
👩‍💻 >> Building...
👩‍💻 build >> echo "Building..."
Building...
🔥 Step: test
👩‍💻 >> test >> echo "Testing..."
👩‍💻 >> Testing...
👩‍💻 test >> echo "Testing (Unit)..."
Testing (Unit)...
👩‍💻 test >> echo "Testing (Integration)..."
Testing (Integration)...
🔥 Step: error
👩‍💻 error [cwd=examples] >> echo "This is an error" >>/dev/stderr
🧐 This is an error
```

Of course, you can run every step individually:

```console
>> lume -clean
🔥 Step: clean
👩‍💻 >> clean >> echo "Cleaning..."
👩‍💻 >> Cleaning...
👩‍💻 clean >> echo "Cleaning..."
Cleaning...
```

Or several steps:

```console
>> lume -build -test
🔥 Action: build
👩‍💻 >> build >> echo "Building..."
👩‍💻 >> Building...
🔥 Action: test
👩‍💻 >> test >> echo "Testing..."
👩‍💻 >> Testing...
🔥 Step: build
👩‍💻 build >> echo "Building..."
Building...
🔥 Step: test
👩‍💻 test >> echo "Testing (Unit)..."
Testing (Unit)...
👩‍💻 test >> echo "Testing (Integration)..."
```

#### Advanced Configurations
Expand Down
3 changes: 2 additions & 1 deletion examples/lume-sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ steps:
- echo "Building..."
test:
run:
- pytest
- echo "Testing (Unit)..."
- echo "Testing (Integration)..."
error:
cwd: examples
run:
Expand Down
2 changes: 1 addition & 1 deletion lume/src/application/cli/lume.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def main():
if result.is_success:
exit_code = 0

if config.settings["show_exit_code"]:
if config and config.settings["show_exit_code"]:
print(f"exit_code: {exit_code}")

sys.exit(exit_code)

0 comments on commit 5640215

Please sign in to comment.