-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add terminals and minor improvements (#65)
* add terminals extension to base container and update CVaaS lab
- Loading branch information
Showing
17 changed files
with
154 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
hostname,terminals_icon,terminals_color,terminals_split | ||
l01,bookmark,terminal.ansiRed | ||
l02,bookmark,terminal.ansiRed,l01 | ||
h01,,terminal.ansiGreen | ||
h02,,terminal.ansiGreen,h01 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
hostname,terminals_icon,terminals_color,terminals_split | ||
l01,bookmark,terminal.ansiRed | ||
l02,bookmark,terminal.ansiRed,l01 | ||
h01,,terminal.ansiGreen | ||
h02,,terminal.ansiGreen,h01 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
hostname,terminals_icon,terminals_color,terminals_split | ||
l01,bookmark,terminal.ansiRed | ||
l02,bookmark,terminal.ansiRed,l01 | ||
h01,,terminal.ansiGreen | ||
h02,,terminal.ansiGreen,h01 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...atures) %}.vscode{% endif %}/{% if terminals is defined %}terminals.json{% endif %}.jinja
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{% raw %}{{% endraw %} | ||
"autorun": true, | ||
"autokill": true, | ||
"env": {% raw %}{{% endraw %} | ||
"TERMINAL_READY_MESSAGE": "Please check the README.md and the lab documentation before using the lab.", | ||
"TERMINAL_SHELL": "bash", | ||
"TERMINAL_STATUS_COMMAND": "Cli -p 15 -c 'show version'", | ||
"TERMINAL_READY_COMMAND": "Cli -p 15" | ||
{% raw %}},{% endraw %} | ||
"terminals": {% raw %}[{% endraw %} | ||
{%- for node in terminals %} | ||
{% raw %}{{% endraw %} | ||
"name": "{{ node.hostname }}", | ||
{%- if node.terminals_description | default(false, true) %} | ||
"description": "{{ node.terminals_description | default("", true) }}", | ||
{%- endif %} | ||
{%- if node.terminals_icon is defined %} | ||
"icon": "{{ node.terminals_icon | default("code", true) }}", | ||
{%- endif %} | ||
{%- if node.terminals_color | default(false, true) %} | ||
"color": "{{ node.terminals_color }}", | ||
{%- endif %} | ||
{%- if node.terminals_split | default(false, true) %} | ||
"split": "{{ node.terminals_split }}", | ||
{%- endif %} | ||
"command": "terminals.sh {{ node.hostname }}", | ||
"recycle": false, | ||
"open": true, | ||
"focus": true | ||
{%- if not loop.last %} | ||
{% raw %}},{% endraw %} | ||
{%- else %} | ||
{% raw %}}{% endraw %} | ||
{%- endif %} | ||
{%- endfor %} | ||
{% raw %}]{% endraw %} | ||
{% raw %}}{% endraw %} |
2 changes: 1 addition & 1 deletion
2
.devcontainer/cvaas-cvaas-and-avd-demo--evpn-mlag/devcontainer.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This script requires VSCode `fabiospampinato.vscode-terminals` extension | ||
# The script will wait for docker exec to be ready before making the terminal available to user input | ||
|
||
clear | ||
echo 'Waiting for the lab to start...' | ||
until docker exec -it $1 ${TERMINAL_SHELL} -c "${TERMINAL_STATUS_COMMAND} 2> /dev/null" >/dev/null 2>&1; do | ||
sleep 5 | ||
done | ||
clear | ||
echo "$1 is ready." | ||
# Print additional instructions for the user if env var is set | ||
if [ "${TERMINAL_READY_MESSAGE}" ]; then | ||
echo ${TERMINAL_READY_MESSAGE} | ||
fi | ||
docker exec -it $1 ${TERMINAL_READY_COMMAND} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
labs/cvaas-cvaas-and-avd-demo--evpn-mlag/.vscode/terminals.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"autorun": true, | ||
"autokill": true, | ||
"env": { | ||
"TERMINAL_READY_MESSAGE": "Please check the README.md and the lab documentation before using the lab.", | ||
"TERMINAL_SHELL": "bash", | ||
"TERMINAL_STATUS_COMMAND": "Cli -p 15 -c 'show version'", | ||
"TERMINAL_READY_COMMAND": "Cli -p 15" | ||
}, | ||
"terminals": [ | ||
{ | ||
"name": "l01", | ||
"icon": "bookmark", | ||
"color": "terminal.ansiRed", | ||
"command": "terminals.sh l01", | ||
"recycle": false, | ||
"open": true, | ||
"focus": true | ||
}, | ||
{ | ||
"name": "l02", | ||
"icon": "bookmark", | ||
"color": "terminal.ansiRed", | ||
"split": "l01", | ||
"command": "terminals.sh l02", | ||
"recycle": false, | ||
"open": true, | ||
"focus": true | ||
}, | ||
{ | ||
"name": "h01", | ||
"icon": "code", | ||
"color": "terminal.ansiGreen", | ||
"command": "terminals.sh h01", | ||
"recycle": false, | ||
"open": true, | ||
"focus": true | ||
}, | ||
{ | ||
"name": "h02", | ||
"icon": "code", | ||
"color": "terminal.ansiGreen", | ||
"split": "h01", | ||
"command": "terminals.sh h02", | ||
"recycle": false, | ||
"open": true, | ||
"focus": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters