[extensions-web/barthalion/ci-shared-runners] Try with su
- From: Bartłomiej Piotrowski <bpiotrowski src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [extensions-web/barthalion/ci-shared-runners] Try with su
- Date: Mon, 20 Jul 2020 16:54:30 +0000 (UTC)
commit 91430ed05b7cc355fbc65d5c2db1cddaed21ece8
Author: Bartłomiej Piotrowski <bpiotrowski gnome org>
Date: Mon Jul 20 18:54:25 2020 +0200
Try with su
.gitlab-ci.yml | 28 ++++++----------------------
1 file changed, 6 insertions(+), 22 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 7b9bc6d..cf537f7 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,33 +1,17 @@
+
variables:
STORAGE_DRIVER: 'vfs'
IMAGE_NAME: 'registry.gitlab.gnome.org/infrastructure/extensions-web'
- CI_REGISTRY: 'registry.gitlab.gnome.org/infrastructure/extensions-web'
-build:
- image: 'registry.fedoraproject.org/fedora:30'
+test:
stage: build
- only:
- - branches@Infrastructure/extensions-web
script:
- dnf install -y buildah podman
# Newer versions of podman/buildah try to set overlayfs mount options when
# using the vfs driver, and this causes errors.
- sed -i '/^mountopt =.*/d' /etc/containers/storage.conf
- - podman login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- - podman build --cgroup-manager=cgroupfs -f openshift/docker/Dockerfile -t
registry.gitlab.gnome.org/infrastructure/extensions-web:${CI_COMMIT_SHORT_SHA} .
- - podman push ${IMAGE_NAME}:${CI_COMMIT_SHORT_SHA}
-
-test:
- image: $IMAGE_NAME:$CI_COMMIT_SHORT_SHA
- stage: test
- only:
- - branches@Infrastructure/extensions-web
- variables:
- EGO_SECRET_KEY: '.'
- EGO_DEBUG: '1'
- script:
- - python manage.py test
- - pip install safety
- - safety check -r requirements.txt
- - safety check -r requirements.ego.txt'
+ - useradd --home-dir /build --create-home --shell /bin/bash build
+ - su build -c "podman build --cgroup-manager=cgroupfs -f openshift/docker/Dockerfile -t
registry.gitlab.gnome.org/infrastructure/extensions-web:${CI_COMMIT_SHORT_SHA} ."
+ - su build -c "podman run --cgroup-manager=cgroupfs -e EGO_SECRET_KEY=. -e EGO_DEBUG=1 extensions-web
python manage.py test"
+ - su build -c "podman run extensions-web bash -c 'pip install safety && safety check -r requirements.txt
&& safety check -r requirements.ego.txt'"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]