.gitlab-ci.yml 3.56 KB
Newer Older
1 2 3 4 5 6
before_script:
  - >
    export LAST_PIPELINE_COMMIT=$(curl --header "Private-Token: $GITLAB_API_KEY" "https://gitlab.labs.nic.cz/api/v4/projects/$CI_PROJECT_ID/pipelines" |
    python2.7 -c "import sys, json; print json.load(sys.stdin)[1]['sha']")

stages:
7 8 9 10 11
  - AndroidApp
  - ControlServer
  - MapServer
  - QoSServer
  - StatisticServer
12 13

ControlServer:
14
  stage: ControlServer
15 16 17
  except:
    - tags
  allow_failure: true
18 19
  script:
    - >
20 21 22 23
      if git diff $LAST_PIPELINE_COMMIT HEAD --name-only|grep RMBTControlServer; then
        echo "Starting Control Server build!" &&
        cd RMBTControlServer/ && ./gradlew clean build && cd ..
      fi;
24 25 26
  artifacts:
    paths:
    - RMBTControlServer/build/libs/RMBTControlServer.war
27

28
ControlServerRelease:
29 30 31 32 33 34 35 36 37 38 39
  stage: ControlServer
  only:
    - tags
  allow_failure: true
  script:
    - >
      echo "Starting Control Server build!" &&
      cd RMBTControlServer/ && ./gradlew clean build && cd ..
  artifacts:
    paths:
    - RMBTControlServer/build/libs/RMBTControlServer.war
40

41
AndroidApp:
42
  stage: AndroidApp
43 44 45
  except:
    - tags
  allow_failure: true
46 47 48 49 50 51 52 53 54
  script:
    - >
      if git diff $LAST_PIPELINE_COMMIT HEAD --name-only|grep RMBTAndroid; then
        echo "Starting Android App build!" &&
        cd RMBTAndroid/ && ./gradlew clean build && cd ..
      fi;
  artifacts:
    paths:
    - RMBTAndroid/build/outputs/apk/RMBTAndroid*.apk
55

56 57 58
AndroidAppRelease:
  stage: AndroidApp
  only:
59
    - tags
60
  allow_failure: true
61 62 63 64 65 66 67 68
  script:
    - >
      echo "Starting Android App build!" &&
      cd RMBTAndroid/ && ./gradlew clean build && cd ..
  artifacts:
    paths:
    - RMBTAndroid/build/outputs/apk/RMBTAndroid*.apk

69
StatisticServer:
70
  stage: StatisticServer
71 72 73
  except:
    - tags
  allow_failure: true
74 75 76 77 78 79 80 81 82
  script:
    - >
      if git diff $LAST_PIPELINE_COMMIT HEAD --name-only|grep RMBTStatisticServer; then
        echo "Starting Statistic Server build!" &&
        cd RMBTStatisticServer/ && ./gradlew clean build && cd ..
      fi;
  artifacts:
    paths:
    - RMBTStatisticServer/build/libs/RMBTStatisticServer.war
83

84 85 86
StatisticServerRelease:
  stage: StatisticServer
  only:
87
    - tags
88
  allow_failure: true
89 90 91 92 93 94 95 96
  script:
    - >
      echo "Starting Statistic Server build!" &&
      cd RMBTStatisticServer/ && ./gradlew clean build && cd ..
  artifacts:
    paths:
    - RMBTStatisticServer/build/libs/RMBTStatisticServer.war

97
QoSServer:
98
  stage: QoSServer
99 100 101
  except:
    - tags
  allow_failure: true
102 103 104 105 106 107 108 109 110
  script:
    - >
      if git diff $LAST_PIPELINE_COMMIT HEAD --name-only|grep RMBTQoSServer; then
        echo "Starting QoS Server build!" &&
        cd RMBTQoSServer/ && ./gradlew clean build && cd ..
      fi;
  artifacts:
    paths:
    - RMBTQoSServer/build/libs/RMBTQoSServer.jar
111

112 113 114
QoSServerRelease:
  stage: QoSServer
  only:
115
    - tags
116
  allow_failure: true
117 118 119 120 121 122 123 124
  script:
    - >
      echo "Starting QoS Server build!" &&
      cd RMBTQoSServer/ && ./gradlew clean build && cd ..
  artifacts:
    paths:
    - RMBTQoSServer/build/libs/RMBTQoSServer.jar

125
MapServer:
126
  stage: MapServer
127 128 129
  except:
    - tags
  allow_failure: true
130 131 132 133 134 135 136 137 138
  script:
    - >
      if git diff $LAST_PIPELINE_COMMIT HEAD --name-only|grep RMBTMapServer; then
        echo "Starting Map Server build!" &&
        cd RMBTMapServer/ && ./gradlew clean build && cd ..
      fi;
  artifacts:
    paths:
    - RMBTMapServer/build/libs/RMBTMapServer.war
139 140 141 142

MapServerRelease:
  stage: MapServer
  only:
143
    - tags
144
  allow_failure: true
145 146 147 148 149 150 151
  script:
    - >
      echo "Starting Map Server build!" &&
      cd RMBTMapServer/ && ./gradlew clean build && cd ..
  artifacts:
    paths:
    - RMBTMapServer/build/libs/RMBTMapServer.war