Verified Commit a9a5f55d authored by Hueser, Christian (FWCC) - 138593's avatar Hueser, Christian (FWCC) - 138593
Browse files

Set Docker option insecure-registry in CI and use hifis tag

* Set Docker command option --insecure-registry for the Staging
registry in the CI pipeline job, because the Staging registry has got a
self-signed certificate only.
* Add a tag hifis to select the right CI runners that support Docker in
Docker.
parent 6ff2c1ce
Pipeline #124490 passed with stages
in 16 minutes and 17 seconds
......@@ -43,7 +43,9 @@ licensing:
variables:
SELENIUM_DRIVER_URL: "http://selenium__standalone-firefox:4444"
services:
- docker:20.10.12-dind-alpine3.15
- name: docker:20.10.12-dind-alpine3.15
alias: docker
command: ["--insecure-registry", "registry-149-220-142-59.nip.io"]
- selenium/standalone-firefox:4
before_script:
- apk add --no-cache python3 python3-dev py3-pip cargo libffi-dev libgit2-dev
......@@ -53,15 +55,13 @@ licensing:
script:
- poetry run pytest --aai-password=$AAI_PASSWORD --gitlab-access-token=$GITLAB_ACCESS_TOKEN --registry-access-token=$REGISTRY_ACCESS_TOKEN -c $CONFIG_FILE tests/
tags:
- webterminal
- hifis
e2e-firefox-staging:
extends: .e2e:firefox
environment: STAGING
variables:
CONFIG_FILE: pytest.staging.ini
DOCKER_TLS_VERIFY: "0"
DOCKER_CERT_PATH: "/etc/docker/certs.d/"
e2e-firefox-production:
extends: .e2e:firefox
......
......@@ -5,7 +5,6 @@
"""Test usage of GitLab Container Registry."""
import os
from urllib.parse import urljoin
import docker
......@@ -85,7 +84,7 @@ def pushed_image(config, client: docker.DockerClient, login: dict, tag: str) ->
"""
dockerfile_path: str = "./tests/"
build_status: tuple = client.images.build(path=dockerfile_path, tag=tag)
push_result = client.api.push(repository=tag, stream=True, decode=True)
push_result = client.images.push(repository=tag, stream=False, decode=True)
yield push_result
client.images.remove(image=tag)
......@@ -115,9 +114,7 @@ def test_container_registry_push_to_gitlab(tag: str, pushed_image) -> None:
pushed_image (generator):
Resulting generator from building and pushing image.
"""
assert (
tag in list(pushed_image)[0]["status"]
), "Docker push into Gitlab Container Registry failed."
assert tag in pushed_image, "Docker push into Gitlab Container Registry failed."
@pytest.mark.container_registry
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment