Compare commits

...

8 Commits

Author SHA1 Message Date
Giles c79fa6c1c2 fix: huginn not guac
continuous-integration/drone/push Build is passing Details
2020-08-20 13:12:05 +01:00
Giles f61f8df399 fix: drone jsonnet 0.0.7
continuous-integration/drone/push Build was killed Details
2020-08-20 13:06:31 +01:00
Giles d53481ed22 chore(release): 0.0.3 2020-08-20 00:11:59 +01:00
Giles 4f622d1cbf ci: moved scripts 2020-08-20 00:11:45 +01:00
Giles 8914443e2a chore(release): 0.0.2 2020-08-19 23:42:25 +01:00
Giles 1909cd5143 fix: wrong scripts 2020-08-19 23:42:07 +01:00
Giles 5b8b072d9a chore(release): 0.0.1 2020-08-19 23:39:57 +01:00
Giles 1cb05f5375 ci: build with jsonnet 2020-08-19 23:38:27 +01:00
18 changed files with 1881 additions and 0 deletions

1
.drone/build.sh Normal file
View File

@ -0,0 +1 @@
echo 'nothing to build'

4
.drone/deploy.sh Normal file
View File

@ -0,0 +1,4 @@
docker stack rm huginn
echo 'sleeping...zzz'
sleep 60
docker stack deploy -c docker-compose.yml huginn

17
.drone/drone-home.jsonnet Normal file
View File

@ -0,0 +1,17 @@
local secretSecrets = import 'lib/secret-secrets.libsonnet';
local publicSecrets = import 'lib/public-secrets.libsonnet';
local deploy = import 'node_modules/@sigyl/jsonnet-drone/deploy.libsonnet';
[
deploy(
'huginn',
'/stack/',
[
'LOCAL_DOCKER_REGISTRY',
'REGISTRY_PASSWORD',
],
publicSecrets,
secretSecrets
),
]

192
.drone/drone-home.yml Normal file
View File

@ -0,0 +1,192 @@
---
kind: pipeline
type: docker
name: deploy
platform:
os: linux
arch: amd64
steps:
- name: print env
image: appleboy/drone-ssh:1.6.2
settings:
envs:
- drone_tag
- drone_commit
- drone_build_number
- drone_repo_name
- drone_repo_namespace
- local_docker_registry
- registry_password
- smtp_domain
- smtp_user_name
- smtp_server
- email_from_address
- smtp_port
- smtp_password
- invitation_code
- database_password
host:
from_secret: ssh-host
key:
from_secret: ssh-key
port:
from_secret: ssh-port
script:
- rm -f env-huginn
- "echo \"export LOCAL_DOCKER_REGISTRY='$${LOCAL_DOCKER_REGISTRY}'\" >> env-huginn # \"local-docker-registry\""
- "echo \"export REGISTRY_PASSWORD='$${REGISTRY_PASSWORD}'\" >> env-huginn # \"registry-password\""
- "echo \"export SMTP_DOMAIN='$${SMTP_DOMAIN}'\" >> env-huginn # \"smtp-domain\""
- "echo \"export SMTP_USER_NAME='$${SMTP_USER_NAME}'\" >> env-huginn # \"smtp-user-name\""
- "echo \"export SMTP_SERVER='$${SMTP_SERVER}'\" >> env-huginn # \"smtp-server\""
- "echo \"export EMAIL_FROM_ADDRESS='$${EMAIL_FROM_ADDRESS}'\" >> env-huginn # \"email-from-address\""
- "echo \"export SMTP_PORT='$${SMTP_PORT}'\" >> env-huginn # \"smtp-port\""
- "echo \"export SMTP_PASSWORD='$${SMTP_PASSWORD}'\" >> env-huginn # \"smtp-password\""
- "echo \"export INVITATION_CODE='$${INVITATION_CODE}'\" >> env-huginn # \"invitation-code\""
- "echo \"export DATABASE_PASSWORD='$${DATABASE_PASSWORD}'\" >> env-huginn # \"database-password\""
username:
from_secret: ssh-user
environment:
DATABASE_PASSWORD:
from_secret: database-password
EMAIL_FROM_ADDRESS:
from_secret: email-from-address
INVITATION_CODE:
from_secret: invitation-code
LOCAL_DOCKER_REGISTRY:
from_secret: local-docker-registry
REGISTRY_PASSWORD:
from_secret: registry-password
SMTP_DOMAIN:
from_secret: smtp-domain
SMTP_PASSWORD:
from_secret: smtp-password
SMTP_PORT:
from_secret: smtp-port
SMTP_SERVER:
from_secret: smtp-server
SMTP_USER_NAME:
from_secret: smtp-user-name
- name: scp
image: appleboy/drone-scp:1.6.2
settings:
command_timeout: 2m
host:
from_secret: ssh-host
key:
from_secret: ssh-key
port:
from_secret: ssh-port
source:
- .
target: /stack/huginn
username:
from_secret: ssh-user
- name: wait
image: alpine
commands:
- sleep 15
- name: "dockerbuild:"
image: docker:dind
commands:
- set -e
- sh .drone/login.sh
- sh .drone/build.sh
- sh .drone/push.sh
- sh .drone/logout.sh
environment:
LOCAL_DOCKER_REGISTRY:
from_secret: local-docker-registry
REGISTRY_PASSWORD:
from_secret: registry-password
volumes:
- name: dockersock
path: /var/run
- name: deploy
image: appleboy/drone-ssh:1.6.2
settings:
envs:
- drone_tag
- drone_commit
- drone_build_number
- drone_repo_name
- drone_repo_namespace
- smtp_domain
- smtp_user_name
- smtp_server
- email_from_address
- smtp_port
- smtp_password
- invitation_code
- database_password
- local_docker_registry
- registry_password
host:
from_secret: ssh-host
key:
from_secret: ssh-key
port:
from_secret: ssh-port
script:
- export SMTP_PASSWORD=$${SMTP_PASSWORD}
- export INVITATION_CODE=$${INVITATION_CODE}
- export DATABASE_PASSWORD=$${DATABASE_PASSWORD}
- export SMTP_DOMAIN=$${SMTP_DOMAIN}
- export SMTP_USER_NAME=$${SMTP_USER_NAME}
- export SMTP_SERVER=$${SMTP_SERVER}
- export EMAIL_FROM_ADDRESS=$${EMAIL_FROM_ADDRESS}
- export SMTP_PORT=$${SMTP_PORT}
- export LOCAL_DOCKER_REGISTRY=$${LOCAL_DOCKER_REGISTRY}
- export REGISTRY_PASSWORD=$${REGISTRY_PASSWORD}
- set -e
- cd /stack/huginn
- sh .drone/login.sh
- sh .drone/pull.sh
- sh .drone/deploy.sh
username:
from_secret: ssh-user
environment:
DATABASE_PASSWORD:
from_secret: database-password
EMAIL_FROM_ADDRESS:
from_secret: email-from-address
INVITATION_CODE:
from_secret: invitation-code
LOCAL_DOCKER_REGISTRY:
from_secret: local-docker-registry
REGISTRY_PASSWORD:
from_secret: registry-password
SMTP_DOMAIN:
from_secret: smtp-domain
SMTP_PASSWORD:
from_secret: smtp-password
SMTP_PORT:
from_secret: smtp-port
SMTP_SERVER:
from_secret: smtp-server
SMTP_USER_NAME:
from_secret: smtp-user-name
services:
- name: docker
image: docker:dind
privileged: true
volumes:
- name: dockersock
path: /var/run
- name: ca
path: /etc/docker/certs.d
volumes:
- name: dockersock
temp: {}
- name: ca
host:
path: /etc/docker/certs.d
...

View File

@ -0,0 +1,7 @@
[
'smtp-domain',
'smtp-user-name',
'smtp-server',
'email-from-address',
'smtp-port',
]

View File

@ -0,0 +1,5 @@
[
"smtp-password",
"invitation-code",
"database-password",
]

1
.drone/login.sh Normal file
View File

@ -0,0 +1 @@
docker login ${LOCAL_DOCKER_REGISTRY} --username client --password "${REGISTRY_PASSWORD}"

1
.drone/logout.sh Normal file
View File

@ -0,0 +1 @@
docker logout ${LOCAL_DOCKER_REGISTRY}

9
.drone/package.json Normal file
View File

@ -0,0 +1,9 @@
{
"private": true,
"scripts": {
"build": "drone jsonnet --source drone-home.jsonnet --target drone-home.yml --stream"
},
"dependencies": {
"@sigyl/jsonnet-drone": "^0.0.7"
}
}

1
.drone/pull.sh Normal file
View File

@ -0,0 +1 @@
echo 'nothing to pull'

1
.drone/push.sh Normal file
View File

@ -0,0 +1 @@
echo 'nothing to push'

21
.drone/yarn.lock Normal file
View File

@ -0,0 +1,21 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@sigyl/jsonnet-compose@^0.0.2":
version "0.0.2"
resolved "https://registry.yarnpkg.com/@sigyl/jsonnet-compose/-/jsonnet-compose-0.0.2.tgz#8900a21e8cd8109929b6042703f8645aacb9bcda"
integrity sha512-wWS3CgPeNi/o1pcS6n/4pafxlMD0KC9/RKMZr/ySmzeGNRW++sPuKuxajYse2TNd47uNDdeUSnk4aEeEIKL0zA==
"@sigyl/jsonnet-drone-environment@0.0.5":
version "0.0.5"
resolved "https://registry.yarnpkg.com/@sigyl/jsonnet-drone-environment/-/jsonnet-drone-environment-0.0.5.tgz#9ea85e08904777bd21a3e4b30b0b91461d0285ff"
integrity sha512-xVGmdMO1pOyozAWUbJm6mzKBgsLPJ+1hWnGCK3AxPkr7kkDh18hu30+TLzlcQtqq76s5jUfvJUztezsGj/mIcw==
"@sigyl/jsonnet-drone@^0.0.7":
version "0.0.7"
resolved "https://registry.yarnpkg.com/@sigyl/jsonnet-drone/-/jsonnet-drone-0.0.7.tgz#0f92ef15096b0c5497741ff56bfbd249de9edd66"
integrity sha512-353n/zExNnKPPZ235eLX3/DFXJVNIX8fdAeG3RvY+55538eGzDIk0/3HJd8jXsD6y0zxm+LexW5HghvXBMBOEA==
dependencies:
"@sigyl/jsonnet-compose" "^0.0.2"
"@sigyl/jsonnet-drone-environment" "0.0.5"

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
node_modules
*.log

3
.versionrc Normal file
View File

@ -0,0 +1,3 @@
{
"tagMessageInChangeLog": true
}

14
CHANGELOG.md Normal file
View File

@ -0,0 +1,14 @@
# Changelog
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
### [0.0.3](https://sigyl.com///compare/v0.0.2...v0.0.3) "chore(release): 0.0.3" (2020-08-19)
### [0.0.2](https://sigyl.com///compare/v0.0.1...v0.0.2) "chore(release): 0.0.2" (2020-08-19)
### Bug Fixes
* wrong scripts ([1909cd5](https://sigyl.com///commit/1909cd514390ea5697fcd3e0b67363b6ce198846))
### 0.0.1 "chore(release): 0.0.1" (2020-08-19)

3
git-hooks/pre-commit Executable file
View File

@ -0,0 +1,3 @@
drone jsonnet --source .drone/drone-home.jsonnet --target .drone/drone-home.yml --stream \
&& git add .drone/drone-home.yml \
&& echo "jsonnet built"

18
package.json Normal file
View File

@ -0,0 +1,18 @@
{
"private": true,
"name": "huginn",
"version": "0.0.3",
"scripts": {
"release": "standard-version",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://sigyl.com/git/stack/huginn"
},
"author": "Giles Bradshaw",
"license": "ISC",
"devDependencies": {
"standard-version": "git+https://github.com/gilesbradshaw/standard-version.git"
}
}

1581
yarn.lock Normal file

File diff suppressed because it is too large Load Diff