Skip to content

Commit

Permalink
Add client and server language selection while launching code spaces (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
rekhaabaidipati authored Oct 1, 2024
1 parent f61c97a commit bb12328
Show file tree
Hide file tree
Showing 64 changed files with 1,674 additions and 170 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/advanced-integration-v1/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// For more details, see https://aka.ms/devcontainer.json.
{
"name": "PayPal Advanced Integration (v1)",
"name": "advanced-integration-v1",
"image": "mcr.microsoft.com/devcontainers/javascript-node:20",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}/advanced-integration/v1",
// Use 'onCreateCommand' to run commands when creating the container.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// For more details, see https://aka.ms/devcontainer.json.
{
"name": "advanced-integration-v2/html/dotnet",
"image": "mcr.microsoft.com/devcontainers/dotnet:8.0",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
// Use 'onCreateCommand' to run commands when creating the container.
"onCreateCommand": "bash .devcontainer/advanced-integration-v2-html-dotnet/welcome-message.sh",
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "chmod +x .devcontainer/update_settings.sh && .devcontainer/update_settings.sh && chmod +x .devcontainer/post-commands.sh && .devcontainer/post-commands.sh post-create",
// Use 'postAttachCommand' to run commands when attaching to the container.
"postAttachCommand": "chmod +x .devcontainer/post-commands.sh && .devcontainer/post-commands.sh post-attach",
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [3000, 8080],
"portsAttributes": {
"8080": {
"label": "Preview of Advanced Checkout Flow"
},
"3000": {
"label": "HTML",
"onAutoForward": "openBrowserOnce"
}
},
"secrets": {
"PAYPAL_CLIENT_ID": {
"description": "Sandbox client ID of the application.",
"documentationUrl": "https://developer.paypal.com/dashboard/applications/sandbox"
},
"PAYPAL_CLIENT_SECRET": {
"description": "Sandbox secret of the application.",
"documentationUrl": "https://developer.paypal.com/dashboard/applications/sandbox"
}
},
"containerEnv": {
"VISIBLE_FOLDER_SERVER": "dotnet",
"VISIBLE_FOLDER_CLIENT": "html",
"VISIBLE_FOLDER_PROJECT": "advanced-integration",
"VISIBLE_FOLDER_VERSION": "v2"
},
"customizations": {
"vscode": {
"extensions": [
"vsls-contrib.codetour",
"PayPal.vscode-paypal",
"ms-dotnettools.csharp"
],
"settings": {
"git.openRepositoryInParentFolders": "always"
}
}
},
"features": {
"ghcr.io/devcontainers/features/node:1": {
"version": "lts"
}
}
}
57 changes: 57 additions & 0 deletions .devcontainer/advanced-integration-v2-html-java/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// For more details, see https://aka.ms/devcontainer.json.
{
"name": "advanced-integration-v2/html/java",
"image": "mcr.microsoft.com/devcontainers/java:21",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
// Use 'onCreateCommand' to run commands when creating the container.
"onCreateCommand": "bash .devcontainer/advanced-integration-v2-html-java/welcome-message.sh",
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "chmod +x .devcontainer/update_settings.sh && .devcontainer/update_settings.sh && chmod +x .devcontainer/post-commands.sh && .devcontainer/post-commands.sh post-create",
// Use 'postAttachCommand' to run commands when attaching to the container.
"postAttachCommand": "chmod +x .devcontainer/post-commands.sh && .devcontainer/post-commands.sh post-attach",
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [3000, 8080],
"portsAttributes": {
"8080": {
"label": "Preview of Advanced Checkout Flow"
},
"3000": {
"label": "HTML",
"onAutoForward": "openBrowserOnce"
}
},
"secrets": {
"PAYPAL_CLIENT_ID": {
"description": "Sandbox client ID of the application.",
"documentationUrl": "https://developer.paypal.com/dashboard/applications/sandbox"
},
"PAYPAL_CLIENT_SECRET": {
"description": "Sandbox secret of the application.",
"documentationUrl": "https://developer.paypal.com/dashboard/applications/sandbox"
}
},
"containerEnv": {
"VISIBLE_FOLDER_SERVER": "java",
"VISIBLE_FOLDER_CLIENT": "html",
"VISIBLE_FOLDER_PROJECT": "advanced-integration",
"VISIBLE_FOLDER_VERSION": "v2"
},
"customizations": {
"vscode": {
"extensions": ["vsls-contrib.codetour", "PayPal.vscode-paypal"],
"settings": {
"git.openRepositoryInParentFolders": "always"
}
}
},
"features": {
"ghcr.io/devcontainers/features/java:1": {
"version": "22",
"jdkDistro": "tem",
"installMaven": "true"
},
"ghcr.io/devcontainers/features/node:1": {
"version": "lts"
}
}
}
23 changes: 23 additions & 0 deletions .devcontainer/advanced-integration-v2-html-java/welcome-message.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh

set -e

WELCOME_MESSAGE="
👋 Welcome to the \"PayPal Advanced Checkout Integration Example\"
🛠️ Your environment is fully setup with all the required software.
🚀 Once you rename the \".env.example\" file to \".env\" and update \"PAYPAL_CLIENT_ID\" and \"PAYPAL_CLIENT_SECRET\", the checkout page will automatically open in the browser after the server is restarted."

ALTERNATE_WELCOME_MESSAGE="
👋 Welcome to the \"PayPal Advanced Checkout Integration Example\"
🛠️ Your environment is fully setup with all the required software.
🚀 The checkout page will automatically open in the browser after the server is started."

if [ -n "$PAYPAL_CLIENT_ID" ] && [ -n "$PAYPAL_CLIENT_SECRET" ]; then
WELCOME_MESSAGE="${ALTERNATE_WELCOME_MESSAGE}"
fi

sudo bash -c "echo \"${WELCOME_MESSAGE}\" > /usr/local/etc/vscode-dev-containers/first-run-notice.txt"
56 changes: 56 additions & 0 deletions .devcontainer/advanced-integration-v2-html-node/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// For more details, see https://aka.ms/devcontainer.json.
{
"name": "advanced-integration-v2/html/node",
"image": "mcr.microsoft.com/devcontainers/javascript-node:20",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
// Use 'onCreateCommand' to run commands when creating the container.
"onCreateCommand": "bash .devcontainer/advanced-integration-v2-html-node/welcome-message.sh",
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "chmod +x .devcontainer/update_settings.sh && .devcontainer/update_settings.sh && chmod +x .devcontainer/post-commands.sh && .devcontainer/post-commands.sh post-create",
// Use 'postAttachCommand' to run commands when attaching to the container.
"postAttachCommand": "chmod +x .devcontainer/post-commands.sh && .devcontainer/post-commands.sh post-attach",
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [3000, 8080],
"portsAttributes": {
"8080": {
"label": "Preview of Advanced Checkout Flow"
},
"3000": {
"label": "HTML",
"onAutoForward": "openBrowserOnce"
}
},
"secrets": {
"PAYPAL_CLIENT_ID": {
"description": "Sandbox client ID of the application.",
"documentationUrl": "https://developer.paypal.com/dashboard/applications/sandbox"
},
"PAYPAL_CLIENT_SECRET": {
"description": "Sandbox secret of the application.",
"documentationUrl": "https://developer.paypal.com/dashboard/applications/sandbox"
}
},
"containerEnv": {
"VISIBLE_FOLDER_SERVER": "node",
"VISIBLE_FOLDER_CLIENT": "html",
"VISIBLE_FOLDER_PROJECT": "advanced-integration",
"VISIBLE_FOLDER_VERSION": "v2"
},
"customizations": {
"vscode": {
"extensions": [
"vsls-contrib.codetour",
"PayPal.vscode-paypal",
"dbaeumer.vscode-eslint"
],
"settings": {
"git.openRepositoryInParentFolders": "always"
}
}
},
"features": {
"ghcr.io/devcontainers/features/node:1": {
"version": "lts"
}
}
}
23 changes: 23 additions & 0 deletions .devcontainer/advanced-integration-v2-html-node/welcome-message.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh

set -e

WELCOME_MESSAGE="
👋 Welcome to the \"PayPal Advanced Checkout Integration Example\"
🛠️ Your environment is fully setup with all the required software.
🚀 Once you rename the \".env.example\" file to \".env\" and update \"PAYPAL_CLIENT_ID\" and \"PAYPAL_CLIENT_SECRET\", the checkout page will automatically open in the browser after the server is restarted."

ALTERNATE_WELCOME_MESSAGE="
👋 Welcome to the \"PayPal Advanced Checkout Integration Example\"
🛠️ Your environment is fully setup with all the required software.
🚀 The checkout page will automatically open in the browser after the server is started."

if [ -n "$PAYPAL_CLIENT_ID" ] && [ -n "$PAYPAL_CLIENT_SECRET" ]; then
WELCOME_MESSAGE="${ALTERNATE_WELCOME_MESSAGE}"
fi

sudo bash -c "echo \"${WELCOME_MESSAGE}\" > /usr/local/etc/vscode-dev-containers/first-run-notice.txt"
56 changes: 56 additions & 0 deletions .devcontainer/advanced-integration-v2-html-php/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// For more details, see https://aka.ms/devcontainer.json.
{
"name": "advanced-integration-v2/html/php",
"image": "mcr.microsoft.com/devcontainers/php:8",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
// Use 'onCreateCommand' to run commands when creating the container.
"onCreateCommand": "bash .devcontainer/advanced-integration-v2-html-php/welcome-message.sh",
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "chmod +x .devcontainer/update_settings.sh && .devcontainer/update_settings.sh && chmod +x .devcontainer/post-commands.sh && .devcontainer/post-commands.sh post-create",
// Use 'postAttachCommand' to run commands when attaching to the container.
"postAttachCommand": "chmod +x .devcontainer/post-commands.sh && .devcontainer/post-commands.sh post-attach",
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [3000, 8080],
"portsAttributes": {
"8080": {
"label": "Preview of Advanced Checkout Flow"
},
"3000": {
"label": "HTML",
"onAutoForward": "openBrowserOnce"
}
},
"secrets": {
"PAYPAL_CLIENT_ID": {
"description": "Sandbox client ID of the application.",
"documentationUrl": "https://developer.paypal.com/dashboard/applications/sandbox"
},
"PAYPAL_CLIENT_SECRET": {
"description": "Sandbox secret of the application.",
"documentationUrl": "https://developer.paypal.com/dashboard/applications/sandbox"
}
},
"containerEnv": {
"VISIBLE_FOLDER_SERVER": "php",
"VISIBLE_FOLDER_CLIENT": "html",
"VISIBLE_FOLDER_PROJECT": "advanced-integration",
"VISIBLE_FOLDER_VERSION": "v2"
},
"customizations": {
"vscode": {
"extensions": [
"vsls-contrib.codetour",
"PayPal.vscode-paypal",
"xdebug.php-debug"
],
"settings": {
"git.openRepositoryInParentFolders": "always"
}
}
},
"features": {
"ghcr.io/devcontainers/features/node:1": {
"version": "lts"
}
}
}
23 changes: 23 additions & 0 deletions .devcontainer/advanced-integration-v2-html-php/welcome-message.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh

set -e

WELCOME_MESSAGE="
👋 Welcome to the \"PayPal Advanced Checkout Integration Example\"
🛠️ Your environment is fully setup with all the required software.
🚀 Once you rename the \".env.example\" file to \".env\" and update \"PAYPAL_CLIENT_ID\" and \"PAYPAL_CLIENT_SECRET\", the checkout page will automatically open in the browser after the server is restarted."

ALTERNATE_WELCOME_MESSAGE="
👋 Welcome to the \"PayPal Advanced Checkout Integration Example\"
🛠️ Your environment is fully setup with all the required software.
🚀 The checkout page will automatically open in the browser after the server is started."

if [ -n "$PAYPAL_CLIENT_ID" ] && [ -n "$PAYPAL_CLIENT_SECRET" ]; then
WELCOME_MESSAGE="${ALTERNATE_WELCOME_MESSAGE}"
fi

sudo bash -c "echo \"${WELCOME_MESSAGE}\" > /usr/local/etc/vscode-dev-containers/first-run-notice.txt"
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// For more details, see https://aka.ms/devcontainer.json.
{
"name": " advanced-integration-v2/react/dotnet",
"image": "mcr.microsoft.com/devcontainers/dotnet:8.0",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
// Use 'onCreateCommand' to run commands when creating the container.
"onCreateCommand": "bash .devcontainer/advanced-integration-v2-react-dotnet/welcome-message.sh",
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "chmod +x .devcontainer/update_settings.sh && .devcontainer/update_settings.sh && chmod +x .devcontainer/post-commands.sh && .devcontainer/post-commands.sh post-create",
// Use 'postAttachCommand' to run commands when attaching to the container.
"postAttachCommand": "chmod +x .devcontainer/post-commands.sh && .devcontainer/post-commands.sh post-attach",
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [3000, 8080],
"portsAttributes": {
"8080": {
"label": "Preview of Advanced Checkout Flow"
},
"3000": {
"label": "React",
"onAutoForward": "openBrowserOnce"
}
},
"secrets": {
"PAYPAL_CLIENT_ID": {
"description": "Sandbox client ID of the application.",
"documentationUrl": "https://developer.paypal.com/dashboard/applications/sandbox"
},
"PAYPAL_CLIENT_SECRET": {
"description": "Sandbox secret of the application.",
"documentationUrl": "https://developer.paypal.com/dashboard/applications/sandbox"
}
},
"containerEnv": {
"VISIBLE_FOLDER_SERVER": "dotnet",
"VISIBLE_FOLDER_CLIENT": "react",
"VISIBLE_FOLDER_PROJECT": "advanced-integration",
"VISIBLE_FOLDER_VERSION": "v2"
},
"customizations": {
"vscode": {
"extensions": [
"vsls-contrib.codetour",
"PayPal.vscode-paypal",
"ms-dotnettools.csharp"
],
"settings": {
"git.openRepositoryInParentFolders": "always"
}
}
},
"features": {
"ghcr.io/devcontainers/features/node:1": {
"version": "lts"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh

set -e

WELCOME_MESSAGE="
👋 Welcome to the \"PayPal Advanced Checkout Integration Example\"
🛠️ Your environment is fully setup with all the required software.
🚀 Once you rename the \".env.example\" file to \".env\" and update \"PAYPAL_CLIENT_ID\" and \"PAYPAL_CLIENT_SECRET\", the checkout page will automatically open in the browser after the server is restarted."

ALTERNATE_WELCOME_MESSAGE="
👋 Welcome to the \"PayPal Advanced Checkout Integration Example\"
🛠️ Your environment is fully setup with all the required software.
🚀 The checkout page will automatically open in the browser after the server is started."

if [ -n "$PAYPAL_CLIENT_ID" ] && [ -n "$PAYPAL_CLIENT_SECRET" ]; then
WELCOME_MESSAGE="${ALTERNATE_WELCOME_MESSAGE}"
fi

sudo bash -c "echo \"${WELCOME_MESSAGE}\" > /usr/local/etc/vscode-dev-containers/first-run-notice.txt"
Loading

0 comments on commit bb12328

Please sign in to comment.