Skip to content

Commit

Permalink
Merge 32f10db into b0d3609
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisguest75 authored Sep 3, 2024
2 parents b0d3609 + 32f10db commit 8f4a3c2
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 0 deletions.
1 change: 1 addition & 0 deletions 50_tmux_and_screen/TMUX.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ tmux, short for "terminal multiplexer", is a powerful command-line tool used in
TODO:

* tmux in iterm
* Do a few examples of tmuxinator entering pipenv and also selecting nvm.

## Configuration

Expand Down
60 changes: 60 additions & 0 deletions 50_tmux_and_screen/tmuxinator_docker_test/.tmuxinator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# ./.tmuxinator.yml

name: docker_test
root: ./

# Optional tmux socket
# socket_name: foo

# Note that the pre and post options have been deprecated and will be replaced by
# project hooks.

# Project hooks

# Runs on project start, always
# on_project_start: command

# Run on project start, the first time
# on_project_first_start: command

# Run on project start, after the first time
# on_project_restart: command

# Run on project exit ( detaching from tmux session )
# on_project_exit: command

# Run on project stop
# on_project_stop: command

# Runs in each window and pane before window/pane specific commands. Useful for setting up interpreter versions.
# pre_window: rbenv shell 2.0.0-p247

# Pass command line options to tmux. Useful for specifying a different tmux.conf.
# tmux_options: -f ~/.tmux.mac.conf

# Change the command to call tmux. This can be used by derivatives/wrappers like byobu.
# tmux_command: byobu

# Specifies (by name or index) which window will be selected on project startup. If not set, the first window is used.
# startup_window: editor

# Specifies (by index) which pane of the specified window will be selected on project startup. If not set, the first pane is used.
# startup_pane: 1

# Controls whether the tmux session should be attached to automatically. Defaults to true.
# attach: false

windows:
- editor:
layout: main-horizontal
# Synchronize all panes of this window, can be enabled before or after the pane commands run.
# 'before' represents legacy functionality and will be deprecated in a future release, in favour of 'after'
# synchronize: after
panes:
- build:
- pushd ../../07_detect_os
- docker buildx build --progress=plain -f Dockerfile.os -t detect-os .
- docker rm detect-os
- docker run --name detect-os detect-os
- logs:
- lnav docker://detect-os
32 changes: 32 additions & 0 deletions 50_tmux_and_screen/tmuxinator_docker_test/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# TMUXINATOR DOCKER TEST

Test tmuxinator building and showing logs from a container.

* Build a docker container
* Run the docker container
* Get logs in the bottom window

TODO:

* Build the container, run and get the logs.
* Split the windows in the correct direction.
* Wondering if it's best to mix with just to control what gets run in each pane.

## Run

Use the [07_detect_os/README.md](../../07_detect_os/README.md) as an example.

```sh
cd 50_tmux_and_screen/tmuxinator_docker_test
tmuxinator

ctrl+b d

tmux kill-session -t docker_test
```

## Creation

```sh
tmuxinator new --local docker_test
```
24 changes: 24 additions & 0 deletions 50_tmux_and_screen/tmuxinator_docker_test/docker.justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# lists recipes
default:
@just -f docker.justfile --list

# list docker images
list-images:
docker images

# build dockerfile.processor
build:
@echo 'Build container'
docker buildx build --progress=plain -f Dockerfile.processor -t processor .

# run processor
run:
@echo 'Run container'
docker run --rm -it processor

# logs
logs:
@echo 'Container logs'
lnav docker://detect-os


0 comments on commit 8f4a3c2

Please sign in to comment.