diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e6b5b8c..7b9c11e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -104,6 +104,12 @@ test-arch: - job: make-image-arch image: $CI_REGISTRY_IMAGE/archlinux:branch-$CI_COMMIT_REF_SLUG + test-opensuse-leap-153: + extends: test-deb + needs: + - job: make-image-arch + image: $CI_REGISTRY_IMAGE/opensuse-leap-153:branch-$CI_COMMIT_REF_SLUG + test-fed33: extends: test-deb needs: diff --git a/Dockerfile.opensuse-leap-153 b/Dockerfile.opensuse-leap-153 new file mode 100644 index 0000000..899745a --- /dev/null +++ b/Dockerfile.opensuse-leap-153 @@ -0,0 +1,50 @@ +FROM IMAGE_URL_OPENSUSE_LEAP_153 +RUN zypper update -y + +RUN zypper install -y \ + gcc \ + sudo \ + rpm-build \ + rpm-devel \ + rpmlint \ + make \ + python3 \ + python3-pip \ + bash \ + coreutils \ + diffutils \ + patch \ + rpmdevtools \ + rpm \ + vim \ + openssl-1_1 \ + libopenssl-1_1-devel + +RUN zypper install -y \ + python3-requests \ + python3-pyOpenSSL \ + python3-bcrypt \ + python3-python-gnupg + +RUN zypper install -y \ + python3-pytest \ + python3-pytest-cov + +RUN zypper install -y \ + system-group-wheel \ + system-user-mail + +RUN groupadd user +RUN useradd -ms /bin/bash user +RUN usermod -a -G user user +RUN usermod -a -G wheel user +RUN echo '%wheel ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + +COPY docker_entry.sh /usr/local/bin +COPY . /home/user/proton-python-client + +RUN chown -R user:user /home/user/ +USER user +WORKDIR /home/user/proton-python-client + +ENTRYPOINT ["/usr/local/bin/docker_entry.sh"] diff --git a/Makefile b/Makefile index 5a12181..dbed114 100644 --- a/Makefile +++ b/Makefile @@ -17,8 +17,9 @@ IMAGE_URL_FED33 = fedora:33 IMAGE_URL_FED34 = fedora:34 IMAGE_URL_FED35 = fedora:35 IMAGE_URL_ARCH = archlinux:latest +IMAGE_URL_OPENSUSE_LEAP_153 = opensuse/leap:15.3 -base: image-deb image-fed33 image-fed34 image-fed35 image-arch +base: image-deb image-fed33 image-fed34 image-fed35 image-arch image-opensuse-leap-153 # Create the image based on ubuntu image-deb: image @@ -30,6 +31,11 @@ image-arch: image image-arch: DOCKER_FILE_SOURCE = Dockerfile.arch image-arch: src = archlinux +# Create the image based on opensuse leap 15.3 +image-arch: image +image-arch: DOCKER_FILE_SOURCE = Dockerfile.opensuse-leap-153 +image-arch: src = opensuse-leap-153 + # Create the image based on fedora 33 image-fed33: image image-fed33: DOCKER_FILE_SOURCE = Dockerfile.fed33 @@ -53,7 +59,7 @@ image: requirements.txt docker-source ## We host our own copy of the image ubuntu:latest docker-source: - sed "s|IMAGE_URL_FED33|$(IMAGE_URL_FED33)|; s|IMAGE_URL_FED34|$(IMAGE_URL_FED34)|; s|IMAGE_URL_FED35|$(IMAGE_URL_FED35)|; s|IMAGE_URL_DEB|$(IMAGE_URL_DEB)|; s|IMAGE_URL_ARCH|$(IMAGE_URL_ARCH)|" $(DOCKER_FILE_SOURCE) > /tmp/Dockerfile.image + sed "s|IMAGE_URL_FED33|$(IMAGE_URL_FED33)|; s|IMAGE_URL_FED34|$(IMAGE_URL_FED34)|; s|IMAGE_URL_FED35|$(IMAGE_URL_FED35)|; s|IMAGE_URL_DEB|$(IMAGE_URL_DEB)|; s|IMAGE_URL_OPENSUSE_LEAP_153|$(IMAGE_URL_OPENSUSE_LEAP_153)|; s|IMAGE_URL_ARCH|$(IMAGE_URL_ARCH)|" $(DOCKER_FILE_SOURCE) > /tmp/Dockerfile.image requirements.txt: @ touch requirements.txt @@ -71,7 +77,7 @@ local: docker-source @ rm -rf __SOURCE_APP || true local: NAME_IMAGE = proton-python-client:latest -local-base: local-deb local-fed33 local-fed34 local-fed35 local-arch +local-base: local-deb local-fed33 local-fed34 local-fed35 local-arch image-opensuse-leap-153 local-deb: local local-deb: DOCKER_FILE_SOURCE = Dockerfile.deb @@ -85,6 +91,9 @@ local-fed34: DOCKER_FILE_SOURCE = Dockerfile.fed34 local-fed35: local local-fed35: DOCKER_FILE_SOURCE = Dockerfile.fed35 +local-opensuse-leap-153: local +local-opensuse-leap-153: DOCKER_FILE_SOURCE = Dockerfile.opensuse-leap-153 + local-arch: local local-arch: DOCKER_FILE_SOURCE = Dockerfile.arch @@ -119,7 +128,7 @@ test-fed33: local-fed33 --volume $(PWD)/.env:/home/user/proton-python-client.env \ proton-python-client:latest \ python3 -m pytest - + test-fed34: local-fed34 # Keep -it because with colors it's better @ docker run \ @@ -129,7 +138,7 @@ test-fed34: local-fed34 --volume $(PWD)/.env:/home/user/proton-python-client.env \ proton-python-client:latest \ python3 -m pytest - + test-fed35: local-fed35 # Keep -it because with colors it's better @ docker run \ @@ -139,7 +148,7 @@ test-fed35: local-fed35 --volume $(PWD)/.env:/home/user/proton-python-client.env \ proton-python-client:latest \ python3 -m pytest - + ## Run tests against the latest version of the image from your code test-arch: local-arch # Keep -it because with colors it's better @@ -150,3 +159,14 @@ test-arch: local-arch --volume $(PWD)/.env:/home/user/proton-python-client.env \ proton-python-client:latest \ python3 -m pytest + +## Run tests against the latest version of the image from your code +test-opensuse-leap-15-3: local-arch + # Keep -it because with colors it's better + @ docker run \ + --rm \ + -it \ + --privileged \ + --volume $(PWD)/.env:/home/user/proton-python-client.env \ + proton-python-client:latest \ + python3 -m pytest