forked from shageman/package-based-rails-applications-book
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchapter_code_extractor.sh
More file actions
executable file
·69 lines (54 loc) · 1.51 KB
/
Copy pathchapter_code_extractor.sh
File metadata and controls
executable file
·69 lines (54 loc) · 1.51 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env bash
# INSTALL https://min.io/docs/minio/linux/reference/minio-mc.html?ref=docs
# brew install minio/stable/mc
# bash +o history
# mc alias set minio concourse-server.local:9001 minio minio123
# bash -o history
# mc alias set concourse-server http://concourse-server.local:9001 minio minio123
extractChapter () {
CHAPTER=$1
if [ -z $CHAPTER ];
then echo "ERROR: call extractChapter as extractChapter(CHAPTER)"
exit 1
fi
echo "extractChapter for CHAPTER $CHAPTER"
rm -rf $CHAPTER
mkdir -p $CHAPTER
FILE=$(mc ls concourse-server/releases/ | grep $CHAPTER | sort | tail -1 | awk '{print $NF}')
echo $FILE
echo $CHAPTER/$FILE
mc cp concourse-server/releases/$FILE $CHAPTER/$FILE
sleep 1
tar -xzf $CHAPTER/$FILE -C $CHAPTER
}
extractChapter "c2s01"
extractChapter "c2s02"
extractChapter "c2s03"
extractChapter "c2s04"
extractChapter "c2s05"
extractChapter "c2s06"
extractChapter "c2s07"
extractChapter "c3s01"
extractChapter "c3s02"
extractChapter "c3s03"
extractChapter "c4s01"
extractChapter "c4s02"
extractChapter "c4s03"
extractChapter "c4s04"
extractChapter "c4s05"
extractChapter "c4s06"
extractChapter "c4s07"
extractChapter "c4s08"
extractChapter "c5s07-1"
extractChapter "c5s07-2"
extractChapter "c5s07-3"
extractChapter "c5s08"
extractChapter "c5s09"
extractChapter "c6s01"
extractChapter "c6s02"
extractChapter "c6s03"
extractChapter "c6s04-1"
extractChapter "c6s04-2a"
extractChapter "c6s04-2b"
extractChapter "c9s01-a"
extractChapter "c9s01-b"