Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -187,3 +187,4 @@ devspaces/context/setup-image.sh
final/context/setup-image.sh
final/setup-image.sh
image.tar
final/.ohmyposh.omp.json
162 changes: 162 additions & 0 deletions .ohmyposh.omp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"console_title_template": "{{.Folder}}{{if .Root}} :: root{{end}}",
"palette": {
"yellow": "#c6c43f",
"lightYellow": "#eae14a"
},
"blocks": [
{
"type": "prompt",
"alignment": "left",
"segments": [
{
"properties": {
"cache_duration": "none",
"mapped_shell_names": {
"bash": "Bash",
"cmd": "Cmd",
"powershell": "Shell",
"pwsh": "Shell"
}
},
"template": "@{{ .HostName }}",
"foreground": "darkGray",
"type": "shell",
"style": "plain"
},
{
"properties": {
"cache_duration": "1h",
"mapped_shell_names": {
"bash": "Bash",
"cmd": "Cmd",
"powershell": "Shell",
"pwsh": "Shell"
}
},
"template": "{{ if ne .OS \"darwin\" }} {{ .OS }}{{ end }}{{ if .WSL }}-wsl{{ end }}",
"foreground": "cyan",
"type": "shell",
"style": "plain"
},
{
"properties": {
"cache_duration": "none",
"display_mode": "context",
"fetch_virtual_env": true,
"home_enabled": true,
"display_default": true,
"folder_name_fallback": true,
"default_venv_names": []
},
"template": " {{ if .Error }}{{ .Error }}{{ else }}{{ if .Venv }}({{ .Venv }}) {{ end }}<d>{{ .Full }}</d>{{ end }}",
"foreground": "yellow",
"powerline_symbol": "\ue0b0",
"type": "python",
"style": "plain"
},
{
"properties": {
"branch_icon": "",
"branch_max_length": 25,
"cache_duration": "none",
"fetch_stash_count": true,
"fetch_status": true,
"fetch_upstream_icon": true,
"cherry_pick_icon": "\u2713 ",
"commit_icon": "\u25b7 ",
"merge_icon": "\u25f4 ",
"no_commits_icon": "[no commits]",
"rebase_icon": "\u2c62 ",
"tag_icon": "\u25b6 "
},
"template": " <d>{{ .HEAD }}{{if .BranchStatus }} {{ .BranchStatus }}{{ end }}{{ if .Working.Changed }} § {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }} {{ .Staging.String }}{{ end }}</d> ",
"foreground": "#F3C267",
"type": "git",
"style": "plain",
"foreground_templates": [
"{{ if or (.Working.Changed) (.Staging.Changed) }}#FF9248{{ end }}",
"{{ if and (gt .Ahead 0) (gt .Behind 0) }}#ff5a5a{{ end }}",
"{{ if gt .Ahead 0 }}#B388FF{{ end }}",
"{{ if gt .Behind 0 }}#B388FF{{ end }}"
]
}
],
"newline": false
},
{
"type": "prompt",
"alignment": "left",
"segments": [
{
"properties": {
"cache_duration": "none"
},
"template": " {{ .Code }} ({{ reason .Code }})",
"foreground": "#b8ff75",
"type": "status",
"style": "plain",
"foreground_templates": ["{{ if gt .Code 0 }}#E06C75{{ end }}"]
},
{
"properties": {
"always_enabled": false,
"cache_duration": "none",
"style": "roundrock",
"threshold": 5000
},
"template": " <d>{{ .FormattedMs }}</d>{{ if gt .Ms 10000 }}\u0007{{ end }} ",
"foreground": "lightYellow",
"type": "executiontime",
"style": "plain",
"foreground_templates": ["{{ if gt .Code 0 }}#E06C75{{ end }}"]
}
]
},
{
"type": "prompt",
"alignment": "left",
"segments": [
{
"properties": {
"cache_duration": "none",
"style": "full"
},
"template": "{{ .Path }}",
"foreground": "#61AFEF",
"type": "path",
"style": "plain"
}
],
"newline": false
},
{
"type": "prompt",
"alignment": "left",
"segments": [
{
"properties": {
"cache_duration": "none"
},
"template": "!",
"foreground": "#E06C75",
"type": "root",
"style": "plain"
},
{
"properties": {
"cache_duration": "none"
},
"template": "❯",
"foreground": "#E06C75",
"type": "text",
"style": "plain"
}
],
"newline": true
}
],
"version": 3,
"final_space": true
}
1 change: 1 addition & 0 deletions bindep.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
python3-devel [platform:redhat]
oniguruma-devel [test platform:rpm]
libonig-dev [test platform:dpkg]
unzip [platform:redhat]
1 change: 1 addition & 0 deletions devspaces/context/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ dnf install -y -q \
"python${PYV}-pyyaml" \
"python${PYV}-wheel" \
tar \
unzip \
util-linux-user \
which \
zsh \
Expand Down
24 changes: 13 additions & 11 deletions final/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,34 @@ microdnf remove -y subscription-manager dnf-plugin-subscription-manager
# gcc: for ansible-pylibssh, onigurumacffi/arm64
# ncurses: for ansible-navigator
# oniguruma-devel: onigurumacffi/arm64 (does not have binary)
# unzip: oh-my-posh installer
microdnf install -q -y \
tar \
dumb-init \
echo \
podman \
fuse-overlayfs \
openssh-clients \
zsh \
util-linux-user \
which \
git \
nano \
vim \
dumb-init \
gcc \
git \
git-core \
libssh-devel \
python3-markupsafe \
nano \
ncurses \
oniguruma-devel \
openssh-clients \
podman \
python3-bcrypt \
python3-cffi \
python3-devel \
python3-markupsafe \
python3-pip \
python3-pyyaml \
python3-ruamel-yaml \
python3-wheel \
tar \
unzip \
util-linux-user \
vim \
which \
zsh \
--exclude container-selinux

microdnf -q clean all
Expand Down
1 change: 1 addition & 0 deletions tools/devspaces.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ fi
rm -f devspaces/context/*.whl
ln -f dist/*.whl devspaces/context
ln -f tools/setup-image.sh devspaces/context
ln -f .ohmyposh.omp.json devspaces/context

# we force use of linux/amd64 platform because source image supports only this
# platform and without it, it will fail to cross-build when task runs on arm64.
Expand Down
1 change: 1 addition & 0 deletions tools/ee.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ python -m build --outdir "$REPO_DIR/final/dist/" --wheel "$REPO_DIR"
ansible-builder create -f execution-environment.yml --output-filename Containerfile -v3
$BUILD_CMD -f context/Containerfile context/ --tag "${TAG_BASE}"
ln -f tools/setup-image.sh final/
ln -f .ohmyposh.omp.json final/
$BUILD_CMD -f final/Containerfile final/ --tag "${IMAGE_NAME}"

# We save local image in order to import it inside the container later for c-in-c testing
Expand Down
12 changes: 10 additions & 2 deletions tools/setup-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,13 @@ oc version --client=true
# ubi9 image but not on fedora one.
touch ~/.zshrc

# Install oh-my-zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
# Install our oh-my-posh theme
mkdir -p ~/.poshthemes/
cp -f /final/.ohmyposh.omp.json ~/.poshthemes/ansible.omp.json

# Install oh-my-posh
curl -s https://ohmyposh.dev/install.sh | bash -s
cat >> ~/.zshrc <<'EOF'
export PATH=$PATH:$HOME/.local/bin
eval "$(oh-my-posh init zsh --config ~/.poshthemes/ansible.omp.json)"
EOF
Loading