Use the same template for all the jobs in the "container" stage.

Changes the URL of the "opensbi-cross-build" images by
using the same URL pattern as the other images.

Removes pushing the image to the additional CI_COMMIT_SHA tag.
It seems unnecessary.

Example of the old URLs:
- registry.gitlab.com/qemu-project/qemu:00a0bdc...
- registry.gitlab.com/qemu-project/qemu:opensbi-cross-build

Example of the new URL:
- registry.gitlab.com/qemu-project/qemu/qemu/opensbi-cross-build

Signed-off-by: Camilla Conte <cco...@redhat.com>
---
 .gitlab-ci.d/opensbi.yml | 23 ++++++++---------------
 1 file changed, 8 insertions(+), 15 deletions(-)

diff --git a/.gitlab-ci.d/opensbi.yml b/.gitlab-ci.d/opensbi.yml
index d0221632f6..bb90c56bcf 100644
--- a/.gitlab-ci.d/opensbi.yml
+++ b/.gitlab-ci.d/opensbi.yml
@@ -1,3 +1,6 @@
+include:
+  - local: '/.gitlab-ci.d/container-template.yml'
+
 # All jobs needing docker-opensbi must use the same rules it uses.
 .opensbi_job_rules:
   rules:
@@ -40,24 +43,14 @@
       when: on_success
 
 docker-opensbi:
+  extends: .container_job_template
   rules:
     - !reference [.opensbi_job_rules, rules]
-  stage: containers
-  image: docker:stable
-  services:
-    - docker:stable-dind
   variables:
     GIT_DEPTH: 3
-    IMAGE_TAG: $CI_REGISTRY_IMAGE:opensbi-cross-build
-  before_script:
-    - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
-    - until docker info; do sleep 1; done
-  script:
-    - docker pull $IMAGE_TAG || true
-    - docker build --cache-from $IMAGE_TAG --tag 
$CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
-                                           --tag $IMAGE_TAG 
.gitlab-ci.d/opensbi
-    - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
-    - docker push $IMAGE_TAG
+    NAME: opensbi-cross-build
+    DOCKERFILE: "$CI_PROJECT_DIR/.gitlab-ci.d/opensbi/Dockerfile"
+    BUILD_CONTEXT: "$CI_PROJECT_DIR/.gitlab-ci.d/opensbi"
 
 build-opensbi:
   rules:
@@ -72,7 +65,7 @@ build-opensbi:
       - opensbi32-generic-stderr.log
       - opensbi64-generic-stdout.log
       - opensbi64-generic-stderr.log
-  image: $CI_REGISTRY_IMAGE:opensbi-cross-build
+  image: $CI_REGISTRY_IMAGE/qemu/opensbi-cross-build:latest
   variables:
     GIT_DEPTH: 3
   script: # Clone the required submodules and build OpenSBI
-- 
2.40.1


Reply via email to