сохранение и публикация файлов вывода при установке сапфора на сервере.

возможность указать автоматическую сборку сапфора после публикации компонента.
This commit is contained in:
2023-11-14 00:56:05 +03:00
parent 362d6b56ee
commit 38eea01f5c
14 changed files with 102 additions and 69 deletions

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="Repository.Component.UI.PublishFields">
<grid id="27dc6" binding="content" layout-manager="GridLayoutManager" row-count="7" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="27dc6" binding="content" layout-manager="GridLayoutManager" row-count="8" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="500" height="400"/>
@@ -23,7 +23,7 @@
</component>
<scrollpane id="b33e5">
<constraints>
<grid row="6" column="0" row-span="1" col-span="3" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<grid row="7" column="0" row-span="1" col-span="3" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
@@ -39,7 +39,7 @@
</scrollpane>
<component id="fbdf3" class="javax.swing.JLabel">
<constraints>
<grid row="5" column="0" row-span="1" col-span="3" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="6" column="0" row-span="1" col-span="3" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
@@ -49,7 +49,7 @@
</component>
<component id="21340" class="javax.swing.JCheckBox" binding="cbForceMail">
<constraints>
<grid row="1" column="0" row-span="1" col-span="3" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="2" column="0" row-span="1" col-span="3" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="0"/>
@@ -60,7 +60,7 @@
</component>
<component id="148fa" class="javax.swing.JCheckBox" binding="cbUpdateMinimalVersion">
<constraints>
<grid row="2" column="0" row-span="1" col-span="3" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="3" column="0" row-span="1" col-span="3" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="0"/>
@@ -71,7 +71,7 @@
</component>
<component id="b1e6f" class="javax.swing.JLabel">
<constraints>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="0"/>
@@ -80,7 +80,7 @@
</component>
<component id="7e269" class="javax.swing.JLabel" binding="lMinimalVersion">
<constraints>
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="1"/>
@@ -89,12 +89,12 @@
</component>
<hspacer id="37705">
<constraints>
<grid row="3" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
<grid row="4" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
<component id="128e5" class="javax.swing.JLabel">
<constraints>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="0"/>
@@ -103,13 +103,24 @@
</component>
<component id="84e2b" class="javax.swing.JLabel" binding="lPublishingVersion">
<constraints>
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="5" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="1"/>
<text value="?"/>
</properties>
</component>
<component id="b01cb" class="javax.swing.JCheckBox" binding="cbAssemblyOnServer">
<constraints>
<grid row="1" column="0" row-span="1" col-span="3" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="0"/>
<selected value="true"/>
<text value="Собрать на сервере"/>
<verticalAlignment value="3"/>
</properties>
</component>
</children>
</grid>
</form>

View File

@@ -14,6 +14,7 @@ public class PublishFields implements DialogFields {
public JCheckBox cbUpdateMinimalVersion;
public JLabel lMinimalVersion;
public JLabel lPublishingVersion;
public JCheckBox cbAssemblyOnServer;
public PublishFields() {
cbNeedsBroadcast.addActionListener(new ActionListener() {
@Override

View File

@@ -135,11 +135,13 @@ public abstract class RepositoryServer<D extends Database> {
multipart.addBodyPart(attachmentBodyPart);
}
for (File f : directAttachements) {
MimeBodyPart attachmentBodyPart = new MimeBodyPart();
DataSource source = new FileDataSource(f);
attachmentBodyPart.setDataHandler(new DataHandler(source));
attachmentBodyPart.setFileName(f.getName());
multipart.addBodyPart(attachmentBodyPart);
if (f.exists()) {
MimeBodyPart attachmentBodyPart = new MimeBodyPart();
DataSource source = new FileDataSource(f);
attachmentBodyPart.setDataHandler(new DataHandler(source));
attachmentBodyPart.setFileName(f.getName());
multipart.addBodyPart(attachmentBodyPart);
}
}
message.setContent(multipart);
Transport.send(message);

View File

@@ -1,5 +1,4 @@
package Repository.Server;
import Common.Constants;
import Common.Database.DBObject;
import Common.Global;
import Common.Utils.Utils;
@@ -75,13 +74,6 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
Account account = null;
if (!Global.properties.OldServer) {
switch (code) {
case Patch:
Print("Очистка файлов в багрепортах");
for (BugReport bug: db.bugReports.Data.values()){
}
response = new ServerExchangeUnit_2021(ServerCode.OK);
break;
//<editor-fold desc="Регистрация">
case CheckSubscriberRole:
Print("Проверить роль пользователя");
@@ -419,7 +411,6 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
//bonus backup
if (rightNow.get(Calendar.DAY_OF_WEEK) == Calendar.MONDAY) {
Vector<String> targets = new Vector<>();
targets.add(Constants.MailAddress);
targets.addAll(Arrays.asList(Global.admins_mails));
EmailMessage message = new EmailMessage(
"db backup",

View File

@@ -73,5 +73,6 @@ public enum ServerCode {
GetFirstActiveSapforTasksPackage,
DownloadSapforTasksPackage,
Patch,
EmailSapforAssembly,
OLD
}