Skip to content

Deployment

Mihou edited this page Nov 17, 2021 · 1 revision

🈂️ Deployment

Velen offers no customized build method but there are still a few precautions that you have to take before deploying to production.

📶 Precautions

  1. If you are using .velen files and are not fetching them from resources, remember to copy the folders that contain the .velen files since Velen doesn't compile or do anything with the files other than reading and parsing them.
  2. Ensure that all the configurations such as Discord Token are stored inside Environmental Variables or through a .env file, you can use Dotenv Library to automatically map configuration values from .env and Environmental Variables onto an object.

📖 Recommendations

Velen requires no other configuration for deployment other than those, how to deploy the Discord bot is completely up to you but we generally recommend using Gradle's Application feature or Maven's Appassembler to build.

🔴 Please do not blindly copy these, change any pw.mihou.Velen.Velen to the direction of your main class. An example of Gradle's Application would be:

plugins {
    id 'application'
}

application {
    mainClass = 'pw.mihou.Velen.Velen'
}

An example of Maven's Appassembler would be:

 <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>appassembler-maven-plugin</artifactId>
                <version>2.1.0</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>assemble</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <programs>
                        <program>
                            <mainClass>pw.mihou.Velen.Velen</mainClass>
                            <id>Velen</id>
                        </program>
                    </programs>
                </configuration>
            </plugin>
        </plugins>
</build>

For more details, please view the following: