Giter VIP home page Giter VIP logo

coolest-game's Introduction

Summary

A small project to showcase build and test automation of a C++ project using Cmake/gtest with a Jenkins (jcasc) dockerized solution.

Prerequisites:

  • docker (version: 20.10.21+)
  • cmake (version: 3.10.2+)
  • g++ (version: 7.5.0+)

sudo apt update && sudo apt install build-essentials g++ cmake python2 docker-engine

For detailed docker installation see: https://docs.docker.com/engine/install/ubuntu/

  • Set Github personal token to read from the repositories

export git_token="###"

NOTE: The GitHub personal token shall be used to access this GitHub repository inside the jobs and will be provided separately.

How To Build and Run Locally

Build

Either clone the repository https://github.com/lmashraf/coolest-game or get the sources from the provided zip file. Then simply run the following script:

./build.sh -b [game | test | all] -d <build_directory> -t [Debug | Release]

eg. : ./build.sh -t all -d build -b Debug for help, run ./build.sh -h

Based on the command shown on the example above, the build and test binaries shall be generated inside the build/game and build/game/test/ folders respectively.

Run

  • Run executables: ./build/game/CoolestGame_run
  • Run tests: ./build/game/CoolestGame_test

test execution

How To Run on Jenkins

Start the Jenkins Container

The project contains two subfolders for CI :

  • jenkins: a folder that has all jenkins configuration presets such as JCASC file configuration, jenkins plugins and seed_job script as well as a few scripts to spin up the Jenkins instance.
  • pipelines: a folder with the Jenkinsfile pipeline scripts that shall run inside the generated jobs
  1. From inside the jenkins folder, simply run ./run_jenkins.sh.
  2. Optionally: While the Jenkins instance is up and running, execute ./fix_docker_permissions.sh to fix permission issues related to docker inside the Jenkins container.
  3. The Jenkins instance starts on https://localhost:8080 with the admin credentials defined in the Dockerfile (admin:p@55w0rd)

login

Build and Test on Jenkins

  1. Run the seed_jobs for the first time.

seed jobs

  1. then go to Manage Jenkins > Security > In-process Script Approval and approve both jobs' scripts.

script approval

script approval

script approval

  1. Rerun the seed_jobs to generate our 2 pipeline jobs.

script approval

  1. Run any of the build jobs as necessary (Release or Debug).

script approval

coolest-game's People

Contributors

lmashraf avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.