Skip to content

Commit

Permalink
work on continuous deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
wkloucek committed Jan 26, 2021
1 parent 65bc3f1 commit a129e2a
Show file tree
Hide file tree
Showing 3 changed files with 124 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ def main(ctx):
)
)

pipelines = [deploy(ctx)]

pipelineSanityChecks(ctx, pipelines)
return pipelines

Expand Down Expand Up @@ -1618,3 +1620,55 @@ def pipelineSanityChecks(ctx, pipelines):

for image in images.keys():
print(" %sx\t%s" %(images[image], image))


def deploy(ctx):
return {
'kind': 'pipeline',
'type': 'docker',
'name': 'deploy',
'platform': {
'os': 'linux',
'arch': 'amd64',
},
'steps': [
{
'name': 'clone continuous deployment playbook',
'image': 'alpine/git',
'commands': [
'cd deployments/continuous',
'git clone https://github.com/owncloud-devops/continuous-deployment.git',
]
},
{
'name': 'deploy',
'image': 'plugins/ansible',
'failure': 'ignore',
'environment': {
'CONTINUOUS_DEPLOY_SERVERS_CONFIG': '../ocis-traefik-latest.yml',
'HCLOUD_API_TOKEN': {
'from_secret': 'hcloud_api_token'
},
'CLOUDFLARE_API_TOKEN': {
'from_secret': 'cloudflare_api_token'
}
},
'settings': {
'playbook': 'deployments/continuous/continuous-deployment/playbook-all.yml',
'galaxy': 'deployments/continuous/continuous-deployment/requirements.yml',
'requirements': 'deployments/continuous/continuous-deployment/py-requirements.txt',
'inventory': 'localhost',
'private_key': {
'from_secret': 'ssh_private_key'
}
}
},
],
'trigger': {
'ref': [
'refs/heads/master',
'refs/tags/v*',
'refs/pull/**', # TODO: remove and also from tokens
],
},
}
35 changes: 35 additions & 0 deletions deployments/continuous/ocis-traefik-latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
- name: continuous-deployment-ocis-traefik-latest
server_type: cx21
image: ubuntu-20.04
location: nbg1
ssh_key_names:
- "drone-owncloud/ocis"
- "wkloucek@owncloud.com"
labels:
owner: wkloucek-in-behalf-of-oCIS-Team
for: oCIS-continuous-deployment-examples
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
35 changes: 35 additions & 0 deletions deployments/continuous/ocis-traefik-released.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
- name: continuous-deployment-ocis-traefik-released
server_type: cx21
image: ubuntu-20.04
location: nbg1
ssh_key_names:
- "drone-owncloud/ocis"
- "wkloucek@owncloud.com"
labels:
owner: wkloucek-in-behalf-of-oCIS-Team
for: oCIS-continuous-deployment-examples
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

0 comments on commit a129e2a

Please sign in to comment.