示例#1
0
 def start_fold(self, name):
     from cpt.ci_manager import is_travis
     if self.ACTIVE_FOLDING and is_travis():
         self.printer("\ntravis_fold:start:%s\n" % name)
     else:
         self.printer("\n[%s]\n" % name)
示例#2
0
 def end_fold(self, name):
     from cpt.ci_manager import is_travis
     if self.ACTIVE_FOLDING and is_travis():
         self.printer("\ntravis_fold:end:%s\n" % name)
示例#3
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import requests
from cpt import ci_manager
from cpt.ci_manager import CIManager
from cpt.printer import Printer

if __name__ == "__main__":
    manager = CIManager(Printer())
    response = None
    if ci_manager.is_travis():
        if manager.get_branch() == "stable/3.6.1" and \
           not manager.is_pull_request() and \
           os.getenv("CONAN_CLANG_VERSIONS") == "6.0" and \
           os.getenv("CONAN_ARCHS") == "x86_64" and \
           os.getenv("TRAVIS_TOKEN"):
            json_data = {"request": {"branch": "release/3.6.1"}}
            headers = {
                "Authorization": "token %s" % os.getenv("TRAVIS_TOKEN"),
                "Travis-API-Version": "3"
            }
            response = requests.post(
                url=
                "https://api.travis-ci.com/repo/bincrafters%2Fprotobuf-integration-test/requests",
                json=json_data,
                headers=headers)
        else:
            print("Travis CI job does not match:")
            print("BRANCH: %s" % manager.get_branch())
            print("PULL REQUEST: %s" % manager.is_pull_request())