-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimport.sh
More file actions
47 lines (46 loc) · 970 Bytes
/
import.sh
File metadata and controls
47 lines (46 loc) · 970 Bytes
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
39
40
41
42
43
44
45
46
47
#!/bin/bash
set -x
UUID="$(uuid)"
prepare () {
if ghe-migrator prepare /home/admin/$ORGANIZATION.tar.gz -g $UUID; then
echo 'prepare complete'
else
echo 'prepare failure'
exit 1
fi
}
conflicts () {
if test -f $ORGANIZATION-conflicts.csv; then
echo 'conflicts exists already'
else
if ghe-migrator conflicts -g $UUID > $ORGANIZATION-conflicts.csv; then
echo 'conflicts complete'
else
echo 'conflicts failure'
exit 1
fi
fi
cat $ORGANIZATION-conflicts.csv;
}
map () {
if ghe-migrator map -i $ORGANIZATION-conflicts.csv -g $UUID; then
echo 'map complete'
else
echo 'map failure'
exit 1
fi
}
import () {
if ghe-migrator import /home/admin/$ORGANIZATION.tar.gz -g $UUID -u $TARGET_USER -p $TARGET_TOKEN; then
echo 'import complete'
else
echo 'import failure'
exit 1
fi
}
prepare \
&& conflicts \
&& map \
&& import \
# ghe-migrator audit -g $UUID;
&& ghe-migrator unlock -g $UUID;