From 3c2593b114726995944d9d1c36b6e17032b82f2c Mon Sep 17 00:00:00 2001 From: pa Date: Fri, 3 May 2024 21:40:10 +0000 Subject: [PATCH] disable onCreate --- .../clab-build-containerlab-with-ceos/devcontainer.json | 2 +- .../.devcontainer/postCreate.sh | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.devcontainer/clab-build-containerlab-with-ceos/devcontainer.json b/.devcontainer/clab-build-containerlab-with-ceos/devcontainer.json index c402c93..b6f1e25 100644 --- a/.devcontainer/clab-build-containerlab-with-ceos/devcontainer.json +++ b/.devcontainer/clab-build-containerlab-with-ceos/devcontainer.json @@ -17,7 +17,7 @@ "memory": "16gb", "storage": "32gb" }, - "onCreateCommand": "onCreate.sh", + // "onCreateCommand": "onCreate.sh", "postCreateCommand": "postCreate.sh", "workspaceMount": "source=${localWorkspaceFolder}/demos/${containerWorkspaceFolder},target=/${containerWorkspaceFolder},type=bind", "workspaceFolder": "/clab-build-containerlab-with-ceos" diff --git a/containers/clab-build-containerlab-with-ceos/.devcontainer/postCreate.sh b/containers/clab-build-containerlab-with-ceos/.devcontainer/postCreate.sh index 61166f4..412c480 100644 --- a/containers/clab-build-containerlab-with-ceos/.devcontainer/postCreate.sh +++ b/containers/clab-build-containerlab-with-ceos/.devcontainer/postCreate.sh @@ -4,6 +4,13 @@ set +e ardl get eos --image-type cEOS --version ${CEOS_LAB_VERSION} --import-docker +# replace all markdown vars in demo directory +grep -rl 'https://.*.github.io/one-click-se-demos/' . --exclude-dir .git | xargs sed -i 's/https:\/\/.*.github.io\/one-click-se-demos/https:\/\/'"${GITHUB_REPOSITORY%%/*}"'.github.io\/one-click-se-demos/g' +grep -rl 'https://github.com/.*/one-click-se-demos' . --exclude-dir .git | xargs sed -i 's/https:\/\/github.com\/.*\/one-click-se-demos/https:\/\/github.com\/'"${GITHUB_REPOSITORY%%/*}"'\/one-click-se-demos/g' +grep -rl '{{gh.repo_name}}' . --exclude-dir .git | xargs sed -i 's/{{gh.repo_name}}/'"${GITHUB_REPOSITORY##*/}"'/g' +grep -rl '{{gh.org_name}}' . --exclude-dir .git | xargs sed -i 's/{{gh.org_name}}/'"${GITHUB_REPOSITORY%%/*}"'/g' +grep -rl '{{gh.repository}}' . --exclude-dir .git | xargs sed -i 's@{{gh.org_name}}@'"${GITHUB_REPOSITORY}"'@g' + # init demo dir as Git repo if requested for this demo env if ${GIT_INIT}; then cd ${CONTAINERWSF}