diff --git a/.gitconfig b/.gitconfig new file mode 100644 index 00000000..98a080be --- /dev/null +++ b/.gitconfig @@ -0,0 +1,2 @@ +[credential] + helper = store diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index bda9561d..cdac174f 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -3,7 +3,10 @@ name: Build and Push Docker Image on: push: branches: - - main + - testing + - pre-release + - alpha + - beta workflow_dispatch: inputs: tag_name: diff --git a/.gitignore b/.gitignore index b2326cf2..7b702ae0 100644 --- a/.gitignore +++ b/.gitignore @@ -132,6 +132,7 @@ yarn-error.log* .profile .sudo_as_admin_successful .wget-hsts +.git-credentials # VSCode Files .vscode-server/ diff --git a/docker/Dockerfile b/docker/Dockerfile index 3b848103..e4790c3c 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -22,8 +22,8 @@ COPY --from=frontend-build /app/frontend/dist /usr/share/nginx/html COPY --from=backend-build /backend /backend COPY --from=backend-build /backend/entrypoint.sh /backend/entrypoint.sh +# Configure start-up RUN chmod +x /backend/entrypoint.sh - ENTRYPOINT ["/backend/entrypoint.sh"] EXPOSE 80 diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index ea125789..b786bef6 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -23,7 +23,7 @@ const App = () => { terminal.current.open(terminalRef.current); // Connect to the WebSocket server - socket.current = new WebSocket('2.tcp.ngrok.io:10908'); + socket.current = new WebSocket('localhost:3001'); // WebSocket Event Handlers socket.current.onopen = () => { diff --git a/git_push.sh b/git_push.sh new file mode 100755 index 00000000..de2a7154 --- /dev/null +++ b/git_push.sh @@ -0,0 +1,64 @@ +#!/bin/bash + +# Check if the correct number of parameters is provided +if [ "$#" -ne 2 ]; then + echo "Usage: $0 " + exit 1 +fi + +# Assign parameters to variables +COMMIT_MESSAGE=$1 +BRANCH_NAME=$2 + +# Ensure Git is using the credential helper for HTTPS +git config --global credential.helper store + +# Check if the branch exists +BRANCH_EXISTS=$(git branch --list "$BRANCH_NAME") + +if [ -z "$BRANCH_EXISTS" ]; then + echo "Branch '$BRANCH_NAME' does not exist. Creating it now..." + git checkout -b "$BRANCH_NAME" + if [ $? -ne 0 ]; then + echo "Failed to create branch '$BRANCH_NAME'." + exit 1 + fi +else + echo "Branch '$BRANCH_NAME' exists. Checking it out..." + git checkout "$BRANCH_NAME" + if [ $? -ne 0 ]; then + echo "Failed to checkout branch '$BRANCH_NAME'." + exit 1 + fi +fi + +# Check if there are any changes to commit +if git diff --quiet; then + echo "No changes to commit." + exit 0 +fi + +# Perform git operations +echo "Adding all changes..." +git add . +if [ $? -ne 0 ]; then + echo "Failed to add changes." + exit 1 +fi + +echo "Committing changes with message: $COMMIT_MESSAGE" +git commit -m "$COMMIT_MESSAGE" +if [ $? -ne 0 ]; then + echo "Commit failed." + exit 1 +fi + +echo "Pushing changes forcefully to branch: $BRANCH_NAME" +export GIT_ASKPASS=echo +git push -f origin "$BRANCH_NAME" +if [ $? -ne 0 ]; then + echo "Push failed." + exit 1 +fi + +echo "Git operations completed successfully." \ No newline at end of file