8000 Pass variables from jdeb plugin to postinst script · Issue #816 · tcurdt/jdeb · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Pass variables from jdeb plugin to postinst script #816
Open
@swc-kdzekov

Description

@swc-kdzekov

Hello all,

I'm working on migrating .rpm packaging to .deb for a spring boot service. For that reason I use org.vafer:jdeb:1.5.
Most of the feature that were used by the rpm maven plugin were nicely replaced by 'jdeb'. However, I haven't found how to set environmental variables carrying information from the plugin configuration to 'postinst' script. For example: installation path, application name, application version etc. I would like to keep that information in the pom file (where org.vafer:deb is configured), and then use it in postinst script.
Could somebody help here on how if that is possible ?

Here is a piece of the maven pom configuration:

`

    <app.version>1.1.1</app.version> <!-- to remove the -SNAPSHOT -->
    <app.name>cyan-phishing</app.name>
    <app.script.name>cyan-phishing-tmp.sh</app.script.name>
    <app.description>CYAN Phishing</app.description>
    <app.dir>phishing</app.dir>
    <app.base.dir>/opt/cyan/${app.dir}/${app.version}</app.base.dir>
    <app.lib.dir>${app.base.dir}/lib</app.lib.dir>
    <app.conf.dir>${app.base.dir}/configuration</app.conf.dir>
    <app.phish.dir>${app.base.dir}/phish_checker</app.phish.dir>
    <app.pid.dir>/var/run/cyan/${app.dir}/${app.version}</app.pid.dir>
    <app.log.dir>/var/log/cyan/${app.dir}/${app.version}</app.log.dir>
    <app.lock.dir>/var/lock/cyan/${app.dir}/${app.version}</app.lock.dir>
    <app.opt.dir>/var/opt/cyan/${app.dir}/</app.opt.dir>
    <app.artifact.prefix>cyan-phishing</app.artifact.prefix>
    <app.user>phishing</app.user>
    <app.group>cyan</app.group>
    <app.required.hosts>phishing-db-cl</app.required.hosts>

    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <jdeb.version>1.5</jdeb.version>

    <deb.jdk.version>jdk1.8</deb.jdk.version>
    <inew.daemon.version>2.0.9</inew.daemon.version>
    <inew.database.manager.version>1.0.2</inew.database.manager.version>
</properties>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
                <execution>
                    <id>copy-libs</id>
                    <phase>prepare-package</phase>
                    <goals>
                        <goal>copy-dependencies</goal>
                    </goals>
                    <configuration>
                        <outputDirectory>${project.build.directory}/lib</outputDirectory>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <artifactId>jdeb</artifactId>
            <groupId>org.vafer</groupId>
            <version>${jdeb.version}</version>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>jdeb</goal>
                    </goals>
                    <configuration>
                        <controlDir>${basedir}/src/deb/control</controlDir>
                        <dataSet>
                            <data>
                                <src>${basedir}/src/main/resources/scripts/${app.script.name}</src>
                                <type>file</type>
                                <mapper>
                                    <type>perm</type>
                                    <prefix>${app.base.dir}</prefix>
                                </mapper>
                            </data>
                            <data>
                                <src>${project.build.directory}/lib</src>
                                <type>directory</type>
                                <mapper>
                                    <type>perm</type>
                                    <prefix>${app.base.dir}/lib</prefix>
                                </mapper>
                            </data>
                            <data>
                                <src>src/main/resources/configuration</src>
                                <type>directory</type>
                                <mapper>
                                    <type>perm</type>
                                    <prefix>${app.base.dir}/configuration</prefix>
                                </mapper>
                            </data>
                            <!-- copy the debian jar file in the lib folder -->
                            <data>
                                <src>${project.build.directory}/${project.artifactId}-${project.version}.jar</src>
                                <type>file</type>
                                <mapper>
                                    <type>perm</type>
                                    <prefix>${app.base.dir}/lib</prefix>
                                </mapper>
                            </data>
                        </dataSet>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>`

Best Regards,
Konstantin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0