Skip to content

Commit

Permalink
chore: shell tests
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreBeucher committed Feb 19, 2024
1 parent da5ef30 commit 1f38f40
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/shells/.novops.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
environments:
dev:
variables:
- name: MY_APP_HOST
value: "localhost"

prod:
variables:
- name: MY_APP_HOST
value: "prod"

config:
default:
environment: dev
7 changes: 7 additions & 0 deletions tests/shells/Containerfile.shells
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM debian:12.5-slim

RUN apt update && apt install -y bash dash zsh fish ksh tcsh csh curl unzip

RUN curl -L "https://github.com/PierreBeucher/novops/releases/download/v0.12.0/novops-X64-Linux.zip" -o novops.zip && \
unzip novops.zip && \
mv novops /usr/local/bin/novops
28 changes: 28 additions & 0 deletions tests/shells/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/sh

#
# Manual script to test various shells
#

set -ex

cur_dir="$(dirname $0)"
podman build -f "${cur_dir}/Containerfile.shells" -t novops-shells-test:local

# Test novops with various shells

function test_novops_shell() {
podman run -it --rm \
-v "./${cur_dir}/.novops.yml:/app/.novops.yml" \
-w /app \
--entrypoint "$1" \
novops-shells-test:local
# -c 'source <(novops load) && env | grep "^MY_APP_HOST=localhost$"'
}

test_novops_shell bash
test_novops_shell dash
test_novops_shell zsh
test_novops_shell fish
test_novops_shell tcsh
test_novops_shell csh

0 comments on commit 1f38f40

Please sign in to comment.