Skip to content

Commit

Permalink
add more replacements
Browse files Browse the repository at this point in the history
  • Loading branch information
ankudinov committed May 3, 2024
1 parent c1750af commit 84006c7
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
{%- if cookiecutter.cv_api_token_required %}
"CV_API_TOKEN": "${localEnv:CV_API_TOKEN}",
{%- endif %}
"CONTAINERWSF": "${containerWorkspaceFolder}"
"CONTAINERWSF": "${containerWorkspaceFolder}",
"GITHUB_REPOSITORY": "${localEnv:GITHUB_REPOSITORY}"
{% raw %}},{% endraw %}
"secrets": {% raw %}{{% endraw %}
{%- if cookiecutter.cv_api_token_required %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
// containerEnv set the variables applied to entire container
"containerEnv": {
"ARISTA_TOKEN": "${localEnv:ARTOKEN}",
"CONTAINERWSF": "${containerWorkspaceFolder}"
"CONTAINERWSF": "${containerWorkspaceFolder}",
"GITHUB_REPOSITORY": "${localEnv:GITHUB_REPOSITORY}"
},
"secrets": {
"ARTOKEN": {
Expand Down
3 changes: 2 additions & 1 deletion .devcontainer/avd-extended-workshop-part-1/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
// containerEnv set the variables applied to entire container
"containerEnv": {
"ARISTA_TOKEN": "${localEnv:ARTOKEN}",
"CONTAINERWSF": "${containerWorkspaceFolder}"
"CONTAINERWSF": "${containerWorkspaceFolder}",
"GITHUB_REPOSITORY": "${localEnv:GITHUB_REPOSITORY}"
},
"secrets": {
"ARTOKEN": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
// containerEnv set the variables applied to entire container
"containerEnv": {
"ARISTA_TOKEN": "${localEnv:ARTOKEN}",
"CONTAINERWSF": "${containerWorkspaceFolder}"
"CONTAINERWSF": "${containerWorkspaceFolder}",
"GITHUB_REPOSITORY": "${localEnv:GITHUB_REPOSITORY}"
},
"secrets": {
"ARTOKEN": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"containerEnv": {
"ARISTA_TOKEN": "${localEnv:ARTOKEN}",
"CV_API_TOKEN": "${localEnv:CV_API_TOKEN}",
"CONTAINERWSF": "${containerWorkspaceFolder}"
"CONTAINERWSF": "${containerWorkspaceFolder}",
"GITHUB_REPOSITORY": "${localEnv:GITHUB_REPOSITORY}"
},
"secrets": {
"CV_API_TOKEN": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"containerEnv": {
"ARISTA_TOKEN": "${localEnv:ARTOKEN}",
"CV_API_TOKEN": "${localEnv:CV_API_TOKEN}",
"CONTAINERWSF": "${containerWorkspaceFolder}"
"CONTAINERWSF": "${containerWorkspaceFolder}",
"GITHUB_REPOSITORY": "${localEnv:GITHUB_REPOSITORY}"
},
"secrets": {
"CV_API_TOKEN": {
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/publish-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
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_owner }}"'\/one-click-se-demos/g'
grep -rl '{{gh.repo_name}}' . --exclude-dir .git | xargs sed -i 's/{{gh.repo_name}}/'"${{ github.repository_owner }}"'/g'
grep -rl '{{gh.org_name}}' . --exclude-dir .git | xargs sed -i 's/{{gh.org_name}}/'"${{ github.repository_owner }}"'/g'
grep -rl '{{gh.repository}}' . --exclude-dir .git | xargs sed -i 's@{{gh.org_name}}@'"${{ github.repository }}"'@g'
- name: Setup Python3 🐍
uses: actions/setup-python@v5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit 84006c7

Please sign in to comment.