File tree 1 file changed +7
-2
lines changed
.github/actions/database-migration-image
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
-
2
+ export CWMS_PASSWORD= ` tr -cd ' [:alnum:] ' < /dev/urandom | fold -w25 | head -n1 `
3
3
cat > /tmp/create-app-user.sql << EOF
4
4
declare
5
5
user_count integer;
10
10
else
11
11
execute immediate 'alter user &1 identified by "&2"';
12
12
end if;
13
+ -- assign a new CWMS_20 password for new operations
14
+ select count(*) into user_count from dba_users where upper(username)='CWMS_20';
15
+ if (user_count > 0) then
16
+ execute immediate 'alter user cwms_20 identified by "&3"';
17
+ end if;
13
18
end;
14
19
/
15
20
EOF
20
25
21
26
# Create app user first, one of the migration steps is to update the "cwms user" information for that user
22
27
23
- sqlplus $BUILDUSER /$BUILDUSER_PASSWORD @$DB_HOST_PORT$DB_NAME @/tmp/create-app-user " $CDA_USERNAME " " $CDA_PASSWORD "
28
+ sqlplus $BUILDUSER /$BUILDUSER_PASSWORD @$DB_HOST_PORT$DB_NAME @/tmp/create-app-user " $CDA_USERNAME " " $CDA_PASSWORD " " $CWMS_PASSWORD "
24
29
25
30
exec $*
You can’t perform that action at this time.
0 commit comments