diff options
-rw-r--r-- | .github/workflows/release.yml | 1 | ||||
-rw-r--r-- | CMakeLists.txt | 13 | ||||
-rw-r--r-- | docker/README.md | 7 | ||||
-rw-r--r-- | docker/rocky-8.6.Dockerfile | 30 | ||||
-rwxr-xr-x | scripts/install-build-deps.sh | 4 | ||||
-rwxr-xr-x | scripts/test-in-container.sh | 2 |
6 files changed, 53 insertions, 4 deletions
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index be5d30b..fdcc97d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,3 +36,4 @@ jobs: ${{github.workspace}}/build/mscp_${{env.VERSION}}-ubuntu-20.04-x86_64.deb ${{github.workspace}}/build/mscp_${{env.VERSION}}-ubuntu-22.04-x86_64.deb ${{github.workspace}}/build/mscp_${{env.VERSION}}-centos-8-x86_64.rpm + ${{github.workspace}}/build/mscp_${{env.VERSION}}-rocky-8.6-x86_64.rpm diff --git a/CMakeLists.txt b/CMakeLists.txt index cd13603..26f6267 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -105,12 +105,23 @@ if(BUILD_PKG) COMMAND docker run --rm -v ${CMAKE_BINARY_DIR}:/out mscp-centos:8 cp /mscp/build/mscp_${PROJECT_VERSION}-centos-8-${ARCH}.rpm /out/) + # Rocky 8.6 + add_custom_target(package-rocky-8.6-in-docker + COMMENT "Build mscp in rocky 8.6 docker container" + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + COMMAND docker build -t mscp-rocky:8.6 -f docker/rocky-8.6.Dockerfile . + COMMAND docker run --init --rm mscp-rocky:8.6 + /mscp/scripts/test-in-container.sh + COMMAND docker run --rm -v ${CMAKE_BINARY_DIR}:/out mscp-rocky:8.6 + cp /mscp/build/mscp_${PROJECT_VERSION}-rocky-8.6-${ARCH}.rpm /out/) + # build on all conatiners add_custom_target(package-all-in-docker COMMENT "Build mscp in all docker containers" DEPENDS package-ubuntu-20.04-in-docker DEPENDS package-ubuntu-22.04-in-docker - DEPENDS package-centos-8-in-docker) + DEPENDS package-centos-8-in-docker + DEPENDS package-rocky-8.6-in-docker) endif() # BUILD_PKG diff --git a/docker/README.md b/docker/README.md index ad897a1..8c58949 100644 --- a/docker/README.md +++ b/docker/README.md @@ -9,6 +9,8 @@ docker build -t mscp-ubuntu:20.04 -f docker/ubuntu-20.04.Dockerfile . docker build -t mscp-ubuntu:22.04 -f docker/ubuntu-22.04.Dockerfile . docker build -t mscp-centos:8 -f docker/centos-8.Dockerfile . + +docker build -t mscp-rocky:8.6 -f docker/rocky-8.6.Dockerfile . ``` Test `mscp` in the containers. @@ -19,6 +21,8 @@ docker run --init --rm mscp-ubuntu:20.04 /mscp/scripts/test-in-container.sh docker run --init --rm mscp-ubuntu:22.04 /mscp/scripts/test-in-container.sh docker run --init --rm mscp-centos:8 /mscp/scripts/test-in-container.sh + +docker run --init --rm mscp-rocky:8.6 /mscp/scripts/test-in-container.sh ``` Retrieve deb/rpm packages. @@ -32,6 +36,9 @@ docker run --rm -v (pwd):/out mscp-ubuntu:22.04 \ docker run --rm -v (pwd):/out mscp-centos:8 \ cp /mscp/build/mscp_0.0.0-centos-8-x86_64.rpm /out/ + +docker run --rm -v (pwd):/out mscp-rocky:8.6 \ + cp /mscp/build/mscp_0.0.0-rocky-8.6-x86_64.rpm /out/ ``` I don't know whether these are good way.
\ No newline at end of file diff --git a/docker/rocky-8.6.Dockerfile b/docker/rocky-8.6.Dockerfile new file mode 100644 index 0000000..422261b --- /dev/null +++ b/docker/rocky-8.6.Dockerfile @@ -0,0 +1,30 @@ +FROM rockylinux:8.6 + +ARG mscpdir="/mscp" + +COPY . ${mscpdir} + +# install numpy and pytest, sshd for test, and rpm-build +RUN set -ex && yum -y update && yum -y install \ + python3 python3-pip openssh openssh-server openssh-clients rpm-build + +RUN python3 -m pip install numpy pytest + + +# preparation for sshd +RUN mkdir /var/run/sshd \ + && ssh-keygen -A \ + && ssh-keygen -f /root/.ssh/id_rsa -N "" \ + && mv /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys + +# install build dependency +RUN ${mscpdir}/scripts/install-build-deps.sh + +# build +RUN cd ${mscpdir} \ + && rm -rf build \ + && cmake -B build -DBUILD_PKG=1 \ + && cd ${mscpdir}/build \ + && make \ + && cpack -G RPM CPackConfig.cmake + diff --git a/scripts/install-build-deps.sh b/scripts/install-build-deps.sh index df2552d..0d7bd94 100755 --- a/scripts/install-build-deps.sh +++ b/scripts/install-build-deps.sh @@ -9,8 +9,8 @@ case $ID in ubuntu*) apt-get install -y gcc make cmake libssh-dev ;; - centos* | rhel*) - dnf install -y gcc make cmake libssh-devel rpm-build + centos* | rhel* | rocky*) + yum install -y gcc make cmake libssh-devel rpm-build ;; *) echo "unsupported dependency install: $ID" diff --git a/scripts/test-in-container.sh b/scripts/test-in-container.sh index ee389fe..01d483c 100755 --- a/scripts/test-in-container.sh +++ b/scripts/test-in-container.sh @@ -17,7 +17,7 @@ case $ID in pkg=mscp_${project_version}-${ID}-${VERSION_ID}-${arch}.deb dpkg -i ../build/$pkg ;; - centos* | rhel*) + centos* | rhel* | rocky*) pkg=mscp_${project_version}-${ID}-${VERSION_ID}-${arch}.rpm rpm -iv ../build/$pkg ;; |