From ff16580c30f95c92de86d92f7e271e6e70b416a2 Mon Sep 17 00:00:00 2001
From: Lars Bilke <lars.bilke@ufz.de>
Date: Mon, 27 Jun 2022 14:23:14 +0200
Subject: [PATCH] [ci] Added devcontainer job.

---
 ThirdParty/container-maker    |  2 +-
 scripts/ci/jobs/container.yml | 28 ++++++++++++++++++++++++++++
 2 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/ThirdParty/container-maker b/ThirdParty/container-maker
index ca735a3ab4a..5525c13730a 160000
--- a/ThirdParty/container-maker
+++ b/ThirdParty/container-maker
@@ -1 +1 @@
-Subproject commit ca735a3ab4ab481470f18569bebf4648f902802a
+Subproject commit 5525c13730a578ae29cad30c5f87857017ce764a
diff --git a/scripts/ci/jobs/container.yml b/scripts/ci/jobs/container.yml
index cac0fd4e5f8..c8aaefafef2 100644
--- a/scripts/ci/jobs/container.yml
+++ b/scripts/ci/jobs/container.yml
@@ -56,3 +56,31 @@ container:
     name: container
     paths:
       - ThirdParty/container-maker/_out/images/*.sif
+
+devcontainer:
+  stage: package
+  tags: [envinf, shell]
+  needs: []
+  rules:
+    - if: '$CI_COMMIT_BRANCH == "master"'
+      variables:
+        MASTER_UPLOAD: "--upload --tag $CI_REGISTRY/ogs/$CI_PROJECT_NAME/vscode:latest"
+    - if: $CI_COMMIT_TAG
+    - changes:
+        - scripts/ci/jobs/container.yml
+        - .devcontainer.json
+        - ThirdParty/container-maker
+    - if: $CI_COMMIT_BRANCH =~ /^v[0-9]\.[0-9]\.[0-9]/
+    - when: manual
+      allow_failure: true
+  extends:
+    - .container-maker-setup
+  script:
+    - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
+    # VS Code dev container
+    - >
+      poetry run ogscm compiler.py ogs.py ogs_web.py ogs_vscode.py -B --ogs off
+      --build_args ' --progress=plain'
+      --cpu-target $CPU_TARGET
+      --ccache --cpmcache
+       $MASTER_UPLOAD
-- 
GitLab