D++ (DPP)
C++ Discord API Bot Library
|
First of all, you'll want to create your project. For this, we'll use a "Freestyle project" as we're just going to be calling some bash commands to tell CMake to build. We'll be calling this "DiscordBot" but you can name it whatever you want. I would advise against non-ASCII characters.
From here, just hit Ok
and now you've created your Jenkins project, Well done! From here you can add a description, change the security policy (if your Jenkins is public), really whatever your heart desires.
Scrolling down, you'll find Build Steps
. You can also click Build Steps
on the left. Here, you'll want to hit Add build step
and hit Execute shell
.
Inside of this, you'll want to enter this script below.
This script will build your project for you and also set up CMake if you've deleted the build directory, allowing you to easily refresh CMake. You can change this to a build parameter if you want, meaning you can hit Build with Parameters
and state what you'd like to do. This would require the script to be changed so only do that if you know what you're doing!
Now you can hit save!
Making sure you have your project files in the workspace directory (you can see this by pressing Workspace
on the left, the files will automatically be pulled from GitHub if you're using the GitHub plugin), you should be able to hit Build Now
and see a new build in the History appear. If everything went well, you should have a green tick!
cmake ..
), especially on less-powerful machines, so don't be alarmed!Running the builds is the same as any other time, but we'll still cover it! However, we won't cover running it in background and whatnot, that part is completely down to you.
First, you need to get into the jenkins
user. If you're like me and don't have the Jenkins user password, you can login with your normal login (that has sudo perms) and do sudo su - jenkins
. Once logged in, you'll be in /var/lib/jenkins/
. From here, you'll want to do cd workspace/DiscordBot/
(make sure to replace "DiscordBot" with your bot's name. Remember, you can tab-complete this) and then cd build
. Now, you can simply do ./DiscordBot
!
Once you're happy with everything, then you're good to go! Enjoy your automated builds!
Sometimes, doing ./DiscordBot
can end up with an error, saying you don't have permission to execute. If that's the case, simply do chmod +x DiscordBot
and now you can re-run ./DiscordBot
.