From c783747def8014460afab1ed28d68a8eb1f5e957 Mon Sep 17 00:00:00 2001
From: MonsterDruide1 <5958456@gmail.com>
Date: Wed, 30 Nov 2022 13:04:34 +0100
Subject: [PATCH] Move to creator-ee

---
 .gitlab-ci.yml | 42 +++++++++++++++++++++++++++++++++---------
 .gitmodules    |  3 +++
 creator-ee     |  1 +
 3 files changed, 37 insertions(+), 9 deletions(-)
 create mode 100644 .gitmodules
 create mode 160000 creator-ee

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 1647a47..9b7c354 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -2,8 +2,8 @@
 image: docker:20.10.21
 
 variables:
-  DOCKER_TLS_CERTDIR: "/certs"
-  DOCKER_BUILDKIT: 1
+    DOCKER_TLS_CERTDIR: "/certs"
+    DOCKER_BUILDKIT: 1
 
 services:
   - docker:dind
@@ -11,11 +11,35 @@ services:
 build:
   stage: build
   script:
+    # Install requirements for creator-ee scripts
+    - apk add curl git bash py3-pip podman
+
+    # download creator-ee submodule, as it doesn't get fetched automatically
+    - git submodule update --init --recursive
+
+    # install taskfile, called using "task"
+    - sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d
+    # Extend PATH to contain task and ansible (installed later)
+    - export PATH=$PATH:$(pwd)/bin:/root/.local/bin
+    
+    # no idea, might be required, was in the repository earlier as well...
     - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
-    - docker build --pull --build-arg BUILDKIT_INLINE_CACHE=1
-      --cache-from $CI_REGISTRY_IMAGE:latest
-      --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
-      --tag $CI_REGISTRY_IMAGE:latest
-      "."
-    - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
-    - docker push $CI_REGISTRY_IMAGE:latest
+
+    # move to the right directory to prepare executing buildscript
+    - cd creator-ee
+     
+    # https://github.com/webdevops/Dockerfile/issues/266
+    - echo 'Ansible refuses to read from a world-writeable folder, hence' && chmod -v 700 $(pwd)
+
+    # install ansible to get ansible-galaxy
+    - python3 -m pip install --user ansible
+
+    # finally start building the CI image    
+    - task build
+      #- docker build --pull --build-arg BUILDKIT_INLINE_CACHE=1
+      #--cache-from $CI_REGISTRY_IMAGE:latest
+      #--tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
+      #--tag $CI_REGISTRY_IMAGE:latest
+      #"."
+      #    - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
+      #    - docker push $CI_REGISTRY_IMAGE:latest
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..bb624b5
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "creator-ee"]
+	path = creator-ee
+	url = https://github.com/ansible/creator-ee/
diff --git a/creator-ee b/creator-ee
new file mode 160000
index 0000000..10f3218
--- /dev/null
+++ b/creator-ee
@@ -0,0 +1 @@
+Subproject commit 10f321890edda4e722c46c0b6f68af9d3debf25f
-- 
GitLab