Skip to content

Commit

Permalink
fix volumes
Browse files Browse the repository at this point in the history
  • Loading branch information
wkloucek committed Dec 1, 2020
1 parent 85e5350 commit 3a6c96b
Showing 1 changed file with 30 additions and 27 deletions.
57 changes: 30 additions & 27 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ def localApiTests(ctx, coreBranch = 'master', coreCommit = '', storage = 'ownclo
},
'steps':
restoreBuildArtifactCache(ctx, 'ocis-binary-amd64', 'ocis/bin/ocis') +
ocisServer(storage, accounts_hash_difficulty) +
ocisServer(storage, accounts_hash_difficulty, [stepVolumeOC10Tests]) +
cloneCoreRepos(coreBranch, coreCommit) + [
{
'name': 'localApiTests-%s-%s' % (suite, storage),
Expand Down Expand Up @@ -467,7 +467,7 @@ def coreApiTests(ctx, coreBranch = 'master', coreCommit = '', part_number = 1, n
},
'steps':
restoreBuildArtifactCache(ctx, 'ocis-binary-amd64', 'ocis/bin/ocis') +
ocisServer(storage, accounts_hash_difficulty) +
ocisServer(storage, accounts_hash_difficulty, [stepVolumeOC10Tests]) +
cloneCoreRepos(coreBranch, coreCommit) + [
{
'name': 'oC10ApiTests-%s-storage-%s' % (storage, part_number),
Expand Down Expand Up @@ -528,7 +528,7 @@ def uiTestPipeline(ctx, suiteName, phoenixBranch = 'master', phoenixCommit = '',
},
'steps':
restoreBuildArtifactCache(ctx, 'ocis-binary-amd64', 'ocis/bin/ocis') +
ocisServer(storage, accounts_hash_difficulty) + [
ocisServer(storage, accounts_hash_difficulty, [stepVolumeOC10Tests]) + [
{
'name': 'webUITests',
'image': 'owncloudci/nodejs:11',
Expand Down Expand Up @@ -556,21 +556,23 @@ def uiTestPipeline(ctx, suiteName, phoenixBranch = 'master', phoenixCommit = '',
'yarn install-all',
'yarn run acceptance-tests-drone'
],
'volumes': [{
'name': 'uploads',
'path': '/uploads'
}]
'volumes':
[stepVolumeOC10Tests] +
[{
'name': 'uploads',
'path': '/uploads'
}]
},
],
'services':
redis() +
selenium(),
'volumes': [
{
'volumes':
[pipelineVolumeOC10Tests] +
[{
'name': 'uploads',
'temp': {}
}
],
}],
'depends_on': getPipelineNames([buildOcisBinaryForTesting(ctx)]),
'trigger': {
'ref': [
Expand All @@ -592,7 +594,7 @@ def accountsUITests(ctx, phoenixBranch, phoenixCommit, storage = 'owncloud', acc
},
'steps':
restoreBuildArtifactCache(ctx, 'ocis-binary-amd64', 'ocis/bin/ocis') +
ocisServer(storage, accounts_hash_difficulty) + [
ocisServer(storage, accounts_hash_difficulty, [stepVolumeOC10Tests]) + [
{
'name': 'WebUIAcceptanceTests',
'image': 'owncloudci/nodejs:11',
Expand Down Expand Up @@ -623,10 +625,12 @@ def accountsUITests(ctx, phoenixBranch, phoenixCommit, storage = 'owncloud', acc
'yarn install --all',
'make test-acceptance-webui'
],
'volumes': [{
'name': 'uploads',
'path': '/uploads'
}],
'volumes':
[stepVolumeOC10Tests] +
[{
'name': 'uploads',
'path': '/uploads'
}]
},
],
'services': [
Expand All @@ -650,12 +654,12 @@ def accountsUITests(ctx, phoenixBranch, phoenixCommit, storage = 'owncloud', acc
],
},
],
'volumes': [
{
'volumes':
[stepVolumeOC10Tests] +
[{
'name': 'uploads',
'temp': {}
}
],
}],
'depends_on': getPipelineNames([buildOcisBinaryForTesting(ctx)]),
'trigger': {
'ref': [
Expand Down Expand Up @@ -1039,15 +1043,15 @@ def changelog(ctx):
},
{
'name': 'diff',
'image': 'owncloud/alpine:latest',
'image': 'owncloudci/alpine:latest',
'pull': 'always',
'commands': [
'git diff',
],
},
{
'name': 'output',
'image': 'owncloud/alpine:latest',
'image': 'owncloudci/alpine:latest',
'pull': 'always',
'commands': [
'cat CHANGELOG.md',
Expand Down Expand Up @@ -1271,7 +1275,7 @@ def updateDeployment(ctx):
'steps': [
{
'name': 'webhook',
'image': 'plugins/webhook',
'image': 'plugins/webhook:1',
'settings': {
'username': {
'from_secret': 'webhook_username',
Expand Down Expand Up @@ -1347,7 +1351,7 @@ def frontend(module):
}
]

def ocisServer(storage, accounts_hash_difficulty = 4):
def ocisServer(storage, accounts_hash_difficulty = 4, volumes=[]):
environment = {
#'OCIS_LOG_LEVEL': 'debug',
'STORAGE_HOME_DRIVER': '%s' % (storage),
Expand Down Expand Up @@ -1383,16 +1387,15 @@ def ocisServer(storage, accounts_hash_difficulty = 4):
return [
{
'name': 'ocis-server',
'image': 'webhippie/golang:1.14',
'image': 'owncloudci/alpine:latest',
'pull': 'always',
'detach': True,
'environment' : environment,
'commands': [
'apk add mailcap', # install /etc/mime.types
'mkdir -p /srv/app/tmp/ocis/owncloud/data/',
'mkdir -p /srv/app/tmp/ocis/storage/users/',
'ocis/bin/ocis server'
],
'volumes': volumes,
},
]

Expand Down

0 comments on commit 3a6c96b

Please sign in to comment.