Skip to content

Commit 35aadef

Browse files
xs2suruchibhlohumi
authored andcommitted
Update installToolkit.sh
1 parent a918380 commit 35aadef

File tree

1 file changed

+25
-15
lines changed

1 file changed

+25
-15
lines changed

OCIWorkVMStack/scripts/installToolkit.sh

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,14 @@
11
#!/bin/bash
22

3+
start=$(date +%s.%N)
34
username=cd3user
4-
sudo mkdir -p /$username/mount_path
5-
logfile="/$username/mount_path/installToolkit.log"
6-
toolkit_dir="/tmp/githubCode"
5+
#sudo mkdir -p /$username/mount_path
6+
sudo mkdir -p /$username/
7+
NOW=$( date '+%F_%H:%M:%S' )
8+
toolkit_dir="/tmp/githubCode_"+$NOW
9+
710
tenancyconfig_properties="$toolkit_dir/cd3_automation_toolkit/user-scripts/tenancyconfig.properties"
8-
start=$(date +%s.%N)
9-
sudo sh -c "echo '########################################################################' >> /etc/motd"
10-
sudo sh -c "echo ' Welcome to CD3 Automation Toolkit WorkVM' >> /etc/motd"
11-
sudo sh -c "echo '########################################################################' >> /etc/motd"
12-
sudo sh -c "echo 'Please wait for couple of minutes for container to become active if you' >> /etc/motd"
13-
sudo sh -c "echo 'are logging in for first time to after VM Provisioning. Toolkit initial' >> /etc/motd"
14-
sudo sh -c "echo 'setup log is present at - /cd3user/mount_path/installToolkit.log' >> /etc/motd"
15-
sudo sh -c "echo 'To verify podman container run command: sudo podman ps -a' >> /etc/motd"
16-
sudo sh -c "echo 'To connect to container run command: sudo podman exec -it cd3_toolkit bash' >> /etc/motd"
17-
sudo sh -c "echo 'if you want to stop seeing these messages at login remove in /etc/motd' >> /etc/motd"
18-
sudo sh -c "echo '###########################################################################' >> /etc/motd"
11+
1912

2013
stop_exec () {
2114
if [[ $? -ne 0 ]] ; then
@@ -66,9 +59,26 @@ fi
6659
sudo podman --version >> $logfile 2>&1
6760

6861
echo "***Download Toolkit***" >> $logfile 2>&1
69-
sudo git clone https://github.com/oracle-devrel/cd3-automation-toolkit.git $toolkit_dir >> $logfile 2>&1
62+
sudo git clone https://github.com/oracle-devrel/cd3-automation-toolkit.git -b testUpgrade $toolkit_dir >> $logfile 2>&1
63+
#Get version from release-Notes of code downloaded
64+
version="v2025.1.1"
7065
stop_exec
7166

67+
sudo mkdir -p /$username/$version
68+
logfile="/$username/$version/installToolkit.log"
69+
70+
sudo sh -c "echo '########################################################################' >> /etc/motd"
71+
sudo sh -c "echo ' Welcome to CD3 Automation Toolkit WorkVM' >> /etc/motd"
72+
sudo sh -c "echo '########################################################################' >> /etc/motd"
73+
sudo sh -c "echo 'Please wait for couple of minutes for container to become active if you' >> /etc/motd"
74+
sudo sh -c "echo 'are logging in for first time to after VM Provisioning. Toolkit initial' >> /etc/motd"
75+
sudo sh -c "echo 'setup log is present at - /cd3user/"+$version+"/installToolkit.log' >> /etc/motd"
76+
sudo sh -c "echo 'To verify podman container run command: sudo podman ps -a' >> /etc/motd"
77+
sudo sh -c "echo 'To connect to container run command: sudo podman exec -it cd3_toolkit bash' >> /etc/motd"
78+
sudo sh -c "echo 'if you want to stop seeing these messages at login remove in /etc/motd' >> /etc/motd"
79+
sudo sh -c "echo '###########################################################################' >> /etc/motd"
80+
81+
7282
curl -H "Authorization: Bearer Oracle" -L http://169.254.169.254/opc/v2/instance/ -o /tmp/metadata.json
7383
metadata=$(cat /tmp/metadata.json)
7484
user_id=$(echo "$metadata" | jq -r '.metadata.current_user_ocid')

0 commit comments

Comments
 (0)