]> source.dussan.org Git - rspamd.git/commitdiff
Update enviroment variable after Drone upgrade 3084/head
authorAnton Yuzhaninov <citrin+git@citrin.ru>
Mon, 14 Oct 2019 13:40:45 +0000 (14:40 +0100)
committerAnton Yuzhaninov <citrin+git@citrin.ru>
Mon, 14 Oct 2019 13:40:45 +0000 (14:40 +0100)
Drone 0.8 and Drone 1.x are not fully compatible.

.drone.yml
test/tools/merge_coveralls.py

index 458e4aa6ca5ca6f24f24b82cc70e4c4a3e59e245..ba27e014d7d40c4749dc1c698f36fd42698542ec 100644 (file)
@@ -10,8 +10,6 @@ pipeline:
     image: ubuntu:18.04
     commands:
       - install -d -o nobody -g nogroup /rspamd/build /rspamd/install /rspamd/fedora/build /rspamd/fedora/install
-      # for debug
-      - echo $CI_COMMIT_AUTHOR
 
   build:
     # https://github.com/rspamd/rspamd-build-docker/blob/master/ubuntu-build/Dockerfile
@@ -157,7 +155,7 @@ pipeline:
       # upload test results to nginx frontent using WebDAV PUT
       - >
         if [ -n "$HTTP_PUT_AUTH" ]; then
-        $CI_WORKSPACE/test/tools/http_put.py log.html report.html $CI_SYSTEM_LINK/testlogs/$CI_REPO_NAME/$CI_BUILD_NUMBER/;
+        $CI_WORKSPACE/test/tools/http_put.py log.html report.html https://$DRONE_SYSTEM_HOSTNAME/testlogs/$DRONE_REPO/$DRONE_BUILD_NUMBER/;
         fi
       # core_pattern=/var/tmp/%u.%e.core so one or two cores can be saved for each binary
       - core_files=$(find /var/tmp/ -name '*.core')
index 09380a3865fd730ba80d7905294b4a3ba61e7b21..36a6162629a935eefdfc991d4c6e2bc77263b0aa 100755 (executable)
@@ -127,27 +127,26 @@ if __name__ == '__main__':
         if os.getenv('CIRCLECI'):
             j1['service_name'] = 'circleci'
             j1['service_job_id'] = os.getenv('CIRCLE_BUILD_NUM')
-        elif os.getenv('CI') == 'drone':
+        elif os.getenv('DRONE') == 'true':
             j1['service_name'] = 'drone'
-            j1['service_branch'] = os.getenv('CI_COMMIT_BRANCH')
+            j1['service_branch'] = os.getenv('DRONE_COMMIT_BRANCH')
             j1['service_build_url'] = os.getenv('DRONE_BUILD_LINK')
-            j1['service_job_id'] = os.getenv('CI_JOB_NUMBER')
-            j1['service_number'] = os.getenv('CI_BUILD_NUMBER')
-            j1['commit_sha'] = os.getenv('CI_COMMIT_SHA')
-            if os.getenv('CI_BUILD_EVENT') == 'pull_request':
-                j1['service_pull_request'] = os.getenv('CI_PULL_REQUEST')
+            j1['service_number'] = os.getenv('DRONE_BUILD_NUMBER')
+            j1['commit_sha'] = os.getenv('DRONE_COMMIT_SHA')
+            if os.getenv('DRONE_BUILD_EVENT') == 'pull_request':
+                j1['service_pull_request'] = os.getenv('DRONE_PULL_REQUEST')
             # git data can be filled by cpp-coveralls, but in our layout it can't find repo
             # so we can override git info witout merging
             j1['git'] = {
                 'head': {
                     'id': j1['commit_sha'],
-                    'author_email': os.getenv('CI_COMMIT_AUTHOR_EMAIL'),
-                    'message': os.getenv('CI_COMMIT_MESSAGE')
+                    'author_email': os.getenv('DRONE_COMMIT_AUTHOR_EMAIL'),
+                    'message': os.getenv('DRONE_COMMIT_MESSAGE')
                 },
                 'branch': j1['service_branch'],
                 'remotes': [{
                     'name': 'origin',
-                    'url': os.getenv('CI_REPO_REMOTE')
+                    'url': os.getenv('DRONE_GIT_HTTP_URL')
                 }]
             }