File: build-in-vm.sh

package info (click to toggle)
mariadb 1%3A11.8.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 772,520 kB
  • sloc: ansic: 2,414,714; cpp: 1,791,394; asm: 381,336; perl: 62,905; sh: 49,647; pascal: 40,897; java: 39,363; python: 20,791; yacc: 20,432; sql: 17,907; xml: 12,344; ruby: 8,544; cs: 6,542; makefile: 6,145; ada: 1,879; lex: 1,193; javascript: 996; objc: 80; tcl: 73; awk: 46; php: 22
file content (85 lines) | stat: -rwxr-xr-x 1,810 bytes parent folder | download | duplicates (6)
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/sh

if [ $# != 5 ]; then
    echo "Usage: $0 PACKAGE SPEC_DIR MYSQL_VARIANTS ARCHITECTURES"
    echo " e.g.: $0 mroonga ../rpm/centos 'mysql55 mariadb' 'i386 x86_64' '6 7'"
    exit 1
fi

PACKAGE="$1"
SPEC_DIR="$2"
MYSQL_VARIANTS="$3"
ARCHITECTURES="$4"
CENTOS_VERSIONS="$5"

run()
{
  "$@"
  if test $? -ne 0; then
    echo "Failed $@"
    exit 1
  fi
}

run vagrant destroy --force

for mysql_variant in ${MYSQL_VARIANTS}; do
  rm -rf tmp/centos/
  mkdir -p tmp/centos/
  cp ${SPEC_DIR}/${mysql_variant}-${PACKAGE}.spec tmp/centos/

  architectures="${ARCHITECTURES}"
  case ${mysql_variant} in
    mysql55)
      centos_versions="6"
      ;;
    mysql56-community)
      centos_versions="6 7"
      ;;
    mysql57-community)
      centos_versions="6 7"
      ;;
    mariadb)
      centos_versions="7"
      ;;
    mariadb-10.1)
      centos_versions="6 7"
      ;;
    mariadb-10.2)
      centos_versions="6 7"
      ;;
    percona-server-56)
      centos_versions="6 7"
      ;;
    percona-server-57)
      centos_versions="6 7"
      ;;
  esac

  for architecture in ${architectures}; do
    for centos_version in ${centos_versions}; do
      skip=1
      for given_version in ${CENTOS_VERSIONS}; do
        if [ ${given_version} = ${centos_version} ]; then
          skip=0
        fi
      done
      if [ $skip -eq 1 ]; then
        continue
      fi
      if [ ${mysql_variant} = mysql55 -a ${centos_version} = 6 -a ${architecture} = i386 ]; then
        continue
      fi
      if [ ${centos_version} = 7 -a ${architecture} = i386 ]; then
        continue
      fi
      id=centos-${centos_version}-${architecture}
      vagrant up ${id}
      build_status=$?
      if [ $build_status -ne 0 ]; then
        exit $build_status
      fi
      vagrant destroy --force ${id}
    done
  done
done