generated from trywilco/Anythink-Market-Public
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
WilcoApp
committed
Jan 4, 2024
1 parent
b8e5aba
commit 993251f
Showing
230 changed files
with
27,136 additions
and
11,353 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains 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 |
---|---|---|
@@ -1,17 +1,42 @@ | ||
{ | ||
"name": "laravel-fresh-install", | ||
"name": "Anythink Development Container", | ||
"image": "public.ecr.aws/v0a2l7y2/wilco/anythink-devcontainer:latest", | ||
"forwardPorts": [3000, 3001, 5433, 27017], | ||
"portsAttributes": { | ||
"3000": { | ||
"label": "Backend", | ||
"elevateIfNeeded": true, | ||
"requireLocalPort": true, | ||
"onAutoForward": "silent" | ||
}, | ||
"3001": { | ||
"label": "Frontend", | ||
"elevateIfNeeded": true, | ||
"requireLocalPort": true, | ||
"onAutoForward": "silent" | ||
}, | ||
"5433": { | ||
"label": "Database", | ||
"elevateIfNeeded": true, | ||
"requireLocalPort": true, | ||
"onAutoForward": "silent" | ||
}, | ||
"27017": { | ||
"label": "Database", | ||
"elevateIfNeeded": true, | ||
"requireLocalPort": true, | ||
"onAutoForward": "silent" | ||
} | ||
}, | ||
"postStartCommand": "bash -c .devcontainer/setup.sh", | ||
|
||
// "xdebug.php-debug" = official XDEBUG extension | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"xdebug.php-debug" | ||
] | ||
} | ||
}, | ||
|
||
"forwardPorts": [80], | ||
|
||
// execute our one-time repo init if /vendor/ does not exist | ||
"postCreateCommand": "sh init_repo.sh" | ||
"settings": { | ||
"extensions.ignoreRecommendations": true, | ||
"workbench.startupEditor": "none", | ||
"workbench.colorTheme": "Visual Studio Dark", | ||
"workbench.colorCustomizations": {}, | ||
"workbench.welcomePage.walkthroughs.openOnInstall": false, | ||
"workbench.welcomePage.experimental.videoTutorials": "off", | ||
"github.codespaces.defaultExtensions": [] | ||
} | ||
} |
This file contains 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,29 @@ | ||
#!/bin/bash | ||
|
||
RETRY_COUNT=3 | ||
RETRY_INTERVAL=5 | ||
TARGET_PORTS=("3000" "3001") | ||
|
||
sleep 5 | ||
|
||
for port in "${TARGET_PORTS[@]}"; do | ||
for ((try = 1; try <= RETRY_COUNT; try++)); do | ||
echo "Attempt $try: Making port $port public." | ||
|
||
gh codespace ports visibility $port:public -c $CODESPACE_NAME | ||
sleep 1 | ||
|
||
ports_json=$(gh codespace ports -c $CODESPACE_NAME --json label,sourcePort,visibility) | ||
visibility=$(echo "$ports_json" | jq -r ".[] | select(.sourcePort == $port) | .visibility") | ||
|
||
if [ "$visibility" == "public" ]; then | ||
echo "Port $port is now public." | ||
break | ||
elif [ $try -lt $RETRY_COUNT ]; then | ||
echo "Port $port is still not public. Retrying in $RETRY_INTERVAL seconds..." | ||
sleep $RETRY_INTERVAL | ||
else | ||
echo "Failed to make port $port public after $RETRY_COUNT attempts." | ||
fi | ||
done | ||
done |
This file contains 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,25 @@ | ||
WILCO_ID="`cat .wilco`" | ||
ENGINE_EVENT_ENDPOINT="${ENGINE_BASE_URL}/users/${WILCO_ID}/event" | ||
CODESPACE_BACKEND_HOST="${CODESPACE_NAME}-3000.preview.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}" | ||
CODESPACE_BACKEND_URL="https://${CODESPACE_BACKEND_HOST}" | ||
|
||
# Update engine that codespace started for user | ||
curl -L -X POST "${ENGINE_EVENT_ENDPOINT}" -H "Content-Type: application/json" --data-raw "{ \"event\": \"github_codespace_started\" }" | ||
|
||
# Export backend envs when in codespaces | ||
echo "export CODESPACE_BACKEND_HOST=\"${CODESPACE_BACKEND_HOST}\"" >> ~/.bashrc | ||
echo "export CODESPACE_BACKEND_URL=\"${CODESPACE_BACKEND_URL}\"" >> ~/.bashrc | ||
echo "export CODESPACE_WDS_SOCKET_PORT=443" >> ~/.bashrc | ||
|
||
|
||
# Change backend port visibility to public | ||
echo "(&>/dev/null .devcontainer/open_port.sh &)" >> ~/.bashrc | ||
|
||
|
||
# Export welcome prompt in bash: | ||
echo "printf \"\n\n☁️☁️☁️️ Anythink: Develop in the Cloud ☁️☁️☁️\n\"" >> ~/.bashrc | ||
echo "printf \"\n=============================================\n\"" >> ~/.bashrc | ||
echo "gh codespace ports -c $CODESPACE_NAME" >> ~/.bashrc | ||
echo "printf \"=============================================\n\"" >> ~/.bashrc | ||
echo "printf \"(Once docker-compose is up and running, you can access the frontend and backend using the above urls)\n\"" >> ~/.bashrc | ||
echo "printf \"\n\x1b[31m \x1b[1m👉 Type: \\\`docker-compose up\\\` to run the project. 👈\n\n\"" >> ~/.bashrc |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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,3 @@ | ||
# Description | ||
|
||
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. |
Oops, something went wrong.