service_template
service_template copied to clipboard
Template of a C++ service that uses userver framework. Build, test and CI scripts ready
service_template
Template of a C++ service that uses userver framework.
Download and Build
To create your own userver-based service follow the following steps:
- Press the green "Use this template button" at the top of this github page
- Clone the service
git clone your-service-repo && cd your-service-repo && git submodule update --init
- Give a proper name to your service and replace all the occurences of "service_template" string with that name
- Feel free to tweak, adjust or fully rewrite the source code of your service.
Makefile
Makefile contains typicaly useful targets for development:
-
make build-debug
- debug build of the service with all the assertions and sanitizers enabled -
make build-release
- release build of the service with LTO -
make test-debug
- does amake build-debug
and runs all the tests on the result -
make test-release
- does amake build-release
and runs all the tests on the result -
make service-start-debug
- builds the service in debug mode and starts it -
make service-start-release
- builds the service in release mode and starts it -
make
ormake all
- builds and runs all the tests in release and debug modes -
make format
- autoformat all the C++ and Python sources -
make clean-
- cleans the object files -
make dist-clean
- clean all, including the CMake cached configurations -
make install
- does amake build-release
and run install in directory set in environmentPREFIX
-
make install-debug
- does amake build-debug
and runs install in directory set in environmentPREFIX
-
make docker-COMMAND
- runmake COMMAND
in docker environment -
make docker-build-debug
- debug build of the service with all the assertions and sanitizers enabled in docker environment -
make docker-test-debug
- does amake build-debug
and runs all the tests on the result in docker environment -
make docker-start-service
- does amake install-debug
and runs service in docker environment -
make docker-start-service-debug
- does amake install-debug
and runs service in docker environment
Edit Makefile.local
to change the default configuration and build options.
License
The original template is distributed under the Apache-2.0 License and CLA. Services based on the template may change the license and CLA.