fix: use built in schema when executing container command
This commit is contained in:
parent
59f8d9cc7e
commit
5768224b72
|
@ -7,6 +7,7 @@ RUN apk add --update jq \
|
||||||
ENV PATH="${PATH}:$(yarn global bin)"
|
ENV PATH="${PATH}:$(yarn global bin)"
|
||||||
|
|
||||||
WORKDIR /salty-dog
|
WORKDIR /salty-dog
|
||||||
|
ENV SALTY_DOG_SCHEMA /salty-dog/rules/salty-dog.yml
|
||||||
|
|
||||||
# copy config, which changes rarely
|
# copy config, which changes rarely
|
||||||
COPY docs/config-docker.yml /root/.salty-dog.yml
|
COPY docs/config-docker.yml /root/.salty-dog.yml
|
||||||
|
|
|
@ -8,6 +8,7 @@ RUN apt-get update -y \
|
||||||
ENV PATH="${PATH}:$(yarn global bin)"
|
ENV PATH="${PATH}:$(yarn global bin)"
|
||||||
|
|
||||||
WORKDIR /salty-dog
|
WORKDIR /salty-dog
|
||||||
|
ENV SALTY_DOG_SCHEMA /salty-dog/rules/salty-dog.yml
|
||||||
|
|
||||||
# copy config, which changes rarely
|
# copy config, which changes rarely
|
||||||
COPY docs/config-docker.yml /root/.salty-dog.yml
|
COPY docs/config-docker.yml /root/.salty-dog.yml
|
||||||
|
|
|
@ -237,8 +237,16 @@ export async function resolveRules(rules: Array<Rule>, selector: RuleSelector):
|
||||||
return Array.from(activeRules);
|
return Array.from(activeRules);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getSchemaPath(): string {
|
||||||
|
if (doesExist(process.env.SALTY_DOG_SCHEMA)) {
|
||||||
|
return process.env.SALTY_DOG_SCHEMA;
|
||||||
|
} else {
|
||||||
|
return join(dirName(), 'rules', 'salty-dog.yml');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export function loadSchema(): any {
|
export function loadSchema(): any {
|
||||||
const path = join(dirName(), 'rules', 'salty-dog.yml');
|
const path = getSchemaPath();
|
||||||
const data = readFileSync(path, { encoding: 'utf-8' });
|
const data = readFileSync(path, { encoding: 'utf-8' });
|
||||||
|
|
||||||
if (doesExist(data)) {
|
if (doesExist(data)) {
|
||||||
|
|
Loading…
Reference in New Issue