From bd7ab233bb7c2b165835bc4c3b9ef9fdc3fe08ca Mon Sep 17 00:00:00 2001 From: Uwe Jakobeit Date: Sun, 29 Mar 2026 15:42:50 +0200 Subject: [PATCH] initial commit --- CMakeLists.txt | 13 +++++++++++++ Jenkinsfile | 38 ++++++++++++++++++++++++++++++++++++++ jenkins-gitea-setup | 2 ++ main.cpp | 6 ++++++ 4 files changed, 59 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 Jenkinsfile create mode 100644 jenkins-gitea-setup create mode 100644 main.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..31e1ab9 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.16) +project(hello_cpp LANGUAGES CXX) + +# Set C++ standard +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +# Define the executable +add_executable(hello_app src/main.cpp) + +# Optional: Link libraries if needed +# find_package(Boost REQUIRED) +# target_link_libraries(hello_app Boost::boost) diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..5adb1c5 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,38 @@ +pipeline { + agent any // Or use 'dockerfile' if running in a container + stages { + stage('Checkout') { + steps { + // Checks out the source code from the configured Gitea SCM + checkout scm + } + } + stage('Clean') { + steps { + //sh 'rm -rf build' + echo "Building branch ${env.BRANCH_NAME}" + } + } + stage('Configure') { + steps { + // Configure CMake to generate build files in the 'build' directory + sh 'cmake -B build -S .' + echo "Configure project" + } + } + stage('Build') { + steps { + // Build the project using the generated files + //sh 'cmake --build build' + echo "Build project" + } + } + stage('Test') { + steps { + // Run the executable to verify it works + //sh './build/hello_app' + echo "Test project" + } + } + } +} diff --git a/jenkins-gitea-setup b/jenkins-gitea-setup new file mode 100644 index 0000000..94f6c08 --- /dev/null +++ b/jenkins-gitea-setup @@ -0,0 +1,2 @@ +gitea: jenkins-token (konfigurierter token name ) +094de7fbbe47920bccd25af0527801c3ac7c0068 diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..f42010b --- /dev/null +++ b/main.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + std::cout << "Hello from C++ with CMake!" << std::endl; + return 0; +}