Skip to content

Commit 81108f4

Browse files
author
Marcin Przepiorowski
committed
version 2.4.5
2 parents 97511e1 + 5ed3bfd commit 81108f4

File tree

305 files changed

+14704
-15742
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

305 files changed

+14704
-15742
lines changed

.github/workflows/build.yml

Lines changed: 419 additions & 0 deletions
Large diffs are not rendered by default.

.github/workflows/develop.yml

Lines changed: 281 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,281 @@
1+
name: Perl application
2+
3+
on:
4+
push:
5+
branch:
6+
- "develop"
7+
8+
jobs:
9+
centos7:
10+
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: checkout dxtoolkit code
14+
uses: actions/checkout@master
15+
16+
- name: Set up a Perl container
17+
#uses: pioro/dxtoolkit@develop
18+
uses: docker://pioro/dxperlcent7:5.26
19+
with:
20+
ENCKEY: ${{ secrets.ENCKEY }}
21+
22+
- name: Get the version
23+
id: get_version
24+
run: |
25+
if (echo ${GITHUB_REF} | grep "/tags/" > /dev/null); then
26+
SOURCE_TAG=${GITHUB_REF#refs/tags/}
27+
elif (echo ${GITHUB_REF} | grep "/heads/" > /dev/null); then
28+
SOURCE_TAG=${GITHUB_REF#refs/heads/}
29+
else
30+
exit 1
31+
fi
32+
FILENAME="dxtoolkit2-${SOURCE_TAG}-redhat7-installer.tar.gz"
33+
echo "::set-env name=SOURCE_TAG::$SOURCE_TAG"
34+
echo "::set-env name=FILENAME::$FILENAME"
35+
36+
37+
- name: compress toolkit
38+
run: |
39+
mv dxtoolkit.tar.gz ${{ env.FILENAME }}
40+
41+
- name: Upload centos 7
42+
uses: actions/upload-artifact@v1
43+
with:
44+
name: cento7build
45+
path: ${{ env.FILENAME }}
46+
47+
48+
ubuntu:
49+
needs: [centos7]
50+
runs-on: ubuntu-18.04
51+
52+
steps:
53+
- name: checkout dxtoolkit code
54+
uses: actions/checkout@master
55+
56+
57+
- name: Set up a Perl container
58+
#uses: pioro/dxtoolkit@develop
59+
uses: docker://pioro/dxperlubuntu18:5.26
60+
with:
61+
ENCKEY: ${{ secrets.ENCKEY }}
62+
63+
- name: Get the version
64+
id: get_version
65+
run: |
66+
if (echo ${GITHUB_REF} | grep "/tags/" > /dev/null); then
67+
SOURCE_TAG=${GITHUB_REF#refs/tags/}
68+
elif (echo ${GITHUB_REF} | grep "/heads/" > /dev/null); then
69+
SOURCE_TAG=${GITHUB_REF#refs/heads/}
70+
else
71+
exit 1
72+
fi
73+
FILENAME="dxtoolkit2-${SOURCE_TAG}-ubuntu1804-installer.tar.gz"
74+
echo "::set-env name=SOURCE_TAG::$SOURCE_TAG"
75+
echo "::set-env name=FILENAME::$FILENAME"
76+
77+
- name: compress toolkit
78+
run: |
79+
mv dxtoolkit.tar.gz ${{ env.FILENAME }}
80+
81+
- name: Upload ubuntu
82+
uses: actions/upload-artifact@v1
83+
with:
84+
name: ubuntubuild
85+
path: ${{ env.FILENAME }}
86+
87+
centos6:
88+
needs: [centos7]
89+
runs-on: ubuntu-latest
90+
91+
steps:
92+
- name: checkout dxtoolkit code
93+
uses: actions/checkout@master
94+
95+
- name: Set up a Perl container
96+
#uses: pioro/dxtoolkit@develop
97+
uses: docker://pioro/dxperlcent6:5.26
98+
with:
99+
ENCKEY: ${{ secrets.ENCKEY }}
100+
101+
- name: Get the version
102+
id: get_version
103+
run: |
104+
if (echo ${GITHUB_REF} | grep "/tags/" > /dev/null); then
105+
SOURCE_TAG=${GITHUB_REF#refs/tags/}
106+
elif (echo ${GITHUB_REF} | grep "/heads/" > /dev/null); then
107+
SOURCE_TAG=${GITHUB_REF#refs/heads/}
108+
else
109+
exit 1
110+
fi
111+
FILENAME="dxtoolkit2-${SOURCE_TAG}-redhat6-installer.tar.gz"
112+
echo "::set-env name=SOURCE_TAG::$SOURCE_TAG"
113+
echo "::set-env name=FILENAME::$FILENAME"
114+
115+
- name: compress toolkit
116+
run: |
117+
mv dxtoolkit.tar.gz ${{ env.FILENAME }}
118+
119+
- name: Upload centos 6
120+
uses: actions/upload-artifact@v1
121+
with:
122+
name: cento6build
123+
path: ${{ env.FILENAME }}
124+
125+
Windows:
126+
needs: [centos7]
127+
runs-on: windows-2016
128+
129+
steps:
130+
- name: checkout dxtoolkit code
131+
uses: actions/checkout@master
132+
133+
- name: Get the version
134+
id: get_version
135+
run: |
136+
if (${env:GITHUB_REF} -match "tags") {
137+
$SOURCE_TAG = ${env:GITHUB_REF} -replace 'refs\/tags\/', ''
138+
} elseif (${env:GITHUB_REF} -match "heads") {
139+
$SOURCE_TAG = ${env:GITHUB_REF} -replace 'refs\/heads\/', ''
140+
} else {
141+
exit 1
142+
}
143+
$FILENAME="dxtoolkit2-" + $SOURCE_TAG + "-win64-installer.zip"
144+
echo "::set-env name=SOURCE_TAG::$SOURCE_TAG"
145+
echo "::set-env name=FILENAME::$FILENAME"
146+
shell: powershell
147+
148+
- name: Fix encryption key
149+
run: |
150+
cd D:\a\dxtoolkit\dxtoolkit\lib
151+
ls -l dbutils.pm
152+
mv dbutils.pm dbutils.orig.pm
153+
$raw = (Get-Content -path .\dbutils.orig.pm -Raw) -replace 'put your encryption key here','${{ secrets.ENCKEY_WINDOWS }}'
154+
Set-Content -Path .\dbutils.pm -Value $raw
155+
cd D:\a\dxtoolkit\dxtoolkit\
156+
shell: powershell
157+
158+
- name: Upload enc
159+
uses: actions/upload-artifact@v1
160+
with:
161+
name: windowsbuild-enc
162+
path: D:\a\dxtoolkit\dxtoolkit\lib\dbutils.pm
163+
164+
- name: download perl
165+
run: |
166+
mkdir d:\a\perldownload
167+
mkdir d:\a\perl
168+
Invoke-WebRequest "http://strawberryperl.com/download/5.26.3.1/strawberry-perl-5.26.3.1-64bit-portable.zip" -OutFile "d:\a\perldownload\perl526.zip"
169+
dir d:\a\perldownload\
170+
Expand-Archive "d:\a\perldownload\perl526.zip" -DestinationPath "d:\a\perl"
171+
shell: powershell
172+
173+
- name: build
174+
run: build\windows_compile.cmd
175+
shell: cmd
176+
177+
- name: compress toolkit
178+
run: |
179+
$NAME = "d:\a\dxtoolkit\dxtoolkit\${{ env.FILENAME }}"
180+
echo ${NAME}
181+
Compress-Archive -Path d:\a\dxtoolkit\dxtoolkit\dxtoolkit2 -DestinationPath ${NAME}
182+
shell: powershell
183+
184+
- name: Upload windows
185+
uses: actions/upload-artifact@v1
186+
with:
187+
name: windowsbuild
188+
path: ${{ env.FILENAME }}
189+
190+
191+
osx:
192+
needs: [centos7]
193+
runs-on: macos-latest
194+
195+
steps:
196+
- name: checkout dxtoolkit code
197+
uses: actions/checkout@master
198+
199+
200+
- name: Get the version
201+
id: get_version
202+
run: |
203+
if (echo ${GITHUB_REF} | grep "/tags/" > /dev/null); then
204+
SOURCE_TAG=${GITHUB_REF#refs/tags/}
205+
elif (echo ${GITHUB_REF} | grep "/heads/" > /dev/null); then
206+
SOURCE_TAG=${GITHUB_REF#refs/heads/}
207+
else
208+
exit 1
209+
fi
210+
FILENAME="dxtoolkit2-${SOURCE_TAG}-osx.tar.gz"
211+
echo "::set-env name=SOURCE_TAG::$SOURCE_TAG"
212+
echo "::set-env name=FILENAME::$FILENAME"
213+
214+
- name: install perl
215+
run: |
216+
brew install cpanminus
217+
brew install openssl
218+
cpanm JSON
219+
cpanm Date::Manip
220+
# force requires after 1/1/2020 ?
221+
cpanm -f Date::Parse
222+
cpanm DateTime::Event::Cron::Quartz
223+
cpanm DateTime::Format::DateParse
224+
cpanm Crypt::CBC
225+
cpanm Crypt::Blowfish
226+
cpanm Text::CSV
227+
cpanm LWP::UserAgent
228+
cpanm Net::SSLeay
229+
cpanm IO::Socket::SSL
230+
cpanm LWP::Protocol::https
231+
cpanm Term::ReadKey
232+
cpanm --configure-args="-d=/usr/local/opt/openssl" Filter::Crypto::Decrypt
233+
cpanm -f Archive::Zip
234+
cpanm PAR::Packer
235+
cpanm List::MoreUtils::PP
236+
237+
- name: Compile
238+
run: |
239+
CELL=`brew --prefix perl`
240+
OPENLIB=`brew --prefix openssl`
241+
CDIR=`pwd`
242+
export PP=${CELL}/bin/pp
243+
export LIBS="-l ${OPENLIB}/lib/libssl.dylib -l ${OPENLIB}/lib/libcrypto.dylib"
244+
echo $LIBS
245+
mkdir dxtoolkit2
246+
cd ./lib
247+
mv dbutils.pm dbutils.orig.pm
248+
cat dbutils.orig.pm | sed -e "s/put your encryption key here/${{ secrets.ENCKEY }}/" > dbutils.pm
249+
cd ../bin
250+
$PP -u -I ../lib ${LIBS} -M Text::CSV_PP -M List::MoreUtils::PP -M Crypt::Blowfish \
251+
-F Crypto=dbutils\.pm$ -M Filter::Crypto::Decrypt -o ../dxtoolkit2/runner `ls dx_*.pl | xargs`
252+
cd ${CDIR}/dxtoolkit2
253+
#for i in ${CDIR}/bin/dx_*.pl ; do name=`basename -s .pl $i`; ln -s runner $name; done
254+
255+
echo #!/bin/bash > install.sh
256+
echo LIST_OF_SCRIPTS=\( >> install.sh
257+
258+
for i in ${CDIR}/bin/dx_*.pl ; do
259+
name=`basename -s .pl $i`;
260+
echo $name >> install.sh
261+
done
262+
263+
echo \) >> install.sh
264+
echo >> install.sh
265+
echo >> install.sh
266+
echo for i in \"\$\{LIST_OF_SCRIPTS\[\@\]\}\" >> install.sh
267+
echo do >> install.sh
268+
echo echo \$i >> install.sh
269+
echo ln -sf runner \$i >> install.sh
270+
echo done >> install.sh
271+
272+
273+
cd ${CDIR}
274+
ls -l ./dxtoolkit2
275+
tar czvf ${{ env.FILENAME }} dxtoolkit2/
276+
277+
- name: Upload OSX
278+
uses: actions/upload-artifact@v1
279+
with:
280+
name: osxbuild
281+
path: ${{ env.FILENAME }}

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
## 2.4.5
2+
3+
### Added
4+
- [fix for #100](https://github.com/delphix/dxtoolkit/issues/100) - Request for new dxtoolkit command that can do port validation
5+
- [fix for #120](https://github.com/delphix/dxtoolkit/issues/120) - Oracle and MS SQL support fixed and tested with Delphix 6.0
6+
7+
8+
### Changed
9+
- Since version 2.4.0 snapshot related commands were displaying a snapshots in wrong order from newest to oldest. Version 2.4.5 is fixing this issue and snapshot will be displayed from oldest to newest
10+
like in all previous versions.
11+
This will also fix all commands using a latest snapshot as a timestamp.
12+
- [fix for #106](https://github.com/delphix/dxtoolkit/issues/106) - fix for db_get_db_env -hostenv and -config does not work together
13+
- [fix for #114](https://github.com/delphix/dxtoolkit/issues/114) - dx_provision_vdb - provision vPDB with vCDB from detached source
14+
- [fix for #115](https://github.com/delphix/dxtoolkit/issues/115) - dx_get_bookmark fix for RAC databases
15+
116
## 2.4.4
217

318
### Added

bin/dx_ctl_env.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@
340340
print "Deleting repository $repopath from environment $env_name \n";
341341
my $repository_obj = new Repository_obj($engine_obj, $debug);
342342
if ($repository_obj->deleteRepository($envitem, $repopath)) {
343-
print "Problem with adding repository \n";
343+
print "Problem with deleting repository \n";
344344
$ret = $ret + 1;
345345
}
346346
}

bin/dx_ctl_users.pl

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,10 @@ sub process_user {
224224
next;
225225
}
226226

227-
my ($command, $username,$firstname,$lastname,$email,$workphone,$homephone,$mobilephone,$authtype,$principal,$password,$is_admin, $is_JS, $timeout);
227+
my ($command, $username,$firstname,$lastname,$email,$workphone,$homephone,$mobilephone,$authtype,$principal,$password,$is_admin, $is_JS, $timeout, $apiuser);
228228

229229
if ($csv_obj->parse($line)) {
230-
($command, $username,$firstname,$lastname,$email,$workphone,$homephone,$mobilephone,$authtype,$principal,$password,$is_admin, $is_JS, $timeout) = $csv_obj->fields();
230+
($command, $username,$firstname,$lastname,$email,$workphone,$homephone,$mobilephone,$authtype,$principal,$password,$is_admin, $is_JS, $timeout, $apiuser) = $csv_obj->fields();
231231
} else {
232232
print "Can't parse line : $line \n";
233233
$ret = $ret + 1;
@@ -258,14 +258,17 @@ sub process_user {
258258
next;
259259
}
260260

261+
if (!defined($usertype)) {
262+
$usertype = $loginuser->{userType};
263+
}
261264

262265
if (lc $command eq 'c') {
263-
$ret = $ret + $users_obj->addUser($username, $usertype, $firstname,$lastname,$email,$workphone,$homephone,$mobilephone,$authtype,$principal,$password,$is_admin, $is_JS, $timeout);
266+
$ret = $ret + $users_obj->addUser($username, $usertype, $firstname,$lastname,$email,$workphone,$homephone,$mobilephone,$authtype,$principal,$password,$is_admin, $is_JS, $timeout, $apiuser);
264267
}
265268

266269
if (lc $command eq 'u') {
267270
$usertype = $loginuser->{userType};
268-
$ret = $ret + $users_obj->updateUser($username, $usertype, $firstname,$lastname,$email,$workphone,$homephone,$mobilephone,$authtype,$principal,$password,$is_admin, $is_JS, $timeout);
271+
$ret = $ret + $users_obj->updateUser($username, $usertype, $firstname,$lastname,$email,$workphone,$homephone,$mobilephone,$authtype,$principal,$password,$is_admin, $is_JS, $timeout, $apiuser);
269272
}
270273
if (lc $command eq 'd') {
271274
$usertype = $loginuser->{userType};
@@ -428,7 +431,7 @@ =head2 Options
428431
=item B<-file filename>
429432
CSV file name with user definition and actions. Field list as follow:
430433
431-
command, username, firstname, lastname, email, workphone, homephone, mobilephone, authtype, principal, password, admin_priv, js_user, timeout
434+
command, username, firstname, lastname, email, workphone, homephone, mobilephone, authtype, principal, password, admin_priv, js_user, timeout, apiUser
432435
433436
Allowed command values:
434437
@@ -449,6 +452,10 @@ =head2 Options
449452
Y - Self service (Jet Stream) user
450453
N - Standard User
451454
455+
Allowed apiUser values:
456+
457+
Y - User can login with local user/password if SSO is enabled
458+
N - User can't login with local user/password
452459
453460
=item B<-profile filename>
454461
CSV file name with user profile definition. It can be generated using dx_get_users profile option.

bin/dx_get_db_env.pl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,9 @@
202202
{'Version', 15},
203203
{'Server DB name', 30}
204204
);
205+
} else {
206+
print "Configtype has to have value 'd' or 's'\n";
207+
exit 1;
205208
}
206209
} else {
207210
if (defined($masking)) {

bin/dx_get_users.pl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@
9191
{'principal', 30},
9292
{'password', 8},
9393
{'admin_priv', 8},
94-
{'js_user', 8}
94+
{'js_user', 8},
95+
{'timeout', 8},
96+
{'apiUser', 2}
9597
);
9698
$save = $export;
9799
$format = 'csv';
@@ -198,7 +200,9 @@
198200
$principal,
199201
$password,
200202
$user->isAdmin(),
201-
$user->isJS() ? 'Y' : 'N'
203+
$user->isJS() ? 'Y' : 'N',
204+
$user->getTimeout(),
205+
$user->getApiUser()
202206
);
203207
} else {
204208
if (defined($audit)) {

0 commit comments

Comments
 (0)