<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>net.n2oapp.framework</groupId>
        <artifactId>framework</artifactId>
        <version>7.29.6</version>
        <relativePath>../..</relativePath>
    </parent>

    <artifactId>docusaurus</artifactId>
    <name>docusaurus</name>
    <packaging>jar</packaging>

    <properties>
        <maven.deploy.skip>true</maven.deploy.skip>
        <sandboxUrl>https://sandbox.i-novus.ru</sandboxUrl>
        <sandboxStandsUrl>https://next-n2o.i-novus.ru/sandbox/stands</sandboxStandsUrl>
        <docusaurusUrl>/</docusaurusUrl>
    </properties>


    <build>
        <plugins>

            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>3.0.0</version>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <target>
                                <echo file="${basedir}/src/ci-config.json">{
    "sandboxUrl": "${sandboxUrl}",
    "n2oVersion": "${project.version}",
    "docusaurusUrl": "${docusaurusUrl}",
    "sandboxStandsUrl": "${sandboxStandsUrl}"
}
                                </echo>
                            </target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>3.1.0</version>
                <executions>
                    <execution>
                        <id>yarn install --immutable</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <configuration>
                            <executable>yarn</executable>
                            <arguments>
                                <argument>install</argument>
                            </arguments>
                        </configuration>
                    </execution>

                    <!-- yarn build -->
                    <execution>
                        <id>yarn run build</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <configuration>
                            <executable>yarn</executable>
                            <arguments>
                                <argument>run</argument>
                                <argument>build</argument>
                            </arguments>
                            <environmentVariables>
                                <NODE_OPTIONS>--max_old_space_size=4096</NODE_OPTIONS>
                            </environmentVariables>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
