Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ tests/**/__pycache__/
tests/test_data/test_repo
tests/test_data/example/package
/tests/test_data/test_sysroot
tests/test_data/test_context
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,19 @@ Packager. More information about Apps is in [UseCaseScenarios](./doc/UseCaseScen
2. Build Docker image needed for the build:

```bash
bap-builder build-image --context ./example_context --image-name debian12
bap-builder build-image --context ./example_context --image-name debian13
```

3. Build all Packages for the given distro:

```bash
bap-builder build-package --context ./example_context --image-name debian12 --output-dir ./lfsrepo --all
bap-builder build-package --context ./example_context --image-name debian13 --output-dir ./lfsrepo --all
```

4. Create sysroot for built Packages:

```bash
bap-builder create-sysroot --context ./example_context --image-name debian12 --git-lfs ./lfsrepo --sysroot-dir ./new_sysroot
bap-builder create-sysroot --context ./example_context --image-name debian13 --git-lfs ./lfsrepo --sysroot-dir ./new_sysroot
```

**Note:** If you do not have `bap-builder` in your system path, you need to use `./cmd/bap-builder/bap-builder` instead of `bap-builder`.
Expand Down
6 changes: 3 additions & 3 deletions example_context/app/io-module/io-module_debug.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"Env": {},
"Git": {
"URI": "https://github.com/bringauto/io-module.git",
"Revision": "v1.3.2"
"Revision": "v1.3.3"
},
"Build": {
"CMake": {
Expand All @@ -14,7 +14,7 @@
},
"Package": {
"Name": "io-module",
"VersionTag": "v1.3.2",
"VersionTag": "v1.3.3",
"PlatformString": {
"Mode": "auto"
},
Expand All @@ -25,7 +25,7 @@
"DockerMatrix": {
"ImageNames": [
"fleet-os-2",
"debian12",
"debian13",
"ubuntu2404",
"fedora40",
"fedora41"
Expand Down
6 changes: 3 additions & 3 deletions example_context/app/io-module/io-module_release.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"Env": {},
"Git": {
"URI": "https://github.com/bringauto/io-module.git",
"Revision": "v1.3.2"
"Revision": "v1.3.3"
},
"Build": {
"CMake": {
Expand All @@ -14,7 +14,7 @@
},
"Package": {
"Name": "io-module",
"VersionTag": "v1.3.2",
"VersionTag": "v1.3.3",
"PlatformString": {
"Mode": "auto"
},
Expand All @@ -25,7 +25,7 @@
"DockerMatrix": {
"ImageNames": [
"fleet-os-2",
"debian12",
"debian13",
"ubuntu2404",
"fedora40",
"fedora41"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"DockerMatrix": {
"ImageNames": [
"fleet-os-2",
"debian12",
"debian13",
"ubuntu2404",
"fedora40",
"fedora41"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"DockerMatrix": {
"ImageNames": [
"fleet-os-2",
"debian12",
"debian13",
"ubuntu2404",
"fedora40",
"fedora41"
Expand Down
44 changes: 44 additions & 0 deletions example_context/config/CMCONF_FLEET_PROTOCOLConfig.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@

# Example configuration for CMCONF system.
#

FIND_PACKAGE(CMLIB REQUIRED COMPONENTS CMCONF)

CMCONF_INIT_SYSTEM(FLEET_PROTOCOL)

#
# Setting using upstream Package Repository by default for this system. This can be overridden by
# App in CMakeLists.txt.
#
CMCONF_SET(BA_PACKAGE_LOCAL_USE OFF)
CMCONF_SET(BA_PACKAGE_LOCAL_PATH "")

#
# The http authorization header is usually used for accessing private Package Repositories. This
# example does not need it, but the variable must be set.
#
CMCONF_SET(BA_PACKAGE_HTTP_AUTHORIZATION_HEADER "")

#
# Setting BringAuto's Package Repository URI Template
#
CMCONF_SET(BA_PACKAGE_URI_REVISION master)
CMCONF_SET(BA_PACKAGE_URI_TEMPLATE_REMOTE "https://gitea.bringauto.com/fleet-protocol/package-repository/media/<REVISION>/package/<GIT_PATH>/<PACKAGE_GROUP_NAME>/<ARCHIVE_NAME>")

#
# Gitea hosted public Package Repository:
#
#CMCONF_SET(BA_PACKAGE_URI_TEMPLATE_REMOTE "https://gitea.example.com/username/repository/media/<REVISION>/package/<GIT_PATH>/<PACKAGE_GROUP_NAME>/<ARCHIVE_NAME>")

#
# Gitea hosted private Package Repository.
# Do not forget to specify Access Token
#
#CMCONF_SET(BA_PACKAGE_HTTP_AUTHORIZATION_HEADER "token <token>")
#CMCONF_SET(BA_PACKAGE_URI_TEMPLATE_REMOTE "https://gitea.example.com/username/repository/raw/<REVISION>/package/<GIT_PATH>/<PACKAGE_GROUP_NAME>/<ARCHIVE_NAME>")

#
# Gitlab hosted private Package Repository.
#
#CMCONF_SET(BA_PACKAGE_HTTP_AUTHORIZATION_HEADER "Bearer <token>")
#CMCONF_SET(BA_PACKAGE_URI_TEMPLATE_REMOTE "https://gitlab.example.com/username/repository/-/raw/<REVISION>/package/<GIT_PATH>/<PACKAGE_GROUP_NAME>/<ARCHIVE_NAME>")
17 changes: 17 additions & 0 deletions example_context/config/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

# FLEET_PROTOCOL System Configuration

This directory contains the configuration file for FLEET_PROTOCOL [CMCONF] system. It is used to set
required variables for [Package Tracker]. The most important variable is
`BA_PACKAGE_URI_TEMPLATE_REMOTE`, which sets URI of Package Repository used during builds.

This system must be installed in all Docker images.

More information about this system can be found in [Package Tracker Example].

Using this system is an example and in general Context does not need to use it.


[Package Tracker]: https://github.com/bacpack-system/package-tracker
[Package Tracker Example]: https://github.com/bacpack-system/package-tracker/tree/master/example
[CMCONF]: https://github.com/cmakelib/cmakelib-component-cmconf
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
FROM debian:12.0
FROM debian:13.0

USER root
RUN echo root:1234 | chpasswd

RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
binutils build-essential flex git libssl-dev lsb-release make pkg-config \
openssh-server patchelf software-properties-common wget libmpfr-dev libmpc-dev libgmp-dev && \
openssh-server patchelf wget libmpfr-dev libmpc-dev libgmp-dev && \
rm -rf /var/lib/apt/lists/*

RUN git clone --depth=1 --single-branch --branch=releases/gcc-13.2.0 https://gcc.gnu.org/git/gcc.git /gcc && \
cd /gcc && \
mkdir objdir

RUN cd /gcc/objdir && \
../configure --enable-languages=c,c++ --disable-multilib && \
make -j$(nproc) && \
make install

RUN wget "https://github.com/Kitware/CMake/releases/download/v3.25.2/cmake-3.25.2-linux-x86_64.sh" -O cmake.sh && \
chmod +x cmake.sh && \
./cmake.sh --skip-license --prefix=/usr/local && \
Expand All @@ -29,10 +20,12 @@ RUN apt-get update && \
rm -rf /var/lib/apt/lists/*

RUN git clone https://github.com/cmakelib/cmakelib.git /cmakelib
RUN echo "export CMLIB_DIR=/cmakelib" >> /root/.bashrc && \
echo "export CC=/usr/local/bin/gcc" >> /root/.bashrc && \
echo "export CXX=/usr/local/bin/g++" >> /root/.bashrc && \
echo "export LD_LIBRARY_PATH=/usr/local/lib64" >> /root/.bashrc
RUN echo "export CMLIB_DIR=/cmakelib" >> /root/.bashrc

# Install Fleet Protocol's CMCONF system
COPY --from=package-context config/CMCONF_FLEET_PROTOCOLConfig.cmake /etc
ENV CMLIB_DIR=/cmakelib
RUN cmake -DCMCONF_INSTALL_AS_SYMLINK=ON -P /etc/CMCONF_FLEET_PROTOCOLConfig.cmake

RUN sed -ri 's/#?PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN mkdir -p /run/sshd
Expand Down
5 changes: 5 additions & 0 deletions example_context/docker/fedora40/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ RUN dnf -y update && \
RUN git clone https://github.com/cmakelib/cmakelib.git /cmakelib
RUN echo "export CMLIB_DIR=/cmakelib" >> /root/.bashrc

# Install Fleet Protocol's CMCONF system
COPY --from=package-context config/CMCONF_FLEET_PROTOCOLConfig.cmake /etc
ENV CMLIB_DIR=/cmakelib
RUN cmake -DCMCONF_INSTALL_AS_SYMLINK=ON -P /etc/CMCONF_FLEET_PROTOCOLConfig.cmake

RUN sed -ri 's/#?PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN mkdir -p /run/sshd

Expand Down
5 changes: 5 additions & 0 deletions example_context/docker/fedora41/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ RUN dnf -y update && \
RUN git clone https://github.com/cmakelib/cmakelib.git /cmakelib
RUN echo "export CMLIB_DIR=/cmakelib" >> /root/.bashrc

# Install Fleet Protocol's CMCONF system
COPY --from=package-context config/CMCONF_FLEET_PROTOCOLConfig.cmake /etc
ENV CMLIB_DIR=/cmakelib
RUN cmake -DCMCONF_INSTALL_AS_SYMLINK=ON -P /etc/CMCONF_FLEET_PROTOCOLConfig.cmake

RUN sed -ri 's/#?PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN mkdir -p /run/sshd

Expand Down
5 changes: 5 additions & 0 deletions example_context/docker/fleet-os-2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ RUN chmod +x /root/init_toolchain.sh && \
COPY os-release /etc/os-release
COPY uname.txt /root/tools/

# Install Fleet Protocol's CMCONF system
COPY --from=package-context config/CMCONF_FLEET_PROTOCOLConfig.cmake /etc
ENV CMLIB_DIR=/cmakelib
RUN cmake -DCMCONF_INSTALL_AS_SYMLINK=ON -P /etc/CMCONF_FLEET_PROTOCOLConfig.cmake

RUN apt-get update && \
apt-get purge -y \
wget unzip && \
Expand Down
5 changes: 5 additions & 0 deletions example_context/docker/ubuntu2404/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ RUN apt-get purge -y \
RUN git clone https://github.com/cmakelib/cmakelib.git /cmakelib
RUN echo "export CMLIB_DIR=/cmakelib" >> /root/.bashrc

# Install Fleet Protocol's CMCONF system
COPY --from=package-context config/CMCONF_FLEET_PROTOCOLConfig.cmake /etc
ENV CMLIB_DIR=/cmakelib
RUN cmake -DCMCONF_INSTALL_AS_SYMLINK=ON -P /etc/CMCONF_FLEET_PROTOCOLConfig.cmake

RUN sed -ri 's/#?PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN mkdir -p /run/sshd

Expand Down
2 changes: 1 addition & 1 deletion example_context/package/ba-logger/ba-logger_debug.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"DockerMatrix": {
"ImageNames": [
"debian12",
"debian13",
"ubuntu2404",
"fedora40",
"fedora41"
Expand Down
2 changes: 1 addition & 1 deletion example_context/package/ba-logger/ba-logger_release.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"DockerMatrix": {
"ImageNames": [
"debian12",
"debian13",
"ubuntu2404",
"fedora40",
"fedora41"
Expand Down
2 changes: 1 addition & 1 deletion example_context/package/boost/boost_debug.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"DockerMatrix": {
"ImageNames": [
"fleet-os-2",
"debian12",
"debian13",
"ubuntu2404",
"fedora40",
"fedora41"
Expand Down
2 changes: 1 addition & 1 deletion example_context/package/boost/boost_release.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"DockerMatrix": {
"ImageNames": [
"fleet-os-2",
"debian12",
"debian13",
"ubuntu2404",
"fedora40",
"fedora41"
Expand Down
2 changes: 1 addition & 1 deletion example_context/package/cpprestsdk/cpprestsdk_debug.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
"DockerMatrix": {
"ImageNames": [
"debian12",
"debian13",
"ubuntu2404",
"fedora40",
"fedora41"
Expand Down
2 changes: 1 addition & 1 deletion example_context/package/cpprestsdk/cpprestsdk_release.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
"DockerMatrix": {
"ImageNames": [
"debian12",
"debian13",
"ubuntu2404",
"fedora40",
"fedora41"
Expand Down
6 changes: 3 additions & 3 deletions example_context/package/cxxopts/cxxopts_v3_debug.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"DependsOn": [],
"Git": {
"URI": "https://github.com/jarro2783/cxxopts.git",
"Revision": "v3.0.5"
"Revision": "v3.1.0"
},
"Build": {
"CMake": {
Expand All @@ -16,7 +16,7 @@
},
"Package": {
"Name": "cxxopts",
"VersionTag": "v3.0.5",
"VersionTag": "v3.1.0",
"PlatformString": {
"Mode": "auto"
},
Expand All @@ -27,7 +27,7 @@
"DockerMatrix": {
"ImageNames": [
"fleet-os-2",
"debian12",
"debian13",
"ubuntu2404",
"fedora40",
"fedora41"
Expand Down
6 changes: 3 additions & 3 deletions example_context/package/cxxopts/cxxopts_v3_release.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"DependsOn": [],
"Git": {
"URI": "https://github.com/jarro2783/cxxopts.git",
"Revision": "v3.0.5"
"Revision": "v3.1.0"
},
"Build": {
"CMake": {
Expand All @@ -16,7 +16,7 @@
},
"Package": {
"Name": "cxxopts",
"VersionTag": "v3.0.5",
"VersionTag": "v3.1.0",
"PlatformString": {
"Mode": "auto"
},
Expand All @@ -27,7 +27,7 @@
"DockerMatrix": {
"ImageNames": [
"fleet-os-2",
"debian12",
"debian13",
"ubuntu2404",
"fedora40",
"fedora41"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
},
"DockerMatrix": {
"ImageNames": [
"debian12",
"debian13",
"ubuntu2404",
"fedora40",
"fedora41"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
},
"DockerMatrix": {
"ImageNames": [
"debian12",
"debian13",
"ubuntu2404",
"fedora40",
"fedora41"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@
},
"DockerMatrix": {
"ImageNames": [
"debian12",
"debian13",
"ubuntu2404",
"fedora40",
"fedora41"
"fedora41",
"fleet-os-2"
]
}
}
Loading