.
This commit is contained in:
parent
246dff312f
commit
94e7d7fa5b
|
@ -1,16 +0,0 @@
|
||||||
|
|
||||||
load("@this//chat:drone.star", "drone")
|
|
||||||
load("@this//chat:stack-name.star", "stackName")
|
|
||||||
load("@this//chat:stack-root.star", "stackRoot")
|
|
||||||
|
|
||||||
def main(ctx):
|
|
||||||
return drone(
|
|
||||||
ctx,
|
|
||||||
"home-deploy",
|
|
||||||
stackRoot,
|
|
||||||
stackName,
|
|
||||||
[
|
|
||||||
"docker service scale {name}_chat=1".format(name=stackName),
|
|
||||||
]
|
|
||||||
)
|
|
||||||
|
|
|
@ -9,12 +9,14 @@ local register = import 'node_modules/@sigyl/jsonnet-drone/register.libsonnet';
|
||||||
deploy(
|
deploy(
|
||||||
'chat',
|
'chat',
|
||||||
'/stack/',
|
'/stack/',
|
||||||
|
[],
|
||||||
|
publicSecrets,
|
||||||
|
secretSecrets,
|
||||||
[
|
[
|
||||||
'LOCAL_DOCKER_REGISTRY',
|
'REGISTRY_DOMAIN',
|
||||||
|
'REGISTRY_PORT',
|
||||||
'REGISTRY_PASSWORD',
|
'REGISTRY_PASSWORD',
|
||||||
],
|
],
|
||||||
publicSecrets,
|
|
||||||
secretSecrets
|
|
||||||
) {
|
) {
|
||||||
trigger +: {
|
trigger +: {
|
||||||
event +: [
|
event +: [
|
||||||
|
|
|
@ -26,7 +26,7 @@ platform:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: print env
|
- name: print env
|
||||||
image: appleboy/drone-ssh:1.6.2
|
image: appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea
|
||||||
settings:
|
settings:
|
||||||
envs:
|
envs:
|
||||||
- drone_tag
|
- drone_tag
|
||||||
|
@ -34,28 +34,21 @@ steps:
|
||||||
- drone_build_number
|
- drone_build_number
|
||||||
- drone_repo_name
|
- drone_repo_name
|
||||||
- drone_repo_namespace
|
- drone_repo_namespace
|
||||||
- local_docker_registry
|
- domain
|
||||||
- registry_password
|
|
||||||
- git_domain
|
|
||||||
- chat_admin_name
|
- chat_admin_name
|
||||||
- chat_admin_email
|
- chat_admin_email
|
||||||
- chat_admin_password
|
- chat_admin_password
|
||||||
host:
|
host: ${SSH_HOST}
|
||||||
from_secret: ssh-host
|
key: ${SSH_KEY}
|
||||||
key:
|
passphrase: ${SSH_PASSPHRASE}
|
||||||
from_secret: ssh-key
|
port: ${SSH_PORT}
|
||||||
port:
|
|
||||||
from_secret: ssh-port
|
|
||||||
script:
|
script:
|
||||||
- rm -f env-chat
|
- rm -f env-chat
|
||||||
- "echo \"export LOCAL_DOCKER_REGISTRY='$${LOCAL_DOCKER_REGISTRY}'\" >> env-chat # \"local-docker-registry\""
|
- "echo \"export DOMAIN='$${DOMAIN}'\" >> env-chat # \"domain\""
|
||||||
- "echo \"export REGISTRY_PASSWORD='$${REGISTRY_PASSWORD}'\" >> env-chat # \"registry-password\""
|
|
||||||
- "echo \"export GIT_DOMAIN='$${GIT_DOMAIN}'\" >> env-chat # \"git-domain\""
|
|
||||||
- "echo \"export CHAT_ADMIN_NAME='$${CHAT_ADMIN_NAME}'\" >> env-chat # \"chat-admin-name\""
|
- "echo \"export CHAT_ADMIN_NAME='$${CHAT_ADMIN_NAME}'\" >> env-chat # \"chat-admin-name\""
|
||||||
- "echo \"export CHAT_ADMIN_EMAIL='$${CHAT_ADMIN_EMAIL}'\" >> env-chat # \"chat-admin-email\""
|
- "echo \"export CHAT_ADMIN_EMAIL='$${CHAT_ADMIN_EMAIL}'\" >> env-chat # \"chat-admin-email\""
|
||||||
- "echo \"export CHAT_ADMIN_PASSWORD='$${CHAT_ADMIN_PASSWORD}'\" >> env-chat # \"chat-admin-password\""
|
- "echo \"export CHAT_ADMIN_PASSWORD='$${CHAT_ADMIN_PASSWORD}'\" >> env-chat # \"chat-admin-password\""
|
||||||
username:
|
username: ${SSH_USER}
|
||||||
from_secret: ssh-user
|
|
||||||
environment:
|
environment:
|
||||||
CHAT_ADMIN_EMAIL:
|
CHAT_ADMIN_EMAIL:
|
||||||
from_secret: chat-admin-email
|
from_secret: chat-admin-email
|
||||||
|
@ -63,53 +56,41 @@ steps:
|
||||||
from_secret: chat-admin-name
|
from_secret: chat-admin-name
|
||||||
CHAT_ADMIN_PASSWORD:
|
CHAT_ADMIN_PASSWORD:
|
||||||
from_secret: chat-admin-password
|
from_secret: chat-admin-password
|
||||||
GIT_DOMAIN:
|
DOMAIN:
|
||||||
from_secret: git-domain
|
from_secret: domain
|
||||||
LOCAL_DOCKER_REGISTRY:
|
|
||||||
from_secret: local-docker-registry
|
|
||||||
REGISTRY_PASSWORD:
|
|
||||||
from_secret: registry-password
|
|
||||||
|
|
||||||
- name: scp
|
- name: scp
|
||||||
image: appleboy/drone-scp:1.6.2
|
image: appleboy/drone-scp:1.6.2@sha256:bd37a55f4b97e7742b0de7333669b96220b3cc422d366e1fa8c34059b736ab47
|
||||||
settings:
|
settings:
|
||||||
command_timeout: 2m
|
command_timeout: 2m
|
||||||
host:
|
host: ${SSH_HOST}
|
||||||
from_secret: ssh-host
|
key: ${SSH_KEY}
|
||||||
key:
|
passphrase: ${SSH_PASSPHRASE}
|
||||||
from_secret: ssh-key
|
port: ${SSH_PORT}
|
||||||
port:
|
|
||||||
from_secret: ssh-port
|
|
||||||
source:
|
source:
|
||||||
- .
|
- .
|
||||||
target: /stack/chat
|
target: /stack/chat
|
||||||
username:
|
username: ${SSH_USER}
|
||||||
from_secret: ssh-user
|
|
||||||
|
|
||||||
- name: wait
|
- name: wait
|
||||||
image: alpine
|
image: alpine:3.12.0@sha256:90baa0922fe90624b05cb5766fa5da4e337921656c2f8e2b13bd3c052a0baac1
|
||||||
commands:
|
commands:
|
||||||
- sleep 15
|
- sleep 15
|
||||||
|
|
||||||
- name: "dockerbuild:"
|
- name: "dockerbuild:"
|
||||||
image: docker:dind
|
image: docker:19.03.12-dind@sha256:8dded163e463f4a59bf305b3dca98e312b2cfb89a43da3872e48f95a7554c48f
|
||||||
commands:
|
commands:
|
||||||
- set -e
|
- set -e
|
||||||
- sh .drone/login.sh
|
- sh .drone/login.sh
|
||||||
- sh .drone/build.sh
|
- sh .drone/build.sh
|
||||||
- sh .drone/push.sh
|
- sh .drone/push.sh
|
||||||
- sh .drone/logout.sh
|
- sh .drone/logout.sh
|
||||||
environment:
|
|
||||||
LOCAL_DOCKER_REGISTRY:
|
|
||||||
from_secret: local-docker-registry
|
|
||||||
REGISTRY_PASSWORD:
|
|
||||||
from_secret: registry-password
|
|
||||||
volumes:
|
volumes:
|
||||||
- name: dockersock
|
- name: dockersock
|
||||||
path: /var/run
|
path: /var/run
|
||||||
|
|
||||||
- name: deploy
|
- name: deploy
|
||||||
image: appleboy/drone-ssh:1.6.2
|
image: appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea
|
||||||
settings:
|
settings:
|
||||||
envs:
|
envs:
|
||||||
- drone_tag
|
- drone_tag
|
||||||
|
@ -117,32 +98,31 @@ steps:
|
||||||
- drone_build_number
|
- drone_build_number
|
||||||
- drone_repo_name
|
- drone_repo_name
|
||||||
- drone_repo_namespace
|
- drone_repo_namespace
|
||||||
- git_domain
|
- registry_domain
|
||||||
|
- registry_port
|
||||||
|
- registry_password
|
||||||
|
- domain
|
||||||
- chat_admin_name
|
- chat_admin_name
|
||||||
- chat_admin_email
|
- chat_admin_email
|
||||||
- chat_admin_password
|
- chat_admin_password
|
||||||
- local_docker_registry
|
host: ${SSH_HOST}
|
||||||
- registry_password
|
key: ${SSH_KEY}
|
||||||
host:
|
passphrase: ${SSH_PASSPHRASE}
|
||||||
from_secret: ssh-host
|
port: ${SSH_PORT}
|
||||||
key:
|
|
||||||
from_secret: ssh-key
|
|
||||||
port:
|
|
||||||
from_secret: ssh-port
|
|
||||||
script:
|
script:
|
||||||
- export CHAT_ADMIN_PASSWORD=$${CHAT_ADMIN_PASSWORD}
|
- export CHAT_ADMIN_PASSWORD=$${CHAT_ADMIN_PASSWORD}
|
||||||
- export GIT_DOMAIN=$${GIT_DOMAIN}
|
- export DOMAIN=$${DOMAIN}
|
||||||
- export CHAT_ADMIN_NAME=$${CHAT_ADMIN_NAME}
|
- export CHAT_ADMIN_NAME=$${CHAT_ADMIN_NAME}
|
||||||
- export CHAT_ADMIN_EMAIL=$${CHAT_ADMIN_EMAIL}
|
- export CHAT_ADMIN_EMAIL=$${CHAT_ADMIN_EMAIL}
|
||||||
- export LOCAL_DOCKER_REGISTRY=$${LOCAL_DOCKER_REGISTRY}
|
- export REGISTRY_DOMAIN=$${REGISTRY_DOMAIN}
|
||||||
|
- export REGISTRY_PORT=$${REGISTRY_PORT}
|
||||||
- export REGISTRY_PASSWORD=$${REGISTRY_PASSWORD}
|
- export REGISTRY_PASSWORD=$${REGISTRY_PASSWORD}
|
||||||
- set -e
|
- set -e
|
||||||
- cd /stack/chat
|
- cd /stack/chat
|
||||||
- sh .drone/login.sh
|
- sh .drone/login.sh
|
||||||
- sh .drone/pull.sh
|
- sh .drone/pull.sh
|
||||||
- sh .drone/deploy.sh
|
- sh .drone/deploy.sh
|
||||||
username:
|
username: ${SSH_USER}
|
||||||
from_secret: ssh-user
|
|
||||||
environment:
|
environment:
|
||||||
CHAT_ADMIN_EMAIL:
|
CHAT_ADMIN_EMAIL:
|
||||||
from_secret: chat-admin-email
|
from_secret: chat-admin-email
|
||||||
|
@ -150,16 +130,12 @@ steps:
|
||||||
from_secret: chat-admin-name
|
from_secret: chat-admin-name
|
||||||
CHAT_ADMIN_PASSWORD:
|
CHAT_ADMIN_PASSWORD:
|
||||||
from_secret: chat-admin-password
|
from_secret: chat-admin-password
|
||||||
GIT_DOMAIN:
|
DOMAIN:
|
||||||
from_secret: git-domain
|
from_secret: domain
|
||||||
LOCAL_DOCKER_REGISTRY:
|
|
||||||
from_secret: local-docker-registry
|
|
||||||
REGISTRY_PASSWORD:
|
|
||||||
from_secret: registry-password
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
- name: docker
|
- name: docker
|
||||||
image: docker:dind
|
image: docker:19.03.12-dind@sha256:8dded163e463f4a59bf305b3dca98e312b2cfb89a43da3872e48f95a7554c48f
|
||||||
privileged: true
|
privileged: true
|
||||||
volumes:
|
volumes:
|
||||||
- name: dockersock
|
- name: dockersock
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[
|
[
|
||||||
'git-domain',
|
'domain',
|
||||||
'chat-admin-name',
|
'chat-admin-name',
|
||||||
'chat-admin-email',
|
'chat-admin-email',
|
||||||
]
|
]
|
||||||
|
|
|
@ -4,6 +4,6 @@
|
||||||
"build": "drone jsonnet --source drone-home.jsonnet --target drone-home.yml --stream"
|
"build": "drone jsonnet --source drone-home.jsonnet --target drone-home.yml --stream"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@sigyl/jsonnet-drone": "^0.0.8"
|
"@sigyl/jsonnet-drone": "^0.1.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,10 +12,10 @@
|
||||||
resolved "https://registry.yarnpkg.com/@sigyl/jsonnet-drone-environment/-/jsonnet-drone-environment-0.0.5.tgz#9ea85e08904777bd21a3e4b30b0b91461d0285ff"
|
resolved "https://registry.yarnpkg.com/@sigyl/jsonnet-drone-environment/-/jsonnet-drone-environment-0.0.5.tgz#9ea85e08904777bd21a3e4b30b0b91461d0285ff"
|
||||||
integrity sha512-xVGmdMO1pOyozAWUbJm6mzKBgsLPJ+1hWnGCK3AxPkr7kkDh18hu30+TLzlcQtqq76s5jUfvJUztezsGj/mIcw==
|
integrity sha512-xVGmdMO1pOyozAWUbJm6mzKBgsLPJ+1hWnGCK3AxPkr7kkDh18hu30+TLzlcQtqq76s5jUfvJUztezsGj/mIcw==
|
||||||
|
|
||||||
"@sigyl/jsonnet-drone@^0.0.8":
|
"@sigyl/jsonnet-drone@^0.1.0":
|
||||||
version "0.0.8"
|
version "0.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/@sigyl/jsonnet-drone/-/jsonnet-drone-0.0.8.tgz#f928e6784bccf1abb82afed3cab6e435c62d2e93"
|
resolved "https://registry.yarnpkg.com/@sigyl/jsonnet-drone/-/jsonnet-drone-0.1.0.tgz#feda1797e8e9ef799cad72e65f7163ca26a9e3a5"
|
||||||
integrity sha512-BuFVawb7z3aUYqHCBqykgALjF07crnN2H7+WLo8crH3vT7FPMLbYdoTv7N98P8OhZBKv6KvBQep6uZK3Reho5g==
|
integrity sha512-QY/ngucxFOtLfL8Mt0f2bxN4fQDUOGOFtaRpSH2cNyg84xADkzehT0ORZtbLitr+AwhyF5KN/zAGvzkyNAoqPw==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@sigyl/jsonnet-compose" "^0.0.2"
|
"@sigyl/jsonnet-compose" "^0.0.2"
|
||||||
"@sigyl/jsonnet-drone-environment" "0.0.5"
|
"@sigyl/jsonnet-drone-environment" "0.0.5"
|
||||||
|
|
|
@ -13,7 +13,7 @@ services:
|
||||||
- externalnet
|
- externalnet
|
||||||
environment:
|
environment:
|
||||||
- MONGO_OPLOG_URL=mongodb://chat-mongo:27017/local
|
- MONGO_OPLOG_URL=mongodb://chat-mongo:27017/local
|
||||||
- ROOT_URL=https://${GIT_DOMAIN}/chat
|
- ROOT_URL=https://${DOMAIN}/chat
|
||||||
- PORT=3000
|
- PORT=3000
|
||||||
- MONGO_URL=mongodb://chat-mongo:27017/rocketchat
|
- MONGO_URL=mongodb://chat-mongo:27017/rocketchat
|
||||||
- ADMIN_USERNAME=${CHAT_ADMIN_NAME}
|
- ADMIN_USERNAME=${CHAT_ADMIN_NAME}
|
||||||
|
|
Loading…
Reference in New Issue