Skip to content

Commit 1388a53

Browse files
author
Marcin Przepiorowski
committed
single file
1 parent e3b6a62 commit 1388a53

File tree

3 files changed

+124
-0
lines changed

3 files changed

+124
-0
lines changed

tools/compile_one.j2

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/bash
2+
3+
VER=$1
4+
5+
export PAR_VERBATIM=1
6+
export TARLOC={{ dxtar }}
7+
export DXLOC={{ dxout }}
8+
9+
PP={{ pploc }}
10+
11+
rm -rf $DXLOC
12+
mkdir $DXLOC
13+
14+
cd {{ dxloc }}/bin
15+
16+
{% if openssl is defined %}
17+
$PP -u -l /usr/lib64/libcrypto.so.10 -l /usr/lib64/libssl.so -I {{ dxloc }}/lib/ -M Text::CSV_PP -M List::MoreUtils::PP -M Crypt::Blowfish -F Crypto=dbutils\.pm$ -M Filter::Crypto::Decrypt -o $DXLOC/runner `ls dx_*.pl | xargs`
18+
{% else %}
19+
$PP -u -I {{ dxloc }}/lib/ -M Text::CSV_PP -M List::MoreUtils::PP -M Crypt::Blowfish -F Crypto=dbutils\.pm$ -M Filter::Crypto::Decrypt -o $DXLOC/runner `ls dx_*.pl | xargs`
20+
{% endif %}
21+
22+
cp *.example $DXLOC
23+
24+
if [[ "$VER" == "HEAD" ]]; then
25+
VER=`cat ../lib/Toolkit_helpers.pm | grep -e 'our $version' | perl -pe "s/.*(\d\.\d\.\d).*/\1/"`
26+
fi
27+
28+
rm -rf /tmp/par-*
29+
30+
cd $DXLOC
31+
32+
ln -s $DXLOC/runner $DXLOC/dx_get_appliance
33+
34+
echo Checking version
35+
RV=`$DXLOC/dx_get_appliance -version 2>&1`
36+
37+
38+
if [ "$RV" != "$VER" ] ; then
39+
echo ERROR
40+
exit
41+
fi
42+
43+
rm $DXLOC/dx_get_appliance
44+
rm -rf /tmp/par-*

tools/dxt_one.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
- hosts: all
3+
4+
vars:
5+
dxloc: "/home/delphix/github"
6+
temp: "{{ dxversion | default('HEAD') }}"
7+
gittag: "{% if temp != 'HEAD' %} v{{ temp }} {% else %} {{ temp }}{% endif %}"
8+
9+
10+
tasks:
11+
12+
- debug:
13+
msg: "{{ gittag }}"
14+
15+
- debug:
16+
msg: "{{ dxout }}"
17+
18+
- set_fact:
19+
outname: "dxtoolkit2-{{ temp }}-{{ system }}.tar.gz"
20+
when: openssl is not defined
21+
22+
- set_fact:
23+
outname: "dxtoolkit2-{{ temp }}-{{ system }}-openssl.tar.gz"
24+
when: openssl is defined
25+
26+
- name: Find dxtoolkit executable files
27+
find:
28+
paths: "{{ dxloc }}/bin"
29+
file_type: file
30+
patterns: "dx_*.pl"
31+
register: findfiles
32+
33+
- set_fact:
34+
dxfiles: "{{ findfiles.files}}"
35+
36+
- name: create dxtoolkit compile script
37+
template: src=compile_one.j2 dest="{{ dxloc }}/bin/compile_one.sh" mode=755 force=yes
38+
39+
- name: compile
40+
shell: "bash -x {{dxloc}}/bin/compile_one.sh {{ temp }} > /tmp/compile.log"
41+
args:
42+
chdir: "{{ dxloc }}/bin/"
43+
register: output
44+
failed_when: "'ERROR' in output.stdout"
45+
46+
- name: create installer
47+
template: src=install.j2 dest="{{ dxout }}/install.sh" mode=755 force=yes
48+
49+
- name: delete a output file
50+
file:
51+
path: "{{ dxtar }}/{{ outname }}"
52+
state: absent
53+
54+
- name: create an archive
55+
archive:
56+
dest: "{{ dxtar }}/{{ outname }}"
57+
format: gz
58+
path: "{{ dxout }}"
59+
60+
- name: get toolkit
61+
fetch:
62+
src: "{{ dxtar }}/{{ outname }}"
63+
dest: "/mnt/c/Users/pioro/Documents/oss_delphix/dxtoolkit/tools/"
64+
flat: yes

tools/install.j2

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
4+
LIST_OF_SCRIPTS=(
5+
{% for item in dxfiles %}
6+
{{ item.path | basename | regex_replace('\.pl', '') }}
7+
{% endfor %}
8+
)
9+
10+
CURRENT_DIR=`pwd`
11+
12+
for i in "${LIST_OF_SCRIPTS[@]}"
13+
do
14+
echo $i
15+
ln -sf main ${CURRENT_DIR}/$i
16+
done

0 commit comments

Comments
 (0)