-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: tune drone.io config for production
- Loading branch information
Showing
1 changed file
with
59 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,65 +13,65 @@ steps: | |
- pip3 install --upgrade tox | ||
- tox -e py38,lint | ||
|
||
--- | ||
############################# | ||
# Testing build and deploy | ||
############################# | ||
kind: pipeline | ||
type: docker | ||
name: Build and deploy for develop | ||
|
||
trigger: | ||
branch: | ||
- relay.md/develop | ||
status: | ||
# Only runs if the first pipeline was fully successful | ||
- success | ||
depends_on: | ||
# Must run after the first pipeline | ||
- run_tests | ||
|
||
steps: | ||
- name: docker | ||
image: plugins/docker | ||
settings: | ||
username: | ||
from_secret: CI_REGISTRY_USER | ||
password: | ||
from_secret: CI_REGISTRY_PASSWORD | ||
repo: registry.infra.chainsquad.com/relay.md/backend | ||
registry: registry.infra.chainsquad.com | ||
tags: | ||
- "develop.${DRONE_BUILD_NUMBER}" | ||
|
||
- name: clone jobs | ||
image: alpine/git | ||
environment: | ||
# drone secrets add --image=<image> <repo> SSH_KEY @/path/to/.ssh/id_rsa | ||
DEPLOY_KEY: | ||
from_secret: DEPLOY_KEY | ||
commands: | ||
# https://stackoverflow.com/a/52812550 | ||
- mkdir $HOME/.ssh && echo "$DEPLOY_KEY" > $HOME/.ssh/id_rsa && chmod 600 $HOME/.ssh/id_rsa | ||
- echo "Host *" >> ~/.ssh/config | ||
- echo " StrictHostKeyChecking no" >> ~/.ssh/config | ||
- git clone ssh:https://[email protected]:2222/knowledgemd/jobs.git | ||
|
||
- name: deploy | ||
depends_on: | ||
- clone jobs | ||
- docker | ||
image: hashicorp/nomad | ||
environment: | ||
NOMAD_ADDR: https://nomad.infra.chainsquad.com | ||
NOMAD_TOKEN: | ||
from_secret: NOMAD_TOKEN | ||
NOMAD_VAR_registry_auth: | ||
from_secret: NOMAD_VAR_registry_auth | ||
NOMAD_VAR_api_image_version: "develop.${DRONE_BUILD_NUMBER}" | ||
commands: | ||
- wget https://letsencrypt.org/certs/lets-encrypt-r3.pem | ||
- nomad job run -ca-cert lets-encrypt-r3.pem -detach jobs/relaymd-testing.hcl | ||
# --- | ||
# ############################# | ||
# # Testing build and deploy | ||
# ############################# | ||
# kind: pipeline | ||
# type: docker | ||
# name: Build and deploy for develop | ||
# | ||
# trigger: | ||
# branch: | ||
# - relay.md/develop | ||
# status: | ||
# # Only runs if the first pipeline was fully successful | ||
# - success | ||
# depends_on: | ||
# # Must run after the first pipeline | ||
# - run_tests | ||
# | ||
# steps: | ||
# - name: docker | ||
# image: plugins/docker | ||
# settings: | ||
# username: | ||
# from_secret: CI_REGISTRY_USER | ||
# password: | ||
# from_secret: CI_REGISTRY_PASSWORD | ||
# repo: registry.infra.chainsquad.com/relay.md/backend | ||
# registry: registry.infra.chainsquad.com | ||
# tags: | ||
# - "develop.${DRONE_BUILD_NUMBER}" | ||
# | ||
# - name: clone jobs | ||
# image: alpine/git | ||
# environment: | ||
# # drone secrets add --image=<image> <repo> SSH_KEY @/path/to/.ssh/id_rsa | ||
# DEPLOY_KEY: | ||
# from_secret: DEPLOY_KEY | ||
# commands: | ||
# # https://stackoverflow.com/a/52812550 | ||
# - mkdir $HOME/.ssh && echo "$DEPLOY_KEY" > $HOME/.ssh/id_rsa && chmod 600 $HOME/.ssh/id_rsa | ||
# - echo "Host *" >> ~/.ssh/config | ||
# - echo " StrictHostKeyChecking no" >> ~/.ssh/config | ||
# - git clone ssh:https://[email protected]:2222/knowledgemd/jobs.git | ||
# | ||
# - name: deploy | ||
# depends_on: | ||
# - clone jobs | ||
# - docker | ||
# image: hashicorp/nomad | ||
# environment: | ||
# NOMAD_ADDR: https://nomad.infra.chainsquad.com | ||
# NOMAD_TOKEN: | ||
# from_secret: NOMAD_TOKEN | ||
# NOMAD_VAR_registry_auth: | ||
# from_secret: NOMAD_VAR_registry_auth | ||
# NOMAD_VAR_api_image_version: "develop.${DRONE_BUILD_NUMBER}" | ||
# commands: | ||
# - wget https://letsencrypt.org/certs/lets-encrypt-r3.pem | ||
# - nomad job run -ca-cert lets-encrypt-r3.pem -detach jobs/relaymd-testing.hcl | ||
|
||
--- | ||
################ | ||
|