github.com/cs3org/reva/v2@v2.27.7/.drone.star (about)

     1  # images
     2  OC_CI_GOLANG = "owncloudci/golang:1.22"
     3  OC_CI_ALPINE = "owncloudci/alpine:latest"
     4  OSIXIA_OPEN_LDAP = "osixia/openldap:1.3.0"
     5  REDIS = "redis:6-alpine"
     6  OC_CI_PHP = "cs3org/behat:latest"
     7  OC_LITMUS = "owncloud/litmus:latest"
     8  OC_CS3_API_VALIDATOR = "owncloud/cs3api-validator:0.2.1"
     9  OC_CI_BAZEL_BUILDIFIER = "owncloudci/bazel-buildifier:latest"
    10  
    11  # Shared step definitions
    12  def licenseScanStep():
    13      return {
    14          "name": "license-scan",
    15          "image": OC_CI_GOLANG,
    16          "environment": {
    17              "FOSSA_API_KEY": {
    18                  "from_secret": "fossa_api_key",
    19              },
    20          },
    21          "detach": True,
    22          "commands": [
    23              "wget -qO- https://github.com/fossas/fossa-cli/releases/download/v1.0.11/fossa-cli_1.0.11_linux_amd64.tar.gz | tar xvz -C /go/bin/",
    24              "/go/bin/fossa analyze",
    25          ],
    26      }
    27  
    28  def makeStep(target):
    29      return {
    30          "name": "build",
    31          "image": OC_CI_GOLANG,
    32          "environment": {
    33              "HTTP_PROXY": {
    34                  "from_secret": "drone_http_proxy",
    35              },
    36              "HTTPS_PROXY": {
    37                  "from_secret": "drone_http_proxy",
    38              },
    39          },
    40          "commands": [
    41              "make %s" % target,
    42          ],
    43      }
    44  
    45  def cloneApiTestReposStep():
    46      return {
    47          "name": "clone-api-test-repos",
    48          "image": OC_CI_ALPINE,
    49          "commands": [
    50              "source /drone/src/.drone.env",
    51              "git clone -b master --depth=1 https://github.com/owncloud/testing.git /drone/src/tmp/testing",
    52              "git clone -b $APITESTS_BRANCH --single-branch --no-tags $APITESTS_REPO_GIT_URL /drone/src/tmp/testrunner",
    53              "cd /drone/src/tmp/testrunner",
    54              "git checkout $APITESTS_COMMITID",
    55          ],
    56      }
    57  
    58  # Shared service definitions
    59  def ldapService():
    60      return {
    61          "name": "ldap",
    62          "image": OSIXIA_OPEN_LDAP,
    63          "pull": "always",
    64          "environment": {
    65              "LDAP_DOMAIN": "owncloud.com",
    66              "LDAP_ORGANISATION": "ownCloud",
    67              "LDAP_ADMIN_PASSWORD": "admin",
    68              "LDAP_TLS_VERIFY_CLIENT": "never",
    69              "HOSTNAME": "ldap",
    70          },
    71      }
    72  
    73  def redisService():
    74      return {
    75          "name": "redis",
    76          "image": REDIS,
    77          "pull": "always",
    78          "environment": {
    79              "REDIS_DATABASES": 1,
    80          },
    81      }
    82  
    83  def cephService():
    84      return {
    85          "name": "ceph",
    86          "image": "ceph/daemon",
    87          "pull": "always",
    88          "environment": {
    89              "CEPH_DAEMON": "demo",
    90              "NETWORK_AUTO_DETECT": "4",
    91              "MON_IP": "0.0.0.0",
    92              "CEPH_PUBLIC_NETWORK": "0.0.0.0/0",
    93              "RGW_CIVETWEB_PORT": "4000 ",
    94              "RGW_NAME": "ceph",
    95              "CEPH_DEMO_UID": "test-user",
    96              "CEPH_DEMO_ACCESS_KEY": "test",
    97              "CEPH_DEMO_SECRET_KEY": "test",
    98              "CEPH_DEMO_BUCKET": "test",
    99          },
   100      }
   101  
   102  # Pipeline definitions
   103  def main(ctx):
   104      # In order to run specific parts only, specify the parts as
   105      # ocisIntegrationTests(6, [1, 4])     - this will only run 1st and 4th parts
   106      # implemented for: ocisIntegrationTests, posixfsIntegrationTests and s3ngIntegrationTests
   107      return [
   108          checkStarlark(),
   109          checkGoGenerate(),
   110          coverage(),
   111          buildOnly(),
   112          testIntegration(),
   113          litmusOcisOldWebdav(),
   114          litmusOcisNewWebdav(),
   115          litmusOcisSpacesDav(),
   116          cs3ApiValidatorOcis(),
   117          cs3ApiValidatorS3NG(),
   118          # virtual views don't work on edge at the moment
   119          #virtualViews(),
   120      ] + ocisIntegrationTests(4) + s3ngIntegrationTests(6) + posixfsIntegrationTests(4)
   121  
   122  def coverage():
   123      return {
   124          "kind": "pipeline",
   125          "type": "docker",
   126          "name": "unit-test-coverage",
   127          "platform": {
   128              "os": "linux",
   129              "arch": "amd64",
   130          },
   131          "trigger": {
   132              "ref": [
   133                  "refs/heads/master",
   134                  "refs/heads/edge",
   135                  "refs/pull/**",
   136              ],
   137          },
   138          "steps": [
   139              {
   140                  "name": "unit-test",
   141                  "image": OC_CI_GOLANG,
   142                  "environment": {
   143                      "HTTP_PROXY": {
   144                          "from_secret": "drone_http_proxy",
   145                      },
   146                      "HTTPS_PROXY": {
   147                          "from_secret": "drone_http_proxy",
   148                      },
   149                  },
   150                  "commands": [
   151                      "make test",
   152                  ],
   153              },
   154          ],
   155          "depends_on": [],
   156      }
   157  
   158  def buildOnly():
   159      return {
   160          "kind": "pipeline",
   161          "type": "docker",
   162          "name": "build-only",
   163          "platform": {
   164              "os": "linux",
   165              "arch": "amd64",
   166          },
   167          "trigger": {
   168              "ref": [
   169                  "refs/heads/master",
   170                  "refs/heads/edge",
   171                  "refs/pull/**",
   172              ],
   173          },
   174          "steps": [
   175              makeStep("dist"),
   176          ],
   177          "depends_on": ["unit-test-coverage"],
   178      }
   179  
   180  def testIntegration():
   181      return {
   182          "kind": "pipeline",
   183          "type": "docker",
   184          "name": "test-integration",
   185          "platform": {
   186              "os": "linux",
   187              "arch": "amd64",
   188          },
   189          "trigger": {
   190              "ref": [
   191                  "refs/heads/master",
   192                  "refs/heads/edge",
   193                  "refs/pull/**",
   194              ],
   195          },
   196          "steps": [
   197              {
   198                  "name": "test",
   199                  "image": OC_CI_GOLANG,
   200                  "commands": [
   201                      "make test-integration",
   202                  ],
   203                  "environment": {
   204                      "REDIS_ADDRESS": "redis:6379",
   205                      "HTTP_PROXY": {
   206                          "from_secret": "drone_http_proxy",
   207                      },
   208                      "HTTPS_PROXY": {
   209                          "from_secret": "drone_http_proxy",
   210                      },
   211                  },
   212              },
   213          ],
   214          "services": [
   215              redisService(),
   216          ],
   217          "depends_on": ["unit-test-coverage"],
   218      }
   219  
   220  def virtualViews():
   221      return {
   222          "kind": "pipeline",
   223          "type": "docker",
   224          "name": "virtual-views",
   225          "platform": {
   226              "os": "linux",
   227              "arch": "amd64",
   228          },
   229          "trigger": {
   230              "ref": [
   231                  "refs/heads/master",
   232                  "refs/heads/edge",
   233                  "refs/pull/**",
   234              ],
   235          },
   236          "steps": [
   237              makeStep("build-ci"),
   238              {
   239                  "name": "revad-services",
   240                  "image": OC_CI_GOLANG,
   241                  "detach": True,
   242                  "commands": [
   243                      "cd /drone/src/tests/oc-integration-tests/drone/",
   244                      "/drone/src/cmd/revad/revad -c frontend-global.toml &",
   245                      "/drone/src/cmd/revad/revad -c gateway.toml &",
   246                      "/drone/src/cmd/revad/revad -c storage-home-ocis.toml &",
   247                      "/drone/src/cmd/revad/revad -c storage-local-1.toml &",
   248                      "/drone/src/cmd/revad/revad -c storage-local-2.toml &",
   249                      "/drone/src/cmd/revad/revad -c users.toml",
   250                  ],
   251              },
   252              cloneApiTestReposStep(),
   253              {
   254                  "name": "APIAcceptanceTestsOcisStorage",
   255                  "image": OC_CI_PHP,
   256                  "commands": [
   257                      "cd /drone/src/tmp/testrunner",
   258                      "make test-acceptance-api",
   259                  ],
   260                  "environment": {
   261                      "TEST_SERVER_URL": "http://revad-services:20180",
   262                      "OCIS_REVA_DATA_ROOT": "/drone/src/tmp/reva/data/",
   263                      "DELETE_USER_DATA_CMD": "rm -rf /drone/src/tmp/reva/data/spaces/* /drone/src/tmp/reva/data/blobs/* /drone/src/tmp/reva/data/indexes",
   264                      "STORAGE_DRIVER": "OCIS",
   265                      "TEST_REVA": "true",
   266                      "REGULAR_USER_PASSWORD": "relativity",
   267                      "SEND_SCENARIO_LINE_REFERENCES": "true",
   268                      "BEHAT_SUITE": "apiVirtualViews",
   269                      "ACCEPTANCE_TEST_TYPE": "core-api",
   270                  },
   271              },
   272          ],
   273          "depends_on": ["unit-test-coverage"],
   274      }
   275  
   276  def litmusOcisOldWebdav():
   277      return {
   278          "kind": "pipeline",
   279          "type": "docker",
   280          "name": "litmus-ocis-old-webdav",
   281          "platform": {
   282              "os": "linux",
   283              "arch": "amd64",
   284          },
   285          "trigger": {
   286              "ref": [
   287                  "refs/heads/master",
   288                  "refs/heads/edge",
   289                  "refs/pull/**",
   290              ],
   291          },
   292          "steps": [
   293              makeStep("build-ci"),
   294              {
   295                  "name": "revad-services",
   296                  "image": OC_CI_GOLANG,
   297                  "detach": True,
   298                  "commands": [
   299                      "cd /drone/src/tests/oc-integration-tests/drone/",
   300                      "/drone/src/cmd/revad/revad -c frontend.toml &",
   301                      "/drone/src/cmd/revad/revad -c gateway.toml &",
   302                      "/drone/src/cmd/revad/revad -c storage-users-ocis.toml &",
   303                      "/drone/src/cmd/revad/revad -c storage-shares.toml &",
   304                      "/drone/src/cmd/revad/revad -c storage-publiclink.toml &",
   305                      "/drone/src/cmd/revad/revad -c shares.toml &",
   306                      "/drone/src/cmd/revad/revad -c permissions-ocis-ci.toml &",
   307                      "/drone/src/cmd/revad/revad -c users.toml",
   308                  ],
   309              },
   310              {
   311                  "name": "sleep-for-revad-start",
   312                  "image": OC_CI_GOLANG,
   313                  "commands": [
   314                      "sleep 5",
   315                  ],
   316              },
   317              {
   318                  "name": "litmus-ocis-old-webdav",
   319                  "image": OC_LITMUS,
   320                  "environment": {
   321                      "LITMUS_URL": "http://revad-services:20080/remote.php/webdav",
   322                      "LITMUS_USERNAME": "einstein",
   323                      "LITMUS_PASSWORD": "relativity",
   324                      "TESTS": "basic http copymove props",
   325                  },
   326              },
   327          ],
   328          "depends_on": ["unit-test-coverage"],
   329      }
   330  
   331  def litmusOcisNewWebdav():
   332      return {
   333          "kind": "pipeline",
   334          "type": "docker",
   335          "name": "litmus-ocis-new-webdav",
   336          "platform": {
   337              "os": "linux",
   338              "arch": "amd64",
   339          },
   340          "trigger": {
   341              "ref": [
   342                  "refs/heads/master",
   343                  "refs/heads/edge",
   344                  "refs/pull/**",
   345              ],
   346          },
   347          "steps": [
   348              makeStep("build-ci"),
   349              {
   350                  "name": "revad-services",
   351                  "image": OC_CI_GOLANG,
   352                  "detach": True,
   353                  "commands": [
   354                      "cd /drone/src/tests/oc-integration-tests/drone/",
   355                      "/drone/src/cmd/revad/revad -c frontend.toml &",
   356                      "/drone/src/cmd/revad/revad -c gateway.toml &",
   357                      "/drone/src/cmd/revad/revad -c storage-users-ocis.toml &",
   358                      "/drone/src/cmd/revad/revad -c storage-shares.toml &",
   359                      "/drone/src/cmd/revad/revad -c storage-publiclink.toml &",
   360                      "/drone/src/cmd/revad/revad -c shares.toml &",
   361                      "/drone/src/cmd/revad/revad -c permissions-ocis-ci.toml &",
   362                      "/drone/src/cmd/revad/revad -c users.toml",
   363                  ],
   364              },
   365              {
   366                  "name": "sleep-for-revad-start",
   367                  "image": OC_CI_GOLANG,
   368                  "commands": [
   369                      "sleep 5",
   370                  ],
   371              },
   372              {
   373                  "name": "litmus-ocis-new-webdav",
   374                  "image": OC_LITMUS,
   375                  "environment": {
   376                      # UUID is einstein user, see https://github.com/owncloud/ocis-accounts/blob/8de0530f31ed5ffb0bbb7f7f3471f87f429cb2ea/pkg/service/v0/service.go#L45
   377                      "LITMUS_URL": "http://revad-services:20080/remote.php/dav/files/4c510ada-c86b-4815-8820-42cdf82c3d51",
   378                      "LITMUS_USERNAME": "einstein",
   379                      "LITMUS_PASSWORD": "relativity",
   380                      "TESTS": "basic http copymove props",
   381                  },
   382              },
   383          ],
   384          "depends_on": ["unit-test-coverage"],
   385      }
   386  
   387  def litmusOcisSpacesDav():
   388      return {
   389          "kind": "pipeline",
   390          "type": "docker",
   391          "name": "litmus-owncloud-spaces-dav",
   392          "platform": {
   393              "os": "linux",
   394              "arch": "amd64",
   395          },
   396          "trigger": {
   397              "ref": [
   398                  "refs/heads/master",
   399                  "refs/heads/edge",
   400                  "refs/pull/**",
   401              ],
   402          },
   403          "steps": [
   404              makeStep("build-ci"),
   405              {
   406                  "name": "revad-services",
   407                  "image": OC_CI_GOLANG,
   408                  "detach": True,
   409                  "commands": [
   410                      "cd /drone/src/tests/oc-integration-tests/drone/",
   411                      "/drone/src/cmd/revad/revad -c frontend.toml &",
   412                      "/drone/src/cmd/revad/revad -c gateway.toml &",
   413                      "/drone/src/cmd/revad/revad -c storage-users-ocis.toml &",
   414                      "/drone/src/cmd/revad/revad -c storage-shares.toml &",
   415                      "/drone/src/cmd/revad/revad -c storage-publiclink.toml &",
   416                      "/drone/src/cmd/revad/revad -c shares.toml &",
   417                      "/drone/src/cmd/revad/revad -c permissions-ocis-ci.toml &",
   418                      "/drone/src/cmd/revad/revad -c users.toml",
   419                  ],
   420              },
   421              {
   422                  "name": "sleep-for-revad-start",
   423                  "image": OC_CI_GOLANG,
   424                  "commands": [
   425                      "sleep 5",
   426                  ],
   427              },
   428              {
   429                  "name": "litmus-owncloud-spaces-dav",
   430                  "image": OC_LITMUS,
   431                  "environment": {
   432                      "LITMUS_USERNAME": "einstein",
   433                      "LITMUS_PASSWORD": "relativity",
   434                      "TESTS": "basic http copymove props",
   435                  },
   436                  "commands": [
   437                      # The spaceid is randomly generated during the first login so we need this hack to construct the correct url.
   438                      "curl -s -k -u einstein:relativity -I http://revad-services:20080/remote.php/dav/files/einstein",
   439                      "export SPACE_ID=$(curl -XPROPFIND -s -k -u einstein:relativity 'http://revad-services:20080/dav/files/einstein' | awk -F '<.?oc:spaceid>' '{ print $2 }')",
   440                      "export LITMUS_URL=http://revad-services:20080/remote.php/dav/spaces/$SPACE_ID",
   441                      "/usr/local/bin/litmus-wrapper",
   442                  ],
   443              },
   444          ],
   445          "depends_on": ["unit-test-coverage"],
   446      }
   447  
   448  def cs3ApiValidatorOcis():
   449      return {
   450          "kind": "pipeline",
   451          "type": "docker",
   452          "name": "cs3api-validator-ocis",
   453          "platform": {
   454              "os": "linux",
   455              "arch": "amd64",
   456          },
   457          "trigger": {
   458              "ref": [
   459                  "refs/heads/master",
   460                  "refs/heads/edge",
   461                  "refs/pull/**",
   462              ],
   463          },
   464          "steps": [
   465              makeStep("build-ci"),
   466              {
   467                  "name": "revad-services",
   468                  "image": OC_CI_GOLANG,
   469                  "detach": True,
   470                  "commands": [
   471                      "cd /drone/src/tests/oc-integration-tests/drone/",
   472                      "/drone/src/cmd/revad/revad -c frontend.toml &",
   473                      "/drone/src/cmd/revad/revad -c gateway.toml &",
   474                      "/drone/src/cmd/revad/revad -c storage-users-ocis.toml &",
   475                      "/drone/src/cmd/revad/revad -c storage-shares.toml &",
   476                      "/drone/src/cmd/revad/revad -c storage-publiclink.toml &",
   477                      "/drone/src/cmd/revad/revad -c shares.toml &",
   478                      "/drone/src/cmd/revad/revad -c permissions-ocis-ci.toml &",
   479                      "/drone/src/cmd/revad/revad -c users.toml",
   480                  ],
   481              },
   482              {
   483                  "name": "sleep-for-revad-start",
   484                  "image": OC_CI_GOLANG,
   485                  "commands": [
   486                      "sleep 5",
   487                  ],
   488              },
   489              {
   490                  "name": "cs3api-validator-ocis",
   491                  "image": OC_CS3_API_VALIDATOR,
   492                  "commands": [
   493                      "/usr/bin/cs3api-validator /var/lib/cs3api-validator --endpoint=revad-services:19000",
   494                  ],
   495              },
   496          ],
   497          "depends_on": ["unit-test-coverage"],
   498      }
   499  
   500  def cs3ApiValidatorS3NG():
   501      return {
   502          "kind": "pipeline",
   503          "type": "docker",
   504          "name": "cs3api-validator-S3NG",
   505          "platform": {
   506              "os": "linux",
   507              "arch": "amd64",
   508          },
   509          "trigger": {
   510              "ref": [
   511                  "refs/heads/master",
   512                  "refs/heads/edge",
   513                  "refs/pull/**",
   514              ],
   515          },
   516          "steps": [
   517              makeStep("build-ci"),
   518              {
   519                  "name": "revad-services",
   520                  "image": OC_CI_GOLANG,
   521                  "detach": True,
   522                  "commands": [
   523                      "cd /drone/src/tests/oc-integration-tests/drone/",
   524                      "/drone/src/cmd/revad/revad -c frontend.toml &",
   525                      "/drone/src/cmd/revad/revad -c gateway.toml &",
   526                      "/drone/src/cmd/revad/revad -c storage-users-s3ng.toml &",
   527                      "/drone/src/cmd/revad/revad -c storage-shares.toml &",
   528                      "/drone/src/cmd/revad/revad -c storage-publiclink.toml &",
   529                      "/drone/src/cmd/revad/revad -c shares.toml &",
   530                      "/drone/src/cmd/revad/revad -c permissions-ocis-ci.toml &",
   531                      "/drone/src/cmd/revad/revad -c users.toml",
   532                  ],
   533              },
   534              {
   535                  "name": "sleep-for-revad-start",
   536                  "image": OC_CI_GOLANG,
   537                  "commands": [
   538                      "sleep 5",
   539                  ],
   540              },
   541              {
   542                  "name": "cs3api-validator-S3NG",
   543                  "image": OC_CS3_API_VALIDATOR,
   544                  "commands": [
   545                      "/usr/bin/cs3api-validator /var/lib/cs3api-validator --endpoint=revad-services:19000",
   546                  ],
   547              },
   548          ],
   549          "services": [
   550              cephService(),
   551          ],
   552          "depends_on": ["unit-test-coverage"],
   553      }
   554  
   555  def ocisIntegrationTests(parallelRuns, skipExceptParts = []):
   556      pipelines = []
   557      debugPartsEnabled = (len(skipExceptParts) != 0)
   558      for runPart in range(1, parallelRuns + 1):
   559          if debugPartsEnabled and runPart not in skipExceptParts:
   560              continue
   561  
   562          pipelines.append(
   563              {
   564                  "kind": "pipeline",
   565                  "type": "docker",
   566                  "name": "ocis-integration-tests-%s" % runPart,
   567                  "platform": {
   568                      "os": "linux",
   569                      "arch": "amd64",
   570                  },
   571                  "trigger": {
   572                      "ref": [
   573                          "refs/heads/master",
   574                          "refs/heads/edge",
   575                          "refs/pull/**",
   576                      ],
   577                  },
   578                  "steps": [
   579                      makeStep("build-ci"),
   580                      {
   581                          "name": "revad-services",
   582                          "image": OC_CI_GOLANG,
   583                          "detach": True,
   584                          "commands": [
   585                              "cd /drone/src/tests/oc-integration-tests/drone/",
   586                              "/drone/src/cmd/revad/revad -c frontend.toml &",
   587                              "/drone/src/cmd/revad/revad -c gateway.toml &",
   588                              "/drone/src/cmd/revad/revad -c shares.toml &",
   589                              "/drone/src/cmd/revad/revad -c storage-shares.toml &",
   590                              "/drone/src/cmd/revad/revad -c machine-auth.toml &",
   591                              "/drone/src/cmd/revad/revad -c storage-users-ocis.toml &",
   592                              "/drone/src/cmd/revad/revad -c storage-publiclink.toml &",
   593                              "/drone/src/cmd/revad/revad -c permissions-ocis-ci.toml &",
   594                              "/drone/src/cmd/revad/revad -c ldap-users.toml",
   595                          ],
   596                      },
   597                      cloneApiTestReposStep(),
   598                      {
   599                          "name": "APIAcceptanceTestsOcisStorage",
   600                          "image": OC_CI_PHP,
   601                          "commands": [
   602                              "cd /drone/src/tmp/testrunner",
   603                              "make test-acceptance-api",
   604                          ],
   605                          "environment": {
   606                              "TEST_SERVER_URL": "http://revad-services:20080",
   607                              "OCIS_REVA_DATA_ROOT": "/drone/src/tmp/reva/data/",
   608                              "DELETE_USER_DATA_CMD": "rm -rf /drone/src/tmp/reva/data/spaces/* /drone/src/tmp/reva/data/blobs/* /drone/src/tmp/reva/data/indexes/by-type/*",
   609                              "STORAGE_DRIVER": "OCIS",
   610                              "TEST_WITH_LDAP": "true",
   611                              "REVA_LDAP_HOSTNAME": "ldap",
   612                              "TEST_REVA": "true",
   613                              "SEND_SCENARIO_LINE_REFERENCES": "true",
   614                              "BEHAT_FILTER_TAGS": "~@skip&&~@skipOnReva&&~@env-config",
   615                              "DIVIDE_INTO_NUM_PARTS": parallelRuns,
   616                              "RUN_PART": runPart,
   617                              "EXPECTED_FAILURES_FILE": "/drone/src/tests/acceptance/expected-failures-on-OCIS-storage.md",
   618                              "ACCEPTANCE_TEST_TYPE": "core-api",
   619                          },
   620                      },
   621                  ],
   622                  "services": [
   623                      ldapService(),
   624                  ],
   625                  "depends_on": ["unit-test-coverage"],
   626              },
   627          )
   628  
   629      return pipelines
   630  
   631  def s3ngIntegrationTests(parallelRuns, skipExceptParts = []):
   632      pipelines = []
   633      debugPartsEnabled = (len(skipExceptParts) != 0)
   634      for runPart in range(1, parallelRuns + 1):
   635          if debugPartsEnabled and runPart not in skipExceptParts:
   636              continue
   637  
   638          pipelines.append(
   639              {
   640                  "kind": "pipeline",
   641                  "type": "docker",
   642                  "name": "s3ng-integration-tests-%s" % runPart,
   643                  "platform": {
   644                      "os": "linux",
   645                      "arch": "amd64",
   646                  },
   647                  "trigger": {
   648                      "ref": [
   649                          "refs/heads/master",
   650                          "refs/heads/edge",
   651                          "refs/pull/**",
   652                      ],
   653                  },
   654                  "steps": [
   655                      makeStep("build-ci"),
   656                      {
   657                          "name": "revad-services",
   658                          "image": OC_CI_GOLANG,
   659                          "detach": True,
   660                          "commands": [
   661                              "cd /drone/src/tests/oc-integration-tests/drone/",
   662                              "/drone/src/cmd/revad/revad -c frontend.toml &",
   663                              "/drone/src/cmd/revad/revad -c gateway.toml &",
   664                              "/drone/src/cmd/revad/revad -c shares.toml &",
   665                              "/drone/src/cmd/revad/revad -c storage-users-s3ng.toml &",
   666                              "/drone/src/cmd/revad/revad -c storage-publiclink.toml &",
   667                              "/drone/src/cmd/revad/revad -c storage-shares.toml &",
   668                              "/drone/src/cmd/revad/revad -c ldap-users.toml &",
   669                              "/drone/src/cmd/revad/revad -c permissions-ocis-ci.toml &",
   670                              "/drone/src/cmd/revad/revad -c machine-auth.toml",
   671                          ],
   672                      },
   673                      cloneApiTestReposStep(),
   674                      {
   675                          "name": "APIAcceptanceTestsS3ngStorage",
   676                          "image": OC_CI_PHP,
   677                          "commands": [
   678                              "cd /drone/src/tmp/testrunner",
   679                              "make test-acceptance-api",
   680                          ],
   681                          "environment": {
   682                              "TEST_SERVER_URL": "http://revad-services:20080",
   683                              "OCIS_REVA_DATA_ROOT": "/drone/src/tmp/reva/data/",
   684                              "DELETE_USER_DATA_CMD": "rm -rf /drone/src/tmp/reva/data/spaces/* /drone/src/tmp/reva/data/blobs/* /drone/src/tmp/reva/data/indexes/by-type/*",
   685                              "STORAGE_DRIVER": "S3NG",
   686                              "TEST_WITH_LDAP": "true",
   687                              "REVA_LDAP_HOSTNAME": "ldap",
   688                              "TEST_REVA": "true",
   689                              "SEND_SCENARIO_LINE_REFERENCES": "true",
   690                              "BEHAT_FILTER_TAGS": "~@skip&&~@skipOnReva&&~@env-config",
   691                              "DIVIDE_INTO_NUM_PARTS": parallelRuns,
   692                              "RUN_PART": runPart,
   693                              "EXPECTED_FAILURES_FILE": "/drone/src/tests/acceptance/expected-failures-on-S3NG-storage.md",
   694                              "ACCEPTANCE_TEST_TYPE": "core-api",
   695                          },
   696                      },
   697                  ],
   698                  "services": [
   699                      ldapService(),
   700                      cephService(),
   701                  ],
   702                  "depends_on": ["unit-test-coverage"],
   703              },
   704          )
   705  
   706      return pipelines
   707  
   708  def posixfsIntegrationTests(parallelRuns, skipExceptParts = []):
   709      pipelines = []
   710      debugPartsEnabled = (len(skipExceptParts) != 0)
   711      for runPart in range(1, parallelRuns + 1):
   712          if debugPartsEnabled and runPart not in skipExceptParts:
   713              continue
   714  
   715          pipelines.append(
   716              {
   717                  "kind": "pipeline",
   718                  "type": "docker",
   719                  "name": "posixfs-integration-tests-%s" % runPart,
   720                  "platform": {
   721                      "os": "linux",
   722                      "arch": "amd64",
   723                  },
   724                  "trigger": {
   725                      "ref": [
   726                          "refs/heads/master",
   727                          "refs/heads/edge",
   728                          "refs/pull/**",
   729                      ],
   730                  },
   731                  "steps": [
   732                      makeStep("build-ci"),
   733                      {
   734                          "name": "revad-services",
   735                          "image": OC_CI_GOLANG,
   736                          "detach": True,
   737                          "commands": [
   738                              "cd /drone/src/tests/oc-integration-tests/drone/",
   739                              "/drone/src/cmd/revad/revad -c frontend.toml &",
   740                              "/drone/src/cmd/revad/revad -c gateway.toml &",
   741                              "/drone/src/cmd/revad/revad -c shares.toml &",
   742                              "/drone/src/cmd/revad/revad -c storage-shares.toml &",
   743                              "/drone/src/cmd/revad/revad -c machine-auth.toml &",
   744                              "/drone/src/cmd/revad/revad -c storage-users-posixfs.toml &",
   745                              "/drone/src/cmd/revad/revad -c storage-publiclink.toml &",
   746                              "/drone/src/cmd/revad/revad -c permissions-ocis-ci.toml &",
   747                              "/drone/src/cmd/revad/revad -c ldap-users.toml",
   748                          ],
   749                      },
   750                      cloneApiTestReposStep(),
   751                      {
   752                          "name": "APIAcceptanceTestsPosixStorage",
   753                          "image": OC_CI_PHP,
   754                          "commands": [
   755                              "cd /drone/src/tmp/testrunner",
   756                              "make test-acceptance-api",
   757                          ],
   758                          "environment": {
   759                              "TEST_SERVER_URL": "http://revad-services:20080",
   760                              "OCIS_REVA_DATA_ROOT": "/drone/src/tmp/reva/data/",
   761                              "DELETE_USER_DATA_CMD": "bash -cx 'rm -rf /drone/src/tmp/reva/data/users/* /drone/src/tmp/reva/data/indexes/by-type/*'",
   762                              "STORAGE_DRIVER": "POSIX",
   763                              "TEST_WITH_LDAP": "true",
   764                              "REVA_LDAP_HOSTNAME": "ldap",
   765                              "TEST_REVA": "true",
   766                              "SEND_SCENARIO_LINE_REFERENCES": "true",
   767                              "BEHAT_FILTER_TAGS": "~@skip&&~@skipOnReva&&~@env-config",
   768                              "DIVIDE_INTO_NUM_PARTS": parallelRuns,
   769                              "RUN_PART": runPart,
   770                              "EXPECTED_FAILURES_FILE": "/drone/src/tests/acceptance/expected-failures-on-POSIX-storage.md",
   771                              "ACCEPTANCE_TEST_TYPE": "core-api",
   772                          },
   773                      },
   774                  ],
   775                  "services": [
   776                      redisService(),
   777                      ldapService(),
   778                  ],
   779                  "depends_on": ["unit-test-coverage"],
   780              },
   781          )
   782  
   783      return pipelines
   784  
   785  def checkStarlark():
   786      return {
   787          "kind": "pipeline",
   788          "type": "docker",
   789          "name": "check-starlark",
   790          "steps": [
   791              {
   792                  "name": "format-check-starlark",
   793                  "image": OC_CI_BAZEL_BUILDIFIER,
   794                  "commands": [
   795                      "buildifier --mode=check .drone.star",
   796                  ],
   797              },
   798              {
   799                  "name": "show-diff",
   800                  "image": OC_CI_BAZEL_BUILDIFIER,
   801                  "commands": [
   802                      "buildifier --mode=fix .drone.star",
   803                      "git diff",
   804                  ],
   805                  "when": {
   806                      "status": [
   807                          "failure",
   808                      ],
   809                  },
   810              },
   811          ],
   812          "depends_on": [],
   813          "trigger": {
   814              "ref": [
   815                  "refs/pull/**",
   816              ],
   817          },
   818      }
   819  
   820  def checkGoGenerate():
   821      return {
   822          "kind": "pipeline",
   823          "type": "docker",
   824          "name": "check-go-generate",
   825          "steps": [
   826              {
   827                  "name": "check-go-generate",
   828                  "image": OC_CI_GOLANG,
   829                  "environment": {
   830                      "HTTP_PROXY": {
   831                          "from_secret": "drone_http_proxy",
   832                      },
   833                      "HTTPS_PROXY": {
   834                          "from_secret": "drone_http_proxy",
   835                      },
   836                  },
   837                  "commands": [
   838                      "make go-generate",
   839                      "git diff --exit-code",
   840                  ],
   841              },
   842          ],
   843          "depends_on": [],
   844          "trigger": {
   845              "ref": [
   846                  "refs/heads/master",
   847                  "refs/heads/edge",
   848                  "refs/pull/**",
   849              ],
   850          },
   851      }