initial commit
This commit is contained in:
commit
a1dfa1ba05
|
@ -0,0 +1,32 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
name: 'publish',
|
||||||
|
kind: 'pipeline',
|
||||||
|
type: 'docker',
|
||||||
|
trigger: {
|
||||||
|
event: ['tag'],
|
||||||
|
},
|
||||||
|
clone: {
|
||||||
|
disable: false,
|
||||||
|
depth: 0,
|
||||||
|
},
|
||||||
|
steps: [
|
||||||
|
{
|
||||||
|
name: 'publish',
|
||||||
|
image: 'plugins/npm',
|
||||||
|
settings: {
|
||||||
|
username: {
|
||||||
|
from_secret: 'npm-user',
|
||||||
|
},
|
||||||
|
password: {
|
||||||
|
from_secret: 'npm-password',
|
||||||
|
},
|
||||||
|
email: {
|
||||||
|
from_secret: 'npm-email',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
],
|
||||||
|
}
|
||||||
|
]
|
|
@ -0,0 +1,25 @@
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: publish
|
||||||
|
|
||||||
|
platform:
|
||||||
|
os: linux
|
||||||
|
arch: amd64
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: publish
|
||||||
|
image: plugins/npm
|
||||||
|
settings:
|
||||||
|
email:
|
||||||
|
from_secret: npm-email
|
||||||
|
password:
|
||||||
|
from_secret: npm-password
|
||||||
|
username:
|
||||||
|
from_secret: npm-user
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
event:
|
||||||
|
- tag
|
||||||
|
|
||||||
|
...
|
|
@ -0,0 +1,19 @@
|
||||||
|
# .drone
|
||||||
|
|
||||||
|
these files are used to build a yml file to specify the drone build.
|
||||||
|
|
||||||
|
To build you need to [install](https://docs.drone.io/cli/install/) drone utility.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
drone jsonnet --source .drone/.drone.jsonnet --target .drone/.drone.yml --stream
|
||||||
|
```
|
||||||
|
|
||||||
|
make a pre commit hook to compile
|
||||||
|
|
||||||
|
```shell
|
||||||
|
|
||||||
|
echo 'drone jsonnet --source .drone/.drone.jsonnet --target .drone/.drone.yml --stream' > .git/hooks/pre-commit
|
||||||
|
echo 'git add .drone/.drone.yml' >> .git/hooks/pre-commit
|
||||||
|
|
||||||
|
chmod +x .git/hooks/pre-commit
|
||||||
|
```
|
Binary file not shown.
|
@ -0,0 +1 @@
|
||||||
|
node_modules
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"compareUrlFormat": "{{repoUrl}}/compare/{{previousTag}}...{{currentTag}}"
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
MIT License Copyright (c) <year> <copyright holders>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is furnished
|
||||||
|
to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice (including the next
|
||||||
|
paragraph) shall be included in all copies or substantial portions of the
|
||||||
|
Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
|
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
|
||||||
|
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||||
|
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
||||||
|
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@ -0,0 +1,31 @@
|
||||||
|
# @sigyl/jsonnet-drone-environment
|
||||||
|
|
||||||
|
drone environment functionality
|
||||||
|
|
||||||
|
## release
|
||||||
|
|
||||||
|
use https://www.conventionalcommits.org/en/v1.0.0/ to control releases.
|
||||||
|
|
||||||
|
to release
|
||||||
|
|
||||||
|
```shell
|
||||||
|
yarn release
|
||||||
|
```
|
||||||
|
|
||||||
|
prerelease
|
||||||
|
|
||||||
|
```shell
|
||||||
|
yarn release --prerelease alpha
|
||||||
|
```
|
||||||
|
|
||||||
|
release as
|
||||||
|
|
||||||
|
```shell
|
||||||
|
yarn release --release-as 1.0.0
|
||||||
|
```
|
||||||
|
|
||||||
|
dry run
|
||||||
|
|
||||||
|
```shell
|
||||||
|
yarn release --dry-run
|
||||||
|
```
|
|
@ -0,0 +1,68 @@
|
||||||
|
{
|
||||||
|
// make secret format
|
||||||
|
secret(secret): std.asciiLower(
|
||||||
|
std.strReplace(
|
||||||
|
secret,
|
||||||
|
'_',
|
||||||
|
'-',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// make environment format
|
||||||
|
environment(secret): std.asciiUpper(
|
||||||
|
std.strReplace(
|
||||||
|
secret,
|
||||||
|
'-',
|
||||||
|
'_',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// make env format
|
||||||
|
env(secret): std.asciiLower(
|
||||||
|
std.strReplace(
|
||||||
|
secret,
|
||||||
|
'-',
|
||||||
|
'_',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// environment from secret
|
||||||
|
fromSecret(name): {
|
||||||
|
from_secret: name,
|
||||||
|
},
|
||||||
|
// set an environment and an env for ssh
|
||||||
|
envSet(env): function(step) step {
|
||||||
|
environment +: {
|
||||||
|
[$.environment(env)]: $.fromSecret(
|
||||||
|
$.secret(env)
|
||||||
|
),
|
||||||
|
},
|
||||||
|
settings +: {
|
||||||
|
envs +: [
|
||||||
|
$.env(env),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
// set an environment to a value
|
||||||
|
envValue(env, value): function(step) step {
|
||||||
|
environment +: {
|
||||||
|
[$.environment(env)]: value,
|
||||||
|
},
|
||||||
|
settings +: {
|
||||||
|
envs +: [
|
||||||
|
$.env(env),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
// makes environment variables and corresponding secrets
|
||||||
|
environmentSecrets(vars):
|
||||||
|
std.foldl(
|
||||||
|
function(obj, value)
|
||||||
|
obj {
|
||||||
|
[$.environment(value)]: $.fromSecret(
|
||||||
|
$.secret(
|
||||||
|
value,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
},
|
||||||
|
vars,
|
||||||
|
{},
|
||||||
|
),
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
{
|
||||||
|
"name": "@sigyl/jsonnet-drone-environment",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"description": "function compose",
|
||||||
|
"main": "compose.libsonnet",
|
||||||
|
"scripts": {
|
||||||
|
"publish": "git push --follow-tags origin master && npm publish",
|
||||||
|
"release": "standard-version",
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://sigyl.com/git/sigyl/jsonnet-drone-environment.git"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"jsonnet",
|
||||||
|
"drone"
|
||||||
|
],
|
||||||
|
"author": "giles bradshaw",
|
||||||
|
"license": "MIT",
|
||||||
|
"devDependencies": {
|
||||||
|
"standard-version": "^8.0.2"
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue