From ec663cc966f65c75b3a7fe463043dd3685686e65 Mon Sep 17 00:00:00 2001 From: Ryo Nakamura Date: Sun, 4 Feb 2024 17:22:31 +0900 Subject: bump up container image versions and drop using CPack We have already provided DEB packages in launchpad PPA and RPM packages in COPR. Thus, we need no more deb/rpm packages in Github releases. The single binary build of mscp is an execptio. Updated container image versions: - almalinux 8.8 -> 9.3 - rocky 8.8 -> 8.9, and 9.3 is added - alpine 3.17 -> 3.19 --- .github/workflows/release.yml | 14 ++----- CMakeLists.txt | 84 ++++++++++++------------------------- Dockerfile/.gitignore | 3 ++ Dockerfile/README.md | 19 +++++++++ Dockerfile/almalinux-9.3.Dockerfile | 29 +++++++++++++ Dockerfile/alpine-3.19.Dockerfile | 35 ++++++++++++++++ Dockerfile/build-deb.Dockerfile | 20 +++++++++ Dockerfile/build-srpm.Dockerfile | 22 ++++++++++ Dockerfile/build-srpm.Dockerfile.in | 22 ++++++++++ Dockerfile/rocky-8.9.Dockerfile | 29 +++++++++++++ Dockerfile/rocky-9.3.Dockerfile | 30 +++++++++++++ Dockerfile/ubuntu-20.04.Dockerfile | 35 ++++++++++++++++ Dockerfile/ubuntu-22.04.Dockerfile | 33 +++++++++++++++ docker/.gitignore | 3 -- docker/README.md | 37 ---------------- docker/almalinux-8.8.Dockerfile | 34 --------------- docker/alpine-3.17.Dockerfile | 37 ---------------- docker/build-deb.Dockerfile | 20 --------- docker/build-srpm.Dockerfile | 22 ---------- docker/build-srpm.Dockerfile.in | 22 ---------- docker/rocky-8.8.Dockerfile | 31 -------------- docker/ubuntu-20.04.Dockerfile | 36 ---------------- docker/ubuntu-22.04.Dockerfile | 35 ---------------- scripts/print-install-deps.sh | 23 ---------- 24 files changed, 306 insertions(+), 369 deletions(-) create mode 100644 Dockerfile/.gitignore create mode 100644 Dockerfile/README.md create mode 100644 Dockerfile/almalinux-9.3.Dockerfile create mode 100644 Dockerfile/alpine-3.19.Dockerfile create mode 100644 Dockerfile/build-deb.Dockerfile create mode 100644 Dockerfile/build-srpm.Dockerfile create mode 100644 Dockerfile/build-srpm.Dockerfile.in create mode 100644 Dockerfile/rocky-8.9.Dockerfile create mode 100644 Dockerfile/rocky-9.3.Dockerfile create mode 100644 Dockerfile/ubuntu-20.04.Dockerfile create mode 100644 Dockerfile/ubuntu-22.04.Dockerfile delete mode 100644 docker/.gitignore delete mode 100644 docker/README.md delete mode 100644 docker/almalinux-8.8.Dockerfile delete mode 100644 docker/alpine-3.17.Dockerfile delete mode 100644 docker/build-deb.Dockerfile delete mode 100644 docker/build-srpm.Dockerfile delete mode 100644 docker/build-srpm.Dockerfile.in delete mode 100644 docker/rocky-8.8.Dockerfile delete mode 100644 docker/ubuntu-20.04.Dockerfile delete mode 100644 docker/ubuntu-22.04.Dockerfile delete mode 100755 scripts/print-install-deps.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 83af6fe..fbde9d8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,22 +33,14 @@ jobs: - name: Test run: make -C ${{github.workspace}}/build docker-test-all - - name: Retrieve packages from containers - run: make -C ${{github.workspace}}/build docker-pkg-all - - - name: Copy mscp single binary built inside Alpine - run: cp ${{github.workspace}}/build/mscp_alpine-3.17-x86_64.static ${{github.workspace}}/build/mscp.linux.x86.static + - name: Build single binary mscp + run: make -C ${{github.workspace}}/build build-single-binary - name: Release uses: softprops/action-gh-release@v1 with: files: | - ${{github.workspace}}/build/mscp_ubuntu-20.04-x86_64.deb - ${{github.workspace}}/build/mscp_ubuntu-22.04-x86_64.deb - ${{github.workspace}}/build/mscp_rocky-8.8-x86_64.rpm - ${{github.workspace}}/build/mscp_almalinux-8.8-x86_64.rpm - ${{github.workspace}}/build/mscp_alpine-3.17-x86_64.static - ${{github.workspace}}/build/mscp.linux.x86.static + ${{github.workspace}}/build/mscp.linux.x86_64.static source-release: runs-on: ubuntu-latest diff --git a/CMakeLists.txt b/CMakeLists.txt index 84b555b..3823291 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -141,51 +141,13 @@ enable_testing() -# CPACK Rules -#set(CPACK_SET_DESTDIR true) -set(CPACK_PACKAGE_NAME ${PROJECT_NAME}) -set(CPACK_PACKAGE_CONTACT "Ryo Nakamura ") -set(CPACK_PACKAGE_DESCRIPTION - "mscp, copy files over multiple ssh connections") - -execute_process(COMMAND uname -m - OUTPUT_VARIABLE ARCH OUTPUT_STRIP_TRAILING_WHITESPACE) - -if(CMAKE_HOST_SYSTEM_NAME STREQUAL Linux) - execute_process(COMMAND - bash "-c" "cat /etc/os-release|grep '^ID='|cut -d '=' -f 2|tr -d '\"'" - OUTPUT_VARIABLE DIST_NAME OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process(COMMAND - bash "-c" "cat /etc/os-release|grep '^VERSION_ID='|cut -d '=' -f 2|tr -d '\"'" - OUTPUT_VARIABLE DIST_VER OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process(COMMAND - bash "-c" "${mscp_SOURCE_DIR}/scripts/print-install-deps.sh ${DIST_NAME}-${DIST_VER}" - OUTPUT_VARIABLE DIST_DEP OUTPUT_STRIP_TRAILING_WHITESPACE) - - set(PACKAGE_FILE_NAME - ${PROJECT_NAME}_${DIST_NAME}-${DIST_VER}-${ARCH}) - - set(CPACK_DEBIAN_FILE_NAME ${PACKAGE_FILE_NAME}.deb) - set(CPACK_DEBIAN_PACKAGE_DEPENDS ${DIST_DEP}) - set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/upa/mscp") - - set(CPACK_RPM_FILE_NAME ${PACKAGE_FILE_NAME}.rpm) - set(CPACK_RPM_PACKAGE_REQUIRES ${DIST_DEP}) - set(CPACK_RPM_PACKAGE_HOMEPAGE "https://github.com/upa/mscp") - set(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION}) - set(CPACK_RPM_PACKAGE_LICENSE "GPLv3") -endif() # on linux - -include(CPack) - - # Custom targets to build and test mscp in docker containers. # foreach(IN ZIP_LISTS) (cmake >= 3.17) can shorten the following lists. # However, ubuntu 20.04 has cmake 3.16.3. So this is a roundabout trick. -list(APPEND DIST_NAMES ubuntu ubuntu rocky almalinux alpine) -list(APPEND DIST_VERS 20.04 22.04 8.8 8.8 3.17) -list(APPEND DIST_PKGS deb deb rpm rpm static) +list(APPEND DIST_NAMES ubuntu ubuntu rocky rocky almalinux alpine) +list(APPEND DIST_VERS 20.04 22.04 8.9 9.3 9.3 3.19) +list(APPEND DIST_PKGS deb deb rpm rpm rpm static) list(LENGTH DIST_NAMES _DIST_LISTLEN) math(EXPR DIST_LISTLEN "${_DIST_LISTLEN} - 1") @@ -204,13 +166,13 @@ foreach(x RANGE ${DIST_LISTLEN}) COMMENT "Build mscp in ${DOCKER_IMAGE} container" WORKING_DIRECTORY ${mscp_SOURCE_DIR} COMMAND - docker build -t ${DOCKER_IMAGE} -f docker/${DOCKER_INDEX}.Dockerfile .) + docker build -t ${DOCKER_IMAGE} -f Dockerfile/${DOCKER_INDEX}.Dockerfile .) add_custom_target(docker-build-${DOCKER_INDEX}-no-cache COMMENT "Build mscp in ${DOCKER_IMAGE} container" WORKING_DIRECTORY ${mscp_SOURCE_DIR} COMMAND - docker build --no-cache -t ${DOCKER_IMAGE} -f docker/${DOCKER_INDEX}.Dockerfile .) + docker build --no-cache -t ${DOCKER_IMAGE} -f Dockerfile/${DOCKER_INDEX}.Dockerfile .) add_custom_target(docker-test-${DOCKER_INDEX} COMMENT "Test mscp in ${DOCKER_IMAGE} container" @@ -219,26 +181,17 @@ foreach(x RANGE ${DIST_LISTLEN}) docker run --init --rm --sysctl net.ipv6.conf.all.disable_ipv6=0 ${DOCKER_IMAGE} /mscp/scripts/test-in-container.sh) - add_custom_target(docker-pkg-${DOCKER_INDEX} - COMMENT "Retrieve mscp package from ${DOCKER_IMAGE} container" - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} - COMMAND - docker run --rm -v ${CMAKE_BINARY_DIR}:/out ${DOCKER_IMAGE} - cp /mscp/build/${PKG_FILE_NAME} /out/) - list(APPEND DOCKER_BUILDS docker-build-${DOCKER_INDEX}) list(APPEND DOCKER_BUILDS_NO_CACHE docker-build-${DOCKER_INDEX}-no-cache) list(APPEND DOCKER_TESTS docker-test-${DOCKER_INDEX}) - list(APPEND DOCKER_PKGS docker-pkg-${DOCKER_INDEX}) endforeach() add_custom_target(docker-build-all DEPENDS ${DOCKER_BUILDS}) add_custom_target(docker-build-all-no-cache DEPENDS ${DOCKER_BUILDS_NO_CACHE}) add_custom_target(docker-test-all DEPENDS ${DOCKER_TESTS}) -add_custom_target(docker-pkg-all DEPENDS ${DOCKER_PKGS}) -### debuild-related fefinitions +### debuild-related definitions set(DEBBUILDCONTAINER mscp-build-deb) add_custom_target(build-deb @@ -246,7 +199,7 @@ add_custom_target(build-deb WORKING_DIRECTORY ${mscp_SOURCE_DIR} BYPRODUCTS ${CMAKE_BINARY_DIR}/debbuild COMMAND - docker build -t ${DEBBUILDCONTAINER} -f docker/build-deb.Dockerfile . + docker build -t ${DEBBUILDCONTAINER} -f Dockerfile/build-deb.Dockerfile . COMMAND docker run --rm -v ${CMAKE_BINARY_DIR}:/out ${DEBBUILDCONTAINER} cp -r /debbuild /out/) @@ -260,11 +213,11 @@ configure_file( ${mscp_SOURCE_DIR}/rpm/mscp.spec @ONLY) configure_file( - ${mscp_SOURCE_DIR}/docker/build-srpm.Dockerfile.in - ${mscp_SOURCE_DIR}/docker/build-srpm.Dockerfile + ${mscp_SOURCE_DIR}/Dockerfile/build-srpm.Dockerfile.in + ${mscp_SOURCE_DIR}/Dockerfile/build-srpm.Dockerfile @ONLY) -# Custom targets to build mscp as a src.rpm in docker. +# Custom target to build mscp as a src.rpm in docker. set(RPMBUILDCONTAINER mscp-build-srpm) set(SRPMFILE mscp-${MSCP_VERSION}-1.el9.src.rpm) add_custom_target(build-srpm @@ -272,9 +225,24 @@ add_custom_target(build-srpm WORKING_DIRECTORY ${mscp_SOURCE_DIR} BYPRODUCTS ${CMAKE_BINARY_DIR}/${SRPMFILE} COMMAND - docker build -t ${RPMBUILDCONTAINER} -f docker/build-srpm.Dockerfile . + docker build -t ${RPMBUILDCONTAINER} -f Dockerfile/build-srpm.Dockerfile . COMMAND docker run --rm -v ${CMAKE_BINARY_DIR}:/out ${RPMBUILDCONTAINER} cp /root/rpmbuild/SRPMS/${SRPMFILE} /out/) +### single-binary-build-related definitions + +# Custom target to get single binary mscp +set(SINGLEBINARYFILE mscp.linux.${CMAKE_SYSTEM_PROCESSOR}.static) +add_custom_target(build-single-binary + COMMENT "Build mscp as a single binary in alpine conatiner" + WORKING_DIRECTORY ${mscp_SOURCE_DIR} + BYPRODUCTS ${CMAKE_BINARY_DIR}/${SINGLEBINARYFILE} + DEPENDS docker-build-alpine-3.19 + COMMAND + docker run --rm -v ${CMAKE_BINARY_DIR}:/out mscp-alpine:3.19 + cp /mscp/build/mscp /out/${SINGLEBINARYFILE}) + +add_custom_target(build-pkg-all + DEPENDS build-deb build-srpm build-single-binary) diff --git a/Dockerfile/.gitignore b/Dockerfile/.gitignore new file mode 100644 index 0000000..f7083c9 --- /dev/null +++ b/Dockerfile/.gitignore @@ -0,0 +1,3 @@ + +# generated by cmake +rpmbuild.Dockerfile diff --git a/Dockerfile/README.md b/Dockerfile/README.md new file mode 100644 index 0000000..e901664 --- /dev/null +++ b/Dockerfile/README.md @@ -0,0 +1,19 @@ + +Dockerfiles for building and testing mscp. + +Build container: + +``` +docker build -t mscp-DIST:VER -f docker/DIST-VER.Dockerfile . +``` + +Run test: + +``` +docker run --init --rm mscp-DST:VER /mscp/scripts/test-in-container.sh +``` + +`cmake` provides custom targets to build and test mscp in the +containers. See `make docker-*` targets. `make docker-build-all` +builds all container images and `make docker-test-all` runs the test +in all container images. \ No newline at end of file diff --git a/Dockerfile/almalinux-9.3.Dockerfile b/Dockerfile/almalinux-9.3.Dockerfile new file mode 100644 index 0000000..516fbd2 --- /dev/null +++ b/Dockerfile/almalinux-9.3.Dockerfile @@ -0,0 +1,29 @@ +FROM almalinux:9.3 + +# install pytest, sshd for test, and rpm-build +RUN set -ex && yum -y install \ + python3 python3-pip python3-devel openssh openssh-server openssh-clients rpm-build + +RUN python3 -m pip install 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 + +ARG mscpdir="/mscp" + +COPY . ${mscpdir} + +# install build dependency +RUN ${mscpdir}/scripts/install-build-deps.sh + +# build +RUN cd ${mscpdir} \ + && rm -rf build \ + && cmake -B build \ + && cd ${mscpdir}/build \ + && make -j 2 \ + && make install diff --git a/Dockerfile/alpine-3.19.Dockerfile b/Dockerfile/alpine-3.19.Dockerfile new file mode 100644 index 0000000..a19957b --- /dev/null +++ b/Dockerfile/alpine-3.19.Dockerfile @@ -0,0 +1,35 @@ +FROM alpine:3.19 + +# Build mscp with conan to create single binary mscp + +RUN apk add --no-cache \ + gcc make cmake python3 py3-pip perl linux-headers libc-dev \ + openssh bash python3-dev py3-pytest g++ + +RUN pip3 install --break-system-packages conan + +# preparation for sshd +RUN ssh-keygen -A +RUN mkdir /var/run/sshd \ + && ssh-keygen -f /root/.ssh/id_rsa -N "" \ + && mv /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys + + +# Build mscp as a single binary +RUN conan profile detect --force + +ARG mscpdir="/mscp" + +COPY . ${mscpdir} + +RUN cd ${mscpdir} \ + && rm -rf build \ + && conan install . --output-folder=build --build=missing \ + && cd ${mscpdir}/build \ + && cmake .. \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake \ + -DBUILD_CONAN=ON -DBUILD_STATIC=ON \ + && make -j 2 \ + && make install + diff --git a/Dockerfile/build-deb.Dockerfile b/Dockerfile/build-deb.Dockerfile new file mode 100644 index 0000000..e3e6381 --- /dev/null +++ b/Dockerfile/build-deb.Dockerfile @@ -0,0 +1,20 @@ +FROM ubuntu:22.04 + +ARG DEBIAN_FRONTEND=noninteractive +RUN set -ex && apt-get update && apt-get install -y --no-install-recommends \ + ca-certificates build-essential devscripts debhelper gcc make cmake + +ARG mscpdir="/debbuild/mscp" + +COPY . ${mscpdir} + +# install build dependency +RUN ${mscpdir}/scripts/install-build-deps.sh + +# build +RUN cd ${mscpdir} \ + && debuild -us -uc \ + && mv ${mscpdir} / + +# Then all debuild output files exsit at /debbuild + diff --git a/Dockerfile/build-srpm.Dockerfile b/Dockerfile/build-srpm.Dockerfile new file mode 100644 index 0000000..b614fc1 --- /dev/null +++ b/Dockerfile/build-srpm.Dockerfile @@ -0,0 +1,22 @@ +FROM rockylinux:9 + +# install pytest, sshd for test, and rpm-build +RUN set -ex && yum -y install rpm-build rpmdevtools + +ARG mscpdir="/mscp-0.1.3" +ARG mscptgz="mscp-0.1.3.tar.gz" + +COPY . ${mscpdir} + +# install build dependency +RUN ${mscpdir}/scripts/install-build-deps.sh + +# prepare rpmbuild +RUN rpmdev-setuptree \ + && rm -rf ${mscpdir}/build \ + && tar zcvf /${mscptgz} --exclude-vcs ${mscpdir} \ + && cp /${mscptgz} ~/rpmbuild/SOURCES/ \ + && cp ${mscpdir}/rpm/mscp.spec ~/rpmbuild/SPECS/ + +# build rpm and src.rpm +RUN rpmbuild -ba ~/rpmbuild/SPECS/mscp.spec diff --git a/Dockerfile/build-srpm.Dockerfile.in b/Dockerfile/build-srpm.Dockerfile.in new file mode 100644 index 0000000..f7a8cf0 --- /dev/null +++ b/Dockerfile/build-srpm.Dockerfile.in @@ -0,0 +1,22 @@ +FROM rockylinux:9 + +# install pytest, sshd for test, and rpm-build +RUN set -ex && yum -y install rpm-build rpmdevtools + +ARG mscpdir="/mscp-@MSCP_VERSION@" +ARG mscptgz="mscp-@MSCP_VERSION@.tar.gz" + +COPY . ${mscpdir} + +# install build dependency +RUN ${mscpdir}/scripts/install-build-deps.sh + +# prepare rpmbuild +RUN rpmdev-setuptree \ + && rm -rf ${mscpdir}/build \ + && tar zcvf /${mscptgz} --exclude-vcs ${mscpdir} \ + && cp /${mscptgz} ~/rpmbuild/SOURCES/ \ + && cp ${mscpdir}/rpm/mscp.spec ~/rpmbuild/SPECS/ + +# build rpm and src.rpm +RUN rpmbuild -ba ~/rpmbuild/SPECS/mscp.spec diff --git a/Dockerfile/rocky-8.9.Dockerfile b/Dockerfile/rocky-8.9.Dockerfile new file mode 100644 index 0000000..cb2de9f --- /dev/null +++ b/Dockerfile/rocky-8.9.Dockerfile @@ -0,0 +1,29 @@ +FROM rockylinux:8.9 + +# install pytest, sshd for test, and rpm-build +RUN set -ex && yum -y install \ + python3 python3-pip python3-devel openssh openssh-server openssh-clients rpm-build + +RUN python3 -m pip install 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 + +ARG mscpdir="/mscp" + +COPY . ${mscpdir} + +# install build dependency +RUN ${mscpdir}/scripts/install-build-deps.sh + +# build +RUN cd ${mscpdir} \ + && rm -rf build \ + && cmake -B build \ + && cd ${mscpdir}/build \ + && make -j 2 \ + && make install diff --git a/Dockerfile/rocky-9.3.Dockerfile b/Dockerfile/rocky-9.3.Dockerfile new file mode 100644 index 0000000..84f6b11 --- /dev/null +++ b/Dockerfile/rocky-9.3.Dockerfile @@ -0,0 +1,30 @@ +FROM rockylinux:9.3 + +# install pytest, sshd for test, and rpm-build +RUN set -ex && yum -y install \ + python3 python3-pip python3-devel openssh openssh-server openssh-clients rpm-build + +RUN python3 -m pip install 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 + +ARG mscpdir="/mscp" + +COPY . ${mscpdir} + +# install build dependency +RUN ${mscpdir}/scripts/install-build-deps.sh + +# build +RUN cd ${mscpdir} \ + && rm -rf build \ + && cmake -B build \ + && cd ${mscpdir}/build \ + && make -j 2 \ + && make install + diff --git a/Dockerfile/ubuntu-20.04.Dockerfile b/Dockerfile/ubuntu-20.04.Dockerfile new file mode 100644 index 0000000..a2dda99 --- /dev/null +++ b/Dockerfile/ubuntu-20.04.Dockerfile @@ -0,0 +1,35 @@ +FROM ubuntu:20.04 + +ARG DEBIAN_FRONTEND=noninteractive +RUN set -ex && apt-get update && apt-get install -y --no-install-recommends \ + ca-certificates + +# install pytest, and sshd for test +RUN apt-get install -y --no-install-recommends \ + python3 python3-pip python3-dev openssh-server + +RUN python3 -m pip install pytest + + +# preparation for sshd +RUN mkdir /var/run/sshd \ + && ssh-keygen -f /root/.ssh/id_rsa -N "" \ + && mv /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys + + +ARG mscpdir="/mscp" + +COPY . ${mscpdir} + +# install build dependency +RUN ${mscpdir}/scripts/install-build-deps.sh + + +# build +RUN cd ${mscpdir} \ + && rm -rf build \ + && cmake -B build \ + && cd ${mscpdir}/build \ + && make -j 2 \ + && make install + diff --git a/Dockerfile/ubuntu-22.04.Dockerfile b/Dockerfile/ubuntu-22.04.Dockerfile new file mode 100644 index 0000000..1a8fb12 --- /dev/null +++ b/Dockerfile/ubuntu-22.04.Dockerfile @@ -0,0 +1,33 @@ +FROM ubuntu:22.04 + +ARG DEBIAN_FRONTEND=noninteractive +RUN set -ex && apt-get update && apt-get install -y --no-install-recommends \ + ca-certificates + +# install pytest, and sshd for test +RUN apt-get install -y --no-install-recommends \ + python3 python3-pip python3-dev openssh-server + +RUN python3 -m pip install pytest + + +# preparation for sshd +RUN mkdir /var/run/sshd \ + && ssh-keygen -f /root/.ssh/id_rsa -N "" \ + && mv /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys + +ARG mscpdir="/mscp" + +COPY . ${mscpdir} + +# install build dependency +RUN ${mscpdir}/scripts/install-build-deps.sh + + +# build +RUN cd ${mscpdir} \ + && rm -rf build \ + && cmake -B build \ + && cd ${mscpdir}/build \ + && make -j 2 \ + && make install diff --git a/docker/.gitignore b/docker/.gitignore deleted file mode 100644 index f7083c9..0000000 --- a/docker/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ - -# generated by cmake -rpmbuild.Dockerfile diff --git a/docker/README.md b/docker/README.md deleted file mode 100644 index 8e3dbe9..0000000 --- a/docker/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -Build docker containers. - -```console -cd .. - -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-rocky:8.8 -f docker/rocky-8.Dockerfile . -``` - -Test `mscp` in the containers. - -```console -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-rocky:8.9 /mscp/scripts/test-in-container.sh -``` - -Retrieve deb/rpm packages. - -```console -docker run --rm -v (pwd):/out mscp-ubuntu:20.04 \ - cp /mscp/build/mscp_ubuntu-20.04-x86_64.deb /out/ - -docker run --rm -v (pwd):/out mscp-ubuntu:22.04 \ - cp /mscp/build/mscp_ubuntu-22.04-x86_64.deb /out/ - -docker run --rm -v (pwd):/out mscp-rocky:8.8 \ - cp /mscp/build/mscp_rocky-8.8-x86_64.rpm /out/ -``` - -I don't know whether these are good way. \ No newline at end of file diff --git a/docker/almalinux-8.8.Dockerfile b/docker/almalinux-8.8.Dockerfile deleted file mode 100644 index 5ff41ed..0000000 --- a/docker/almalinux-8.8.Dockerfile +++ /dev/null @@ -1,34 +0,0 @@ -FROM almalinux:8.8 - -# install pytest, sshd for test, and rpm-build -RUN set -ex && \ - rpm --import https://repo.almalinux.org/almalinux/RPM-GPG-KEY-AlmaLinux && \ - yum -y install \ - python3 python3-pip python3-devel openssh openssh-server openssh-clients rpm-build - -RUN python3 -m pip install 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 - - -ARG mscpdir="/mscp" - -COPY . ${mscpdir} - -# install build dependency -RUN ${mscpdir}/scripts/install-build-deps.sh - -# build -RUN cd ${mscpdir} \ - && rm -rf build \ - && cmake -B build \ - && cd ${mscpdir}/build \ - && make \ - && cpack -G RPM CPackConfig.cmake \ - && rpm -iv *.rpm - diff --git a/docker/alpine-3.17.Dockerfile b/docker/alpine-3.17.Dockerfile deleted file mode 100644 index b79510f..0000000 --- a/docker/alpine-3.17.Dockerfile +++ /dev/null @@ -1,37 +0,0 @@ -FROM alpine:3.17 - -# Build mscp with conan to create single binary mscp - -RUN apk add --no-cache \ - gcc make cmake python3 py3-pip perl linux-headers libc-dev \ - openssh bash python3-dev g++ - -RUN pip3 install conan pytest - -# preparation for sshd -RUN ssh-keygen -A -RUN mkdir /var/run/sshd \ - && ssh-keygen -f /root/.ssh/id_rsa -N "" \ - && mv /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys - - -# Build mscp as a single binary -RUN conan profile detect --force - -ARG mscpdir="/mscp" - -COPY . ${mscpdir} - -RUN cd ${mscpdir} \ - && rm -rf build \ - && conan install . --output-folder=build --build=missing \ - && cd ${mscpdir}/build \ - && cmake .. \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake \ - -DBUILD_CONAN=ON -DBUILD_STATIC=ON \ - && make \ - && cp mscp /usr/bin/ \ - && cp mscp /mscp/build/mscp_alpine-3.17-x86_64.static -# copy mscp to PKG FILE NAME because this build doesn't use CPACK - diff --git a/docker/build-deb.Dockerfile b/docker/build-deb.Dockerfile deleted file mode 100644 index e3e6381..0000000 --- a/docker/build-deb.Dockerfile +++ /dev/null @@ -1,20 +0,0 @@ -FROM ubuntu:22.04 - -ARG DEBIAN_FRONTEND=noninteractive -RUN set -ex && apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates build-essential devscripts debhelper gcc make cmake - -ARG mscpdir="/debbuild/mscp" - -COPY . ${mscpdir} - -# install build dependency -RUN ${mscpdir}/scripts/install-build-deps.sh - -# build -RUN cd ${mscpdir} \ - && debuild -us -uc \ - && mv ${mscpdir} / - -# Then all debuild output files exsit at /debbuild - diff --git a/docker/build-srpm.Dockerfile b/docker/build-srpm.Dockerfile deleted file mode 100644 index b614fc1..0000000 --- a/docker/build-srpm.Dockerfile +++ /dev/null @@ -1,22 +0,0 @@ -FROM rockylinux:9 - -# install pytest, sshd for test, and rpm-build -RUN set -ex && yum -y install rpm-build rpmdevtools - -ARG mscpdir="/mscp-0.1.3" -ARG mscptgz="mscp-0.1.3.tar.gz" - -COPY . ${mscpdir} - -# install build dependency -RUN ${mscpdir}/scripts/install-build-deps.sh - -# prepare rpmbuild -RUN rpmdev-setuptree \ - && rm -rf ${mscpdir}/build \ - && tar zcvf /${mscptgz} --exclude-vcs ${mscpdir} \ - && cp /${mscptgz} ~/rpmbuild/SOURCES/ \ - && cp ${mscpdir}/rpm/mscp.spec ~/rpmbuild/SPECS/ - -# build rpm and src.rpm -RUN rpmbuild -ba ~/rpmbuild/SPECS/mscp.spec diff --git a/docker/build-srpm.Dockerfile.in b/docker/build-srpm.Dockerfile.in deleted file mode 100644 index f7a8cf0..0000000 --- a/docker/build-srpm.Dockerfile.in +++ /dev/null @@ -1,22 +0,0 @@ -FROM rockylinux:9 - -# install pytest, sshd for test, and rpm-build -RUN set -ex && yum -y install rpm-build rpmdevtools - -ARG mscpdir="/mscp-@MSCP_VERSION@" -ARG mscptgz="mscp-@MSCP_VERSION@.tar.gz" - -COPY . ${mscpdir} - -# install build dependency -RUN ${mscpdir}/scripts/install-build-deps.sh - -# prepare rpmbuild -RUN rpmdev-setuptree \ - && rm -rf ${mscpdir}/build \ - && tar zcvf /${mscptgz} --exclude-vcs ${mscpdir} \ - && cp /${mscptgz} ~/rpmbuild/SOURCES/ \ - && cp ${mscpdir}/rpm/mscp.spec ~/rpmbuild/SPECS/ - -# build rpm and src.rpm -RUN rpmbuild -ba ~/rpmbuild/SPECS/mscp.spec diff --git a/docker/rocky-8.8.Dockerfile b/docker/rocky-8.8.Dockerfile deleted file mode 100644 index 6140905..0000000 --- a/docker/rocky-8.8.Dockerfile +++ /dev/null @@ -1,31 +0,0 @@ -FROM rockylinux:8.8 - -# install pytest, sshd for test, and rpm-build -RUN set -ex && yum -y install \ - python3 python3-pip python3-devel openssh openssh-server openssh-clients rpm-build - -RUN python3 -m pip install 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 - -ARG mscpdir="/mscp" - -COPY . ${mscpdir} - -# install build dependency -RUN ${mscpdir}/scripts/install-build-deps.sh - -# build -RUN cd ${mscpdir} \ - && rm -rf build \ - && cmake -B build \ - && cd ${mscpdir}/build \ - && make \ - && cpack -G RPM CPackConfig.cmake \ - && rpm -iv *.rpm - diff --git a/docker/ubuntu-20.04.Dockerfile b/docker/ubuntu-20.04.Dockerfile deleted file mode 100644 index c1da765..0000000 --- a/docker/ubuntu-20.04.Dockerfile +++ /dev/null @@ -1,36 +0,0 @@ -FROM ubuntu:20.04 - -ARG DEBIAN_FRONTEND=noninteractive -RUN set -ex && apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates - -# install pytest, and sshd for test -RUN apt-get install -y --no-install-recommends \ - python3 python3-pip python3-dev openssh-server - -RUN python3 -m pip install pytest - - -# preparation for sshd -RUN mkdir /var/run/sshd \ - && ssh-keygen -f /root/.ssh/id_rsa -N "" \ - && mv /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys - - -ARG mscpdir="/mscp" - -COPY . ${mscpdir} - -# install build dependency -RUN ${mscpdir}/scripts/install-build-deps.sh - - -# build -RUN cd ${mscpdir} \ - && rm -rf build \ - && cmake -B build \ - && cd ${mscpdir}/build \ - && make \ - && cpack -G DEB CPackConfig.cmake \ - && dpkg -i *.deb - diff --git a/docker/ubuntu-22.04.Dockerfile b/docker/ubuntu-22.04.Dockerfile deleted file mode 100644 index 377cfff..0000000 --- a/docker/ubuntu-22.04.Dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -FROM ubuntu:22.04 - -ARG DEBIAN_FRONTEND=noninteractive -RUN set -ex && apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates - -# install pytest, and sshd for test -RUN apt-get install -y --no-install-recommends \ - python3 python3-pip python3-dev openssh-server - -RUN python3 -m pip install pytest - - -# preparation for sshd -RUN mkdir /var/run/sshd \ - && ssh-keygen -f /root/.ssh/id_rsa -N "" \ - && mv /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys - -ARG mscpdir="/mscp" - -COPY . ${mscpdir} - -# install build dependency -RUN ${mscpdir}/scripts/install-build-deps.sh - - -# build -RUN cd ${mscpdir} \ - && rm -rf build \ - && cmake -B build \ - && cd ${mscpdir}/build \ - && make \ - && cpack -G DEB CPackConfig.cmake \ - && dpkg -i *.deb - diff --git a/scripts/print-install-deps.sh b/scripts/print-install-deps.sh deleted file mode 100755 index 6ec70fc..0000000 --- a/scripts/print-install-deps.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -e -# -# Print install dpenedencies on Linux. CMake runs this script to obtain deps for CPACK. -# mscp dependes on packages on which libssh depends. - -source /etc/os-release - -release=$1 - -case $release in - ubuntu-20.04*) - echo "libc6 (>= 2.27), libgssapi-krb5-2 (>= 1.17), libssl1.1 (>= 1.1.1), zlib1g (>= 1:1.1.4)" - ;; - ubuntu-22.04*) - echo "libc6 (>= 2.33), libgssapi-krb5-2 (>= 1.17), libssl3 (>= 3.0.0~~alpha1), zlib1g (>= 1:1.1.4)" - ;; - centos* | rhel* | rocky* | almalinux*) - echo "glibc crypto-policies krb5-libs openssl-libs libcom_err" - ;; - *) - echo "$(basename $0): unsupported install dependency: $release" - exit 1 -esac -- cgit v1.2.3