-
Notifications
You must be signed in to change notification settings - Fork 514
Added Dev containers to setup development environment and start the application in codespaces #52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// For more details, see https://aka.ms/devcontainer.json. | ||
{ | ||
"name": "PayPal Advanced Integration", | ||
"image": "mcr.microsoft.com/devcontainers/universal:2", | ||
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}/advanced-integration", | ||
|
||
// Use 'onCreateCommand' to run commands when creating the container. | ||
"onCreateCommand": "bash ../.devcontainer/advanced-integration/welcome-message.sh", | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
"postCreateCommand": "npm install", | ||
|
||
// Use 'postAttachCommand' to run commands when attaching to the container. | ||
"postAttachCommand": { | ||
"Start server": "npm start" | ||
}, | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
"forwardPorts": [ | ||
8888 | ||
], | ||
"portsAttributes": { | ||
"8888": { | ||
"label": "Preview of Advanced Checkout Flow", | ||
"onAutoForward": "openBrowserOnce" | ||
} | ||
}, | ||
|
||
"secrets": { | ||
"CLIENT_ID": { | ||
"description": "Sandbox client ID of the application.", | ||
"documentationUrl": "https://developer.paypal.com/dashboard/applications/sandbox" | ||
}, | ||
"APP_SECRET": { | ||
"description": "Sandbox secret of the application.", | ||
"documentationUrl": "https://developer.paypal.com/dashboard/applications/sandbox" | ||
} | ||
}, | ||
|
||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"vsls-contrib.codetour" | ||
], | ||
"settings": { | ||
"git.openRepositoryInParentFolders": "always" | ||
} | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 \"CLIENT_ID\" and \"APP_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 "$CLIENT_ID" ] && [ -n "$APP_SECRET" ]; then | ||
WELCOME_MESSAGE="${ALTERNATE_WELCOME_MESSAGE}" | ||
fi | ||
|
||
sudo bash -c "echo \"${WELCOME_MESSAGE}\" > /usr/local/etc/vscode-dev-containers/first-run-notice.txt" | ||
gregjopa marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// For more details, see https://aka.ms/devcontainer.json. | ||
{ | ||
"name": "PayPal Standard Integration", | ||
"image": "mcr.microsoft.com/devcontainers/universal:2", | ||
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}/advanced-integration", | ||
|
||
// Use 'onCreateCommand' to run commands when creating the container. | ||
"onCreateCommand": "bash ../.devcontainer/standard-integration/welcome-message.sh", | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
"postCreateCommand": "npm install", | ||
|
||
// Use 'postAttachCommand' to run commands when attaching to the container. | ||
"postAttachCommand": { | ||
"Start server": "npm start" | ||
}, | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
"forwardPorts": [ | ||
8888 | ||
], | ||
"portsAttributes": { | ||
"8888": { | ||
"label": "Preview of Advanced Checkout Flow", | ||
"onAutoForward": "openBrowserOnce" | ||
} | ||
}, | ||
|
||
"secrets": { | ||
"CLIENT_ID": { | ||
"description": "Sandbox client ID of the application.", | ||
"documentationUrl": "https://developer.paypal.com/dashboard/applications/sandbox" | ||
}, | ||
"APP_SECRET": { | ||
"description": "Sandbox secret of the application.", | ||
"documentationUrl": "https://developer.paypal.com/dashboard/applications/sandbox" | ||
} | ||
}, | ||
|
||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"vsls-contrib.codetour" | ||
], | ||
"settings": { | ||
"git.openRepositoryInParentFolders": "always" | ||
} | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
WELCOME_MESSAGE=" | ||
👋 Welcome to the \"PayPal Standard Checkout Integration Example\" | ||
|
||
🛠️ Your environment is fully setup with all the required software. | ||
|
||
🚀 Once you rename the \".env.example\" file to \".env\" and update \"CLIENT_ID\" and \"APP_SECRET\", the checkout page will automatically open in the browser after the server is restarted." | ||
|
||
ALTERNATE_WELCOME_MESSAGE=" | ||
👋 Welcome to the \"PayPal Standard 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 "$CLIENT_ID" ] && [ -n "$APP_SECRET" ]; then | ||
WELCOME_MESSAGE="${ALTERNATE_WELCOME_MESSAGE}" | ||
fi | ||
|
||
sudo bash -c "echo \"${WELCOME_MESSAGE}\" > /usr/local/etc/vscode-dev-containers/first-run-notice.txt" | ||
gregjopa marked this conversation as resolved.
Show resolved
Hide resolved
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.