1
0
forked from Kieran/snort

Try fix drone tag

This commit is contained in:
Kieran 2023-07-03 13:23:45 +01:00
parent 6ffa314694
commit 6851fe0b2b
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
2 changed files with 57 additions and 16 deletions

View File

@ -98,6 +98,45 @@ steps:
- 'git commit -a -m "chore: Update translations"'
- git push -u origin main
volumes:
- name: cache
claim:
name: docker-cache
---
kind: pipeline
type: kubernetes
name: docker-release
concurrency:
limit: 1
trigger:
event:
- tag
metadata:
namespace: git
steps:
- name: Build site
image: node:current-bullseye
volumes:
- name: cache
path: /cache
environment:
YARN_CACHE_FOLDER: /cache/.yarn-docker-release
commands:
- yarn install
- yarn build
- name: build docker image
image: r.j3ss.co/img
privileged: true
volumes:
- name: cache
path: /cache
environment:
TOKEN:
from_secret: docker_hub
commands:
- img login -u voidic -p $TOKEN
- img build -t voidic/snort:$DRONE_TAG --platform linux/amd64,linux/arm64 -f Dockerfile.prebuilt .
- img push voidic/snort:$DRONE_TAG
volumes:
- name: cache
claim:
name: docker-cache

View File

@ -245,22 +245,24 @@ export class ReplaceableNoteStore extends HookedNoteStore<Readonly<TaggedRawEven
}
/**
* A note store that holds a single replaceable event per pubkey
* General use note store based on kind ranges
*/
export class PubkeyReplaceableNoteStore extends KeyedReplaceableNoteStore {
export class NoteCollection extends KeyedReplaceableNoteStore {
constructor() {
super(e => e.pubkey);
super((e) => {
const legacyReplaceable = [0, 3, 41]
if (e.kind >= 30_000 && e.kind < 40_000) {
return `${e.kind}:${e.pubkey}:${findTag(e, "d")}`; // Parameterized replaceable
} else if (e.kind >= 10_000 && e.kind < 20_000) {
return `${e.kind}:${e.pubkey}`; // Replaceable event
} else if (legacyReplaceable.includes(e.kind)) {
return `${e.kind}:${e.pubkey}`; // Replaceable event
} else {
// Regular event
// ephemeral events are like regular events
// unknown kind
return e.id;
}
})
}
}
/**
* A note store that holds a single replaceable event per "pubkey-dtag"
*/
export class ParameterizedReplaceableNoteStore extends KeyedReplaceableNoteStore {
constructor() {
super(ev => {
const dTag = findTag(ev, "d");
return `${ev.pubkey}-${dTag}`;
});
}
}
}