Skip to content

Commit

Permalink
server web by yarn serve
Browse files Browse the repository at this point in the history
  • Loading branch information
saw-jan committed Feb 22, 2022
1 parent d61c475 commit f610da6
Showing 1 changed file with 48 additions and 36 deletions.
84 changes: 48 additions & 36 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -725,10 +725,10 @@ def Diff(li1, li2):
return li_dif

def main(ctx):
uiSuitesCheck = checkTestSuites()
if (uiSuitesCheck == False):
print("Errors detected. Review messages above.")
return []
# uiSuitesCheck = checkTestSuites()
# if (uiSuitesCheck == False):
# print("Errors detected. Review messages above.")
# return []

before = beforePipelines(ctx)

Expand All @@ -738,26 +738,27 @@ def main(ctx):
print("Errors detected. Review messages above.")
return []

after = pipelinesDependsOn(afterPipelines(ctx), stages)
# after = pipelinesDependsOn(afterPipelines(ctx), stages)

pipelines = before + stages + after
# pipelines = before + stages + after
pipelines = before + stages

deploys = example_deploys(ctx)
if ctx.build.event != "cron":
# run example deploys on cron even if some prior pipelines fail
deploys = pipelinesDependsOn(deploys, pipelines)
# deploys = example_deploys(ctx)
# if ctx.build.event != "cron":
# # run example deploys on cron even if some prior pipelines fail
# deploys = pipelinesDependsOn(deploys, pipelines)

pipelines = pipelines + deploys + pipelinesDependsOn(
[
purgeBuildArtifactCache(ctx, "yarn"),
purgeBuildArtifactCache(ctx, "playwright"),
purgeBuildArtifactCache(ctx, "tests-yarn"),
purgeBuildArtifactCache(ctx, "web-dist"),
],
pipelines,
)
# pipelines = pipelines + deploys + pipelinesDependsOn(
# [
# purgeBuildArtifactCache(ctx, "yarn"),
# purgeBuildArtifactCache(ctx, "playwright"),
# purgeBuildArtifactCache(ctx, "tests-yarn"),
# purgeBuildArtifactCache(ctx, "web-dist"),
# ],
# pipelines,
# )

pipelineSanityChecks(ctx, pipelines)
# pipelineSanityChecks(ctx, pipelines)
return pipelines

def beforePipelines(ctx):
Expand All @@ -771,10 +772,12 @@ def beforePipelines(ctx):
pipelinesDependsOn(yarnlint(ctx), yarnCache(ctx))

def stagePipelines(ctx):
unit_test_pipelines = unitTests(ctx)
e2e_pipelines = e2eTests(ctx)
# unit_test_pipelines = unitTests(ctx)
# e2e_pipelines = e2eTests(ctx)
acceptance_pipelines = acceptance(ctx)
return unit_test_pipelines + pipelinesDependsOn(e2e_pipelines, unit_test_pipelines) + pipelinesDependsOn(acceptance_pipelines, e2e_pipelines)

# return unit_test_pipelines + pipelinesDependsOn(e2e_pipelines, unit_test_pipelines) + pipelinesDependsOn(acceptance_pipelines, e2e_pipelines)
return acceptance_pipelines

def afterPipelines(ctx):
return build(ctx) + notify()
Expand Down Expand Up @@ -1146,7 +1149,7 @@ def e2eTests(ctx):
],
}]

services = databaseService(db) + owncloudService() + webService()
services = databaseService(db) + owncloudService()

stepsClassic = \
skipIfUnchanged(ctx, "e2e-tests") + \
Expand Down Expand Up @@ -1354,7 +1357,7 @@ def acceptance(ctx):
else:
## Configure oc10 and web with oauth2 and web Service
steps += setUpOauth2(params["oc10IntegrationAppIncluded"], True)
services += webService()
steps += webService()

steps += fixPermissions()
steps += waitForOwncloudService()
Expand Down Expand Up @@ -1992,18 +1995,27 @@ def getSkeletonFiles():
}]

def webService():
return [{
"name": "web",
"image": OC_CI_PHP,
"environment": {
"APACHE_WEBROOT": "%s/dist" % dir["web"],
"APACHE_LOGGING_PATH": "/dev/null",
return [
{
"name": "web",
"image": OC_CI_NODEJS,
# "environment": {
# "APACHE_WEBROOT": "%s/dist" % dir["web"],
# "APACHE_LOGGING_PATH": "/dev/null",
# },
"commands": [
"ls",
"yarn serve",
],
},
"commands": [
"mkdir -p %s/dist" % dir["web"],
"/usr/local/bin/apachectl -D FOREGROUND",
],
}]
{
"name": "wait-for-web-server",
"image": OC_CI_WAIT_FOR,
"commands": [
"wait-for -it web:9100 -t 300",
],
},
]

def setUpOauth2(forIntegrationApp, disableFileLocking):
oidcURL = ""
Expand Down

0 comments on commit f610da6

Please sign in to comment.