Addon build updates
This commit is contained in:
parent
0190ccdfd3
commit
d5bd58ac3e
5 changed files with 25 additions and 16 deletions
|
|
@ -1,15 +1,10 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
base_path = '/opt/zammad/contrib/link/addons'
|
packages = Dir.glob('/opt/zammad/contrib/link/addons/*')
|
||||||
|
|
||||||
packages = Dir.glob("#{base_path}/*")
|
|
||||||
|
|
||||||
puts "Available packages: #{packages}"
|
|
||||||
puts "Installed packages: #{Package.all.map(&:version)}"
|
|
||||||
|
|
||||||
packages.each do |package|
|
packages.each do |package|
|
||||||
puts "Installing #{package} package..."
|
puts "Installing #{package} package..."
|
||||||
Package.install(file: package, reinstall: true)
|
Package.install(file: package)
|
||||||
rescue StandardError => e
|
rescue StandardError => e
|
||||||
puts "Error #{e.message}"
|
puts e.message
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
|
||||||
import { promises as fs } from "fs";
|
import { promises as fs } from "fs";
|
||||||
|
import { promisify } from "util";
|
||||||
|
import glob from "glob";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import os from "os";
|
import os from "os";
|
||||||
|
|
||||||
|
|
@ -17,7 +19,7 @@ const packageFile = async (actualPath: string): Promise<any> => {
|
||||||
encode: "base64",
|
encode: "base64",
|
||||||
content,
|
content,
|
||||||
};
|
};
|
||||||
}
|
};
|
||||||
|
|
||||||
const packageFiles = async () => {
|
const packageFiles = async () => {
|
||||||
const packagedFiles: any[] = [];
|
const packagedFiles: any[] = [];
|
||||||
|
|
@ -39,7 +41,7 @@ const packageFiles = async () => {
|
||||||
|
|
||||||
await processDir("./src/");
|
await processDir("./src/");
|
||||||
return packagedFiles;
|
return packagedFiles;
|
||||||
}
|
};
|
||||||
|
|
||||||
export const createZPM = async ({ name, displayName, version }: Record<string, string>) => {
|
export const createZPM = async ({ name, displayName, version }: Record<string, string>) => {
|
||||||
const files = await packageFiles();
|
const files = await packageFiles();
|
||||||
|
|
@ -52,16 +54,28 @@ export const createZPM = async ({ name, displayName, version }: Record<string, s
|
||||||
buildhost: os.hostname(),
|
buildhost: os.hostname(),
|
||||||
builddate: new Date().toISOString(),
|
builddate: new Date().toISOString(),
|
||||||
files
|
files
|
||||||
}
|
};
|
||||||
const pkg = JSON.stringify(skeleton, null, 2);
|
const pkg = JSON.stringify(skeleton, null, 2);
|
||||||
|
|
||||||
|
try {
|
||||||
|
const gs = promisify(glob);
|
||||||
|
const files = await gs(`../../docker/zammad/addons/${name}-v*.zpm`);
|
||||||
|
|
||||||
|
for (const file of files) {
|
||||||
|
await fs.unlink(file);
|
||||||
|
console.log(`${file} was deleted`);
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
await fs.writeFile(`../../docker/zammad/addons/${name}-v${version}.zpm`, pkg, 'utf-8');
|
await fs.writeFile(`../../docker/zammad/addons/${name}-v${version}.zpm`, pkg, 'utf-8');
|
||||||
}
|
};
|
||||||
|
|
||||||
const main = async () => {
|
const main = async () => {
|
||||||
const packageJSON = JSON.parse(await fs.readFile("./package.json", "utf-8"));
|
const packageJSON = JSON.parse(await fs.readFile("./package.json", "utf-8"));
|
||||||
const { name, displayName, version } = packageJSON;
|
const { name, displayName, version } = packageJSON;
|
||||||
console.log(`Building addon ${displayName} v${version}`);
|
console.log(`Building addon ${displayName} v${version}`);
|
||||||
await createZPM({ name, displayName, version });
|
await createZPM({ name, displayName, version });
|
||||||
}
|
};
|
||||||
|
|
||||||
main();
|
main();
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "zammad-addon-pgp",
|
"name": "zammad-addon-pgp",
|
||||||
"displayName": "PGP",
|
"displayName": "PGP",
|
||||||
"version": "2.0.2",
|
"version": "2.0.0",
|
||||||
"description": "Adds PGP integration into [Zammad](https://zammad.org) via [Sequoia](https://sequoia-pgp.org).",
|
"description": "Adds PGP integration into [Zammad](https://zammad.org) via [Sequoia](https://sequoia-pgp.org).",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "node ../../node_modules/zammad-addon-common/dist/build.js",
|
"build": "node ../../node_modules/zammad-addon-common/dist/build.js",
|
||||||
|
|
|
||||||
|
|
@ -584,7 +584,7 @@ class App.UiElement.ApplicationAction
|
||||||
options: {
|
options: {
|
||||||
'no': __('Do not sign email')
|
'no': __('Do not sign email')
|
||||||
'discard': __('Sign email (if not possible, discard notification)')
|
'discard': __('Sign email (if not possible, discard notification)')
|
||||||
'always': __('Sign daha email (if not possible, send notification anyway)')
|
'always': __('Sign email (if not possible, send notification anyway)')
|
||||||
}
|
}
|
||||||
value: meta.sign
|
value: meta.sign
|
||||||
translate: true
|
translate: true
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<h2><%- @T('Default Behavior') %></h2>
|
<h2><%- @T('Default Behavior') %></h2>
|
||||||
<p>Choose the default behavior of the PGP integration on per group basis. If signing or encrypting is not possible, the setting has no effect. Agents call always manually alter the behavior for each article.</p>
|
<p>Choose the default behavior of the PGP integration on per group basis. If signing or encrypting is not possible, the setting has no effect. Agents can always manually alter the behavior for each article.</p>
|
||||||
<div class="settings-entry settings-entry--stretched js-groupList"></div>
|
<div class="settings-entry settings-entry--stretched js-groupList"></div>
|
||||||
<div class="btn btn--primary js-updateGroup"><%- @T('Update') %></div>
|
<div class="btn btn--primary js-updateGroup"><%- @T('Update') %></div>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue