Skip to content

Commit

Permalink
chore: update repo configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
OGKevin committed Oct 30, 2023
1 parent d3e4ccc commit 8ea6d90
Show file tree
Hide file tree
Showing 6 changed files with 696 additions and 0 deletions.
1 change: 1 addition & 0 deletions .drone-templates
Submodule .drone-templates added at b14fdc
135 changes: 135 additions & 0 deletions .drone.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
local common = import '.drone-templates/common.libsonnet';
local images = import '.drone-templates/images.libsonnet';
local jsonnet = import '.drone-templates/jsonnet.libsonnet';
local renovate = import '.drone-templates/renovate.libsonnet';

local nodeImage = 'node:18-buster';

local koboPipeline = [
common.defaultPushTrigger + common.platform + {
kind: 'pipeline',
name: 'npm',
type: 'docker',
steps: [
{
name: 'set aws credentials',
image: images.debian.image + ':' + images.debian.version,
environment: {
CONFIG: {
from_secret: 'aws',
},
},
commands: [
'echo "$CONFIG" > /root/.aws/credentials',
],
volumes: [
{
name: 'aws-config',
path: '/root/.aws',
},
],
},
{
name: 'copy kobo database',
image: 'docker.io/amazon/aws-cli:2.13.15@sha256:ac2c7d3827a8fef1024357ada9c6ccd8d0ce098a85cffd6803a52bb8cb4842ed',
commands: [
'aws --endpoint-url http://100.82.97.39:9000 s3 cp s3://repo-obsidian-kobo-highlights-import/KoboReader.sqlite /drone/src/KoboReader.sqlite',
],
volumes: [
{
name: 'aws-config',
path: '/root/.aws',
},
],
},
{
name: 'install',
image: nodeImage,
volumes: [
{
name: 'node_modules',
path: '/drone/src/node_modules',
},
],
commands: [
'npm install',
],
},
{
name: 'lint',
image: nodeImage,
volumes: [
{
name: 'node_modules',
path: '/drone/src/node_modules',
},
],
commands: [
'npm run lint',
],
depends_on: [
'install',
],
},
{
name: 'test',
image: nodeImage,
volumes: [
{
name: 'node_modules',
path: '/drone/src/node_modules',
},
],
commands: [
'npm run test',
],
depends_on: [
'install',
'copy kobo database',
],
},
{
name: 'build',
image: nodeImage,
volumes: [
{
name: 'node_modules',
path: '/drone/src/node_modules',
},
],
commands: [
'npm run build',
],
depends_on: [
'install',
],
},
],
volumes: [
{
name: 'node_modules',
host: {
path: '/tmp/node_modules/kobo',
},
},
{
name: 'aws-config',
temp: {},
},
],
},
{
kind: 'secret',
name: 'aws',
get: {
path: 'secret/data/ci/aws',
name: 'credentials',
},
},
];

renovate + jsonnet + koboPipeline +
[
x[1]
for x in common.f.kv(common.secrets)
]
Loading

0 comments on commit 8ea6d90

Please sign in to comment.