File: remote_server_assign_variable.py

package info (click to toggle)
gnat-gps 18-5
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 45,716 kB
  • sloc: ada: 362,679; python: 31,031; xml: 9,597; makefile: 1,030; ansic: 917; sh: 264; java: 17
file content (17 lines) | stat: -rw-r--r-- 498 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# This script automatically assigns the scenario variable "target" upon
# assignment of the build server.

import GPS

my_linux_server_nickname = "foo"


def server_changed(hook, server_type, nickname):
    if server_type == "BUILD_SERVER":
        if nickname == "my_linux_server_nickname":
            GPS.Project.set_scenario_variable("target", "Linux-remote")
        else:
            GPS.Project.set_scenario_variable("target", "Windows")


GPS.Hook("server_config_hook").add(server_changed)