forked from dsohk/rancher-devsecops-workshop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
show-mylab-env.sh
executable file
·39 lines (30 loc) · 1014 Bytes
/
show-mylab-env.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#! /bin/bash -e
if [ ! -f mylab_env.txt ]; then
echo "Collecting your environment..."
cat mylab_vm_list.txt > mylab_env.txt
echo >> mylab_env.txt
if [ -f ssh-mylab-rancher.sh ]; then
SSH_VM=$(<ssh-mylab-rancher.sh)
echo >> mylab_env.txt
eval "$SSH_VM cat rancher-url.txt >> mylab_env.txt"
fi
if [ -f ssh-mylab-harbor.sh ]; then
SSH_VM=$(<ssh-mylab-harbor.sh)
echo >> mylab_env.txt
echo "My Harbor Instance ..." >> mylab_env.txt
eval "$SSH_VM cat harbor-credential.txt >> mylab_env.txt"
echo >> mylab_env.txt
eval "$SSH_VM cat myjenkins.txt >> mylab_env.txt"
echo >> mylab_env.txt
eval "$SSH_VM cat myanchore.txt >> mylab_env.txt"
echo >> mylab_env.txt
eval "$SSH_VM cat mysonarqube.txt >> mylab_env.txt"
echo >> mylab_env.txt
fi
echo >> mylab_env.txt
echo "My Github personal access token: " >> mylab_env.txt
echo >> mylab_env.txt
echo "My SonarQube token: " >> mylab_env.txt
echo >> mylab_env.txt
fi
cat mylab_env.txt