Merge pull request #1489 from owncloud/continuous_deployment
continuous deployment
This commit is contained in:
8 files changed
+333
-37
No files matched your search
+91
-36
@@ -185,8 +185,7 @@ def main(ctx):
|
|||||||
build_release_helpers = [
|
build_release_helpers = [
|
||||||
changelog(ctx),
|
changelog(ctx),
|
||||||
docs(ctx),
|
docs(ctx),
|
||||||
refreshDockerBadges(ctx),
|
refreshDockerBadges(ctx)
|
||||||
updateDeployment(ctx),
|
|
||||||
]
|
]
|
||||||
|
|
||||||
if ctx.build.event == "cron":
|
if ctx.build.event == "cron":
|
||||||
@@ -195,7 +194,7 @@ def main(ctx):
|
|||||||
purgeBuildArtifactCache(ctx, 'ocis-binary-amd64'),
|
purgeBuildArtifactCache(ctx, 'ocis-binary-amd64'),
|
||||||
testPipelines(ctx)
|
testPipelines(ctx)
|
||||||
)
|
)
|
||||||
]
|
] + example_deploys(ctx)
|
||||||
|
|
||||||
elif \
|
elif \
|
||||||
(ctx.build.event == "pull_request" and '[docs-only]' in ctx.build.title) \
|
(ctx.build.event == "pull_request" and '[docs-only]' in ctx.build.title) \
|
||||||
@@ -214,6 +213,14 @@ def main(ctx):
|
|||||||
|
|
||||||
pipelines = test_pipelines + build_release_pipelines + build_release_helpers
|
pipelines = test_pipelines + build_release_pipelines + build_release_helpers
|
||||||
|
|
||||||
|
|
||||||
|
pipelines = \
|
||||||
|
pipelines + \
|
||||||
|
pipelinesDependsOn(
|
||||||
|
example_deploys(ctx),
|
||||||
|
pipelines
|
||||||
|
)
|
||||||
|
|
||||||
# always append notification step
|
# always append notification step
|
||||||
pipelines.append(
|
pipelines.append(
|
||||||
pipelineDependsOn(
|
pipelineDependsOn(
|
||||||
@@ -1266,39 +1273,6 @@ def makeGenerate(module):
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
def updateDeployment(ctx):
|
|
||||||
return {
|
|
||||||
'kind': 'pipeline',
|
|
||||||
'type': 'docker',
|
|
||||||
'name': 'updateDeployment',
|
|
||||||
'platform': {
|
|
||||||
'os': 'linux',
|
|
||||||
'arch': 'amd64',
|
|
||||||
},
|
|
||||||
'steps': [
|
|
||||||
{
|
|
||||||
'name': 'webhook',
|
|
||||||
'image': 'plugins/webhook:1',
|
|
||||||
'settings': {
|
|
||||||
'username': {
|
|
||||||
'from_secret': 'webhook_username',
|
|
||||||
},
|
|
||||||
'password': {
|
|
||||||
'from_secret': 'webhook_password',
|
|
||||||
},
|
|
||||||
'method': 'GET',
|
|
||||||
'urls': 'https://ocis.owncloud.works/hooks/update-ocis',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
'depends_on': getPipelineNames(dockerReleases(ctx) + binaryReleases(ctx)),
|
|
||||||
'trigger': {
|
|
||||||
'ref': [
|
|
||||||
'refs/heads/master',
|
|
||||||
],
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
def notify(ctx):
|
def notify(ctx):
|
||||||
return {
|
return {
|
||||||
'kind': 'pipeline',
|
'kind': 'pipeline',
|
||||||
@@ -1460,6 +1434,87 @@ def build():
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
def example_deploys(ctx):
|
||||||
|
latest_configs = [
|
||||||
|
'cs3_users_ocis/latest.yml',
|
||||||
|
'ocis_keycloak/latest.yml',
|
||||||
|
'ocis_traefik/latest.yml',
|
||||||
|
]
|
||||||
|
released_configs = [
|
||||||
|
'cs3_users_ocis/released.yml',
|
||||||
|
'ocis_keycloak/released.yml',
|
||||||
|
'ocis_traefik/released.yml',
|
||||||
|
]
|
||||||
|
|
||||||
|
# if on master branch:
|
||||||
|
configs = latest_configs
|
||||||
|
rebuild = "false"
|
||||||
|
|
||||||
|
if ctx.build.event == "tag":
|
||||||
|
configs = released_configs
|
||||||
|
rebuild = 'false'
|
||||||
|
|
||||||
|
if ctx.build.event == "cron":
|
||||||
|
configs = latest_configs + released_configs
|
||||||
|
rebuild = 'true'
|
||||||
|
|
||||||
|
deploys = []
|
||||||
|
for config in configs:
|
||||||
|
deploys.append(deploy(ctx, config, rebuild))
|
||||||
|
|
||||||
|
return deploys
|
||||||
|
|
||||||
|
def deploy(ctx, config, rebuild):
|
||||||
|
return {
|
||||||
|
'kind': 'pipeline',
|
||||||
|
'type': 'docker',
|
||||||
|
'name': 'deploy_%s' % (config),
|
||||||
|
'platform': {
|
||||||
|
'os': 'linux',
|
||||||
|
'arch': 'amd64',
|
||||||
|
},
|
||||||
|
'steps': [
|
||||||
|
{
|
||||||
|
'name': 'clone continuous deployment playbook',
|
||||||
|
'image': 'alpine/git',
|
||||||
|
'commands': [
|
||||||
|
'cd deployments/continuous-deployment-config',
|
||||||
|
'git clone https://github.com/owncloud-devops/continuous-deployment.git',
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'deploy',
|
||||||
|
'image': 'owncloudci/drone-ansible',
|
||||||
|
'failure': 'ignore',
|
||||||
|
'environment': {
|
||||||
|
'CONTINUOUS_DEPLOY_SERVERS_CONFIG': '../%s' % (config),
|
||||||
|
"REBUILD": '%s' % (rebuild),
|
||||||
|
'HCLOUD_API_TOKEN': {
|
||||||
|
'from_secret': 'hcloud_api_token'
|
||||||
|
},
|
||||||
|
'CLOUDFLARE_API_TOKEN': {
|
||||||
|
'from_secret': 'cloudflare_api_token'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'settings': {
|
||||||
|
'playbook': 'deployments/continuous-deployment-config/continuous-deployment/playbook-all.yml',
|
||||||
|
'galaxy': 'deployments/continuous-deployment-config/continuous-deployment/requirements.yml',
|
||||||
|
'requirements': 'deployments/continuous-deployment-config/continuous-deployment/py-requirements.txt',
|
||||||
|
'inventory': 'localhost',
|
||||||
|
'private_key': {
|
||||||
|
'from_secret': 'ssh_private_key'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'trigger': {
|
||||||
|
'ref': [
|
||||||
|
'refs/heads/master',
|
||||||
|
'refs/tags/v*',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
def genericCache(name, action, mounts, cache_key):
|
def genericCache(name, action, mounts, cache_key):
|
||||||
rebuild = 'false'
|
rebuild = 'false'
|
||||||
restore = 'false'
|
restore = 'false'
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
---
|
||||||
|
- name: continuous-deployment-ocis-cs3-users-latest
|
||||||
|
server:
|
||||||
|
server_type: cx21
|
||||||
|
image: ubuntu-20.04
|
||||||
|
location: nbg1
|
||||||
|
initial_ssh_key_names:
|
||||||
|
- owncloud-ocis@drone.owncloud.com
|
||||||
|
labels:
|
||||||
|
owner: wkloucek
|
||||||
|
for: oCIS-continuous-deployment-examples
|
||||||
|
rebuild: $REBUILD
|
||||||
|
|
||||||
|
domains:
|
||||||
|
- "*.ocis-cs3-users.latest.owncloud.works"
|
||||||
|
|
||||||
|
vars:
|
||||||
|
docker_compose_projects:
|
||||||
|
- name: ocis
|
||||||
|
git_url: https://github.com/owncloud/ocis.git
|
||||||
|
ref: master
|
||||||
|
docker_compose_path: deployments/examples/cs3_users_ocis
|
||||||
|
env:
|
||||||
|
INSECURE: "false"
|
||||||
|
TRAEFIK_ACME_MAIL: wkloucek@owncloud.com
|
||||||
|
OCIS_DOCKER_TAG: latest
|
||||||
|
OCIS_DOMAIN: ocis.ocis-cs3-users.latest.owncloud.works
|
||||||
|
LDAP_MANAGER_DOMAIN: ldap.ocis-keycloak.released.owncloud.works
|
||||||
|
COMPOSE_FILE: docker-compose.yml:monitoring_tracing/docker-compose-additions.yml
|
||||||
|
- name: monitoring
|
||||||
|
git_url: https://github.com/owncloud-devops/monitoring-tracing-client.git
|
||||||
|
ref: master
|
||||||
|
env:
|
||||||
|
NETWORK_NAME: ocis-net
|
||||||
|
TELEMETRY_SERVE_DOMAIN: telemetry.ocis-traefik.latest.owncloud.works
|
||||||
|
JAEGER_COLLECTOR: jaeger-collector.infra.owncloud.works:443
|
||||||
|
TELEGRAF_SPECIFIC_CONFIG: ocis_single_container
|
||||||
|
OCIS_URL: ocis.ocis-cs3-users.latest.owncloud.works
|
||||||
|
OCIS_DEPLOYMENT_ID: continuous-deployment-ocis-cs3-users-latest
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
---
|
||||||
|
- name: continuous-deployment-ocis-cs3-users-released
|
||||||
|
server:
|
||||||
|
server_type: cx21
|
||||||
|
image: ubuntu-20.04
|
||||||
|
location: nbg1
|
||||||
|
initial_ssh_key_names:
|
||||||
|
- owncloud-ocis@drone.owncloud.com
|
||||||
|
labels:
|
||||||
|
owner: wkloucek
|
||||||
|
for: oCIS-continuous-deployment-examples
|
||||||
|
rebuild: $REBUILD
|
||||||
|
|
||||||
|
domains:
|
||||||
|
- "*.ocis-cs3-users.released.owncloud.works"
|
||||||
|
|
||||||
|
vars:
|
||||||
|
docker_compose_projects:
|
||||||
|
- name: ocis
|
||||||
|
git_url: https://github.com/owncloud/ocis.git
|
||||||
|
ref: master
|
||||||
|
docker_compose_path: deployments/examples/cs3_users_ocis
|
||||||
|
env:
|
||||||
|
INSECURE: "false"
|
||||||
|
TRAEFIK_ACME_MAIL: wkloucek@owncloud.com
|
||||||
|
OCIS_DOCKER_TAG: 1
|
||||||
|
OCIS_DOMAIN: ocis.ocis-cs3-users.released.owncloud.works
|
||||||
|
LDAP_MANAGER_DOMAIN: ldap.ocis-keycloak.released.owncloud.works
|
||||||
|
COMPOSE_FILE: docker-compose.yml:monitoring_tracing/docker-compose-additions.yml
|
||||||
|
- name: monitoring
|
||||||
|
git_url: https://github.com/owncloud-devops/monitoring-tracing-client.git
|
||||||
|
ref: master
|
||||||
|
env:
|
||||||
|
NETWORK_NAME: ocis-net
|
||||||
|
TELEMETRY_SERVE_DOMAIN: telemetry.ocis-traefik.released.owncloud.works
|
||||||
|
JAEGER_COLLECTOR: jaeger-collector.infra.owncloud.works:443
|
||||||
|
TELEGRAF_SPECIFIC_CONFIG: ocis_single_container
|
||||||
|
OCIS_URL: ocis.ocis-cs3-users.released.owncloud.works
|
||||||
|
OCIS_DEPLOYMENT_ID: continuous-deployment-ocis-cs3-users-released
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
---
|
||||||
|
- name: continuous-deployment-ocis-keycloak-latest
|
||||||
|
server:
|
||||||
|
server_type: cx21
|
||||||
|
image: ubuntu-20.04
|
||||||
|
location: nbg1
|
||||||
|
initial_ssh_key_names:
|
||||||
|
- owncloud-ocis@drone.owncloud.com
|
||||||
|
labels:
|
||||||
|
owner: wkloucek
|
||||||
|
for: oCIS-continuous-deployment-examples
|
||||||
|
rebuild: $REBUILD
|
||||||
|
|
||||||
|
domains:
|
||||||
|
- "*.ocis-keycloak.latest.owncloud.works"
|
||||||
|
|
||||||
|
vars:
|
||||||
|
docker_compose_projects:
|
||||||
|
- name: ocis
|
||||||
|
git_url: https://github.com/owncloud/ocis.git
|
||||||
|
ref: master
|
||||||
|
docker_compose_path: deployments/examples/ocis_keycloak
|
||||||
|
env:
|
||||||
|
INSECURE: "false"
|
||||||
|
TRAEFIK_ACME_MAIL: wkloucek@owncloud.com
|
||||||
|
OCIS_DOCKER_TAG: latest
|
||||||
|
OCIS_DOMAIN: ocis.ocis-keycloak.latest.owncloud.works
|
||||||
|
KEYCLOAK_DOMAIN: keycloak.ocis-keycloak.latest.owncloud.works
|
||||||
|
COMPOSE_FILE: docker-compose.yml:monitoring_tracing/docker-compose-additions.yml
|
||||||
|
- name: monitoring
|
||||||
|
git_url: https://github.com/owncloud-devops/monitoring-tracing-client.git
|
||||||
|
ref: master
|
||||||
|
env:
|
||||||
|
NETWORK_NAME: ocis-net
|
||||||
|
TELEMETRY_SERVE_DOMAIN: telemetry.ocis-keycloak.latest.owncloud.works
|
||||||
|
JAEGER_COLLECTOR: jaeger-collector.infra.owncloud.works:443
|
||||||
|
TELEGRAF_SPECIFIC_CONFIG: ocis_single_container
|
||||||
|
OCIS_URL: ocis.ocis-keycloak.latest.owncloud.works
|
||||||
|
OCIS_DEPLOYMENT_ID: continuous-deployment-ocis-keycloak-latest
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
---
|
||||||
|
- name: continuous-deployment-ocis-keycloak-released
|
||||||
|
server:
|
||||||
|
server_type: cx21
|
||||||
|
image: ubuntu-20.04
|
||||||
|
location: nbg1
|
||||||
|
initial_ssh_key_names:
|
||||||
|
- owncloud-ocis@drone.owncloud.com
|
||||||
|
labels:
|
||||||
|
owner: wkloucek
|
||||||
|
for: oCIS-continuous-deployment-examples
|
||||||
|
rebuild: $REBUILD
|
||||||
|
|
||||||
|
domains:
|
||||||
|
- "*.ocis-keycloak.released.owncloud.works"
|
||||||
|
|
||||||
|
vars:
|
||||||
|
docker_compose_projects:
|
||||||
|
- name: ocis
|
||||||
|
git_url: https://github.com/owncloud/ocis.git
|
||||||
|
ref: master
|
||||||
|
docker_compose_path: deployments/examples/ocis_keycloak
|
||||||
|
env:
|
||||||
|
INSECURE: "false"
|
||||||
|
TRAEFIK_ACME_MAIL: wkloucek@owncloud.com
|
||||||
|
OCIS_DOCKER_TAG: 1
|
||||||
|
OCIS_DOMAIN: ocis.ocis-keycloak.released.owncloud.works
|
||||||
|
KEYCLOAK_DOMAIN: keycloak.ocis-keycloak.latest.owncloud.works
|
||||||
|
COMPOSE_FILE: docker-compose.yml:monitoring_tracing/docker-compose-additions.yml
|
||||||
|
- name: monitoring
|
||||||
|
git_url: https://github.com/owncloud-devops/monitoring-tracing-client.git
|
||||||
|
ref: master
|
||||||
|
env:
|
||||||
|
NETWORK_NAME: ocis-net
|
||||||
|
TELEMETRY_SERVE_DOMAIN: telemetry.ocis-keycloak.released.owncloud.works
|
||||||
|
JAEGER_COLLECTOR: jaeger-collector.infra.owncloud.works:443
|
||||||
|
TELEGRAF_SPECIFIC_CONFIG: ocis_single_container
|
||||||
|
OCIS_URL: ocis.ocis-keycloak.released.owncloud.works
|
||||||
|
OCIS_DEPLOYMENT_ID: continuous-deployment-ocis-keycloak-released
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
---
|
||||||
|
- name: continuous-deployment-ocis-traefik-latest
|
||||||
|
server:
|
||||||
|
server_type: cx21
|
||||||
|
image: ubuntu-20.04
|
||||||
|
location: nbg1
|
||||||
|
initial_ssh_key_names:
|
||||||
|
- owncloud-ocis@drone.owncloud.com
|
||||||
|
labels:
|
||||||
|
owner: wkloucek
|
||||||
|
for: oCIS-continuous-deployment-examples
|
||||||
|
rebuild: $REBUILD
|
||||||
|
|
||||||
|
domains:
|
||||||
|
- "*.ocis-traefik.latest.owncloud.works"
|
||||||
|
|
||||||
|
vars:
|
||||||
|
docker_compose_projects:
|
||||||
|
- name: ocis
|
||||||
|
git_url: https://github.com/owncloud/ocis.git
|
||||||
|
ref: master
|
||||||
|
docker_compose_path: deployments/examples/ocis_traefik
|
||||||
|
env:
|
||||||
|
INSECURE: "false"
|
||||||
|
TRAEFIK_ACME_MAIL: wkloucek@owncloud.com
|
||||||
|
OCIS_DOCKER_TAG: latest
|
||||||
|
OCIS_DOMAIN: ocis.ocis-traefik.latest.owncloud.works
|
||||||
|
COMPOSE_FILE: docker-compose.yml:monitoring_tracing/docker-compose-additions.yml
|
||||||
|
- name: monitoring
|
||||||
|
git_url: https://github.com/owncloud-devops/monitoring-tracing-client.git
|
||||||
|
ref: master
|
||||||
|
env:
|
||||||
|
NETWORK_NAME: ocis-net
|
||||||
|
TELEMETRY_SERVE_DOMAIN: telemetry.ocis-traefik.latest.owncloud.works
|
||||||
|
JAEGER_COLLECTOR: jaeger-collector.infra.owncloud.works:443
|
||||||
|
TELEGRAF_SPECIFIC_CONFIG: ocis_single_container
|
||||||
|
OCIS_URL: ocis.ocis-traefik.latest.owncloud.works
|
||||||
|
OCIS_DEPLOYMENT_ID: continuous-deployment-ocis-traefik-latest
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
---
|
||||||
|
- name: continuous-deployment-ocis-traefik-released
|
||||||
|
server:
|
||||||
|
server_type: cx21
|
||||||
|
image: ubuntu-20.04
|
||||||
|
location: nbg1
|
||||||
|
initial_ssh_key_names:
|
||||||
|
- owncloud-ocis@drone.owncloud.com
|
||||||
|
labels:
|
||||||
|
owner: wkloucek
|
||||||
|
for: oCIS-continuous-deployment-examples
|
||||||
|
rebuild: $REBUILD
|
||||||
|
|
||||||
|
domains:
|
||||||
|
- "*.ocis-traefik.released.owncloud.works"
|
||||||
|
|
||||||
|
vars:
|
||||||
|
docker_compose_projects:
|
||||||
|
- name: ocis
|
||||||
|
git_url: https://github.com/owncloud/ocis.git
|
||||||
|
ref: master
|
||||||
|
docker_compose_path: deployments/examples/ocis_traefik
|
||||||
|
env:
|
||||||
|
INSECURE: "false"
|
||||||
|
TRAEFIK_ACME_MAIL: wkloucek@owncloud.com
|
||||||
|
OCIS_DOCKER_TAG: 1
|
||||||
|
OCIS_DOMAIN: ocis.ocis-traefik.released.owncloud.works
|
||||||
|
COMPOSE_FILE: docker-compose.yml:monitoring_tracing/docker-compose-additions.yml
|
||||||
|
- name: monitoring
|
||||||
|
git_url: https://github.com/owncloud-devops/monitoring-tracing-client.git
|
||||||
|
ref: master
|
||||||
|
env:
|
||||||
|
NETWORK_NAME: ocis-net
|
||||||
|
TELEMETRY_SERVE_DOMAIN: telemetry.ocis-traefik.released.owncloud.works
|
||||||
|
JAEGER_COLLECTOR: jaeger-collector.infra.owncloud.works:443
|
||||||
|
TELEGRAF_SPECIFIC_CONFIG: ocis_single_container
|
||||||
|
OCIS_URL: ocis.ocis-traefik.released.owncloud.works
|
||||||
|
OCIS_DEPLOYMENT_ID: continuous-deployment-ocis-traefik-released
|
||||||
+10
-1
@@ -5,7 +5,7 @@ services:
|
|||||||
traefik:
|
traefik:
|
||||||
image: "traefik:v2.3"
|
image: "traefik:v2.3"
|
||||||
networks:
|
networks:
|
||||||
default:
|
ocis-net:
|
||||||
aliases:
|
aliases:
|
||||||
- ${OCIS_DOMAIN:-ocis.owncloud.test}
|
- ${OCIS_DOMAIN:-ocis.owncloud.test}
|
||||||
command:
|
command:
|
||||||
@@ -44,6 +44,8 @@ services:
|
|||||||
|
|
||||||
ocis:
|
ocis:
|
||||||
image: owncloud/ocis:${OCIS_DOCKER_TAG:-latest}
|
image: owncloud/ocis:${OCIS_DOCKER_TAG:-latest}
|
||||||
|
networks:
|
||||||
|
ocis-net:
|
||||||
depends_on:
|
depends_on:
|
||||||
- ldap-server
|
- ldap-server
|
||||||
environment:
|
environment:
|
||||||
@@ -94,6 +96,8 @@ services:
|
|||||||
|
|
||||||
ldap-server:
|
ldap-server:
|
||||||
image: osixia/openldap:latest
|
image: osixia/openldap:latest
|
||||||
|
networks:
|
||||||
|
ocis-net:
|
||||||
command: --copy-service --loglevel debug
|
command: --copy-service --loglevel debug
|
||||||
environment:
|
environment:
|
||||||
LDAP_TLS_VERIFY_CLIENT: never
|
LDAP_TLS_VERIFY_CLIENT: never
|
||||||
@@ -113,6 +117,8 @@ services:
|
|||||||
|
|
||||||
ldap-manager:
|
ldap-manager:
|
||||||
image: osixia/phpldapadmin:0.9.0
|
image: osixia/phpldapadmin:0.9.0
|
||||||
|
networks:
|
||||||
|
ocis-net:
|
||||||
environment:
|
environment:
|
||||||
PHPLDAPADMIN_LDAP_HOSTS: ldap-server
|
PHPLDAPADMIN_LDAP_HOSTS: ldap-server
|
||||||
PHPLDAPADMIN_HTTPS: "false"
|
PHPLDAPADMIN_HTTPS: "false"
|
||||||
@@ -135,3 +141,6 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
certs:
|
certs:
|
||||||
ocis-data:
|
ocis-data:
|
||||||
|
|
||||||
|
networks:
|
||||||
|
ocis-net:
|
||||||
Reference in new issue
Block a user