diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a4ec57c..016acc2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,7 +3,7 @@ name: Supremo CICD on: push: branches: - - main + - dev-howie jobs: build_supremo_app: @@ -13,10 +13,10 @@ jobs: OCI_CLI_FINGERPRINT: ${{ secrets.OCI_CLI_FINGERPRINT }} OCI_CLI_KEY_CONTENT: ${{ secrets.OCI_CLI_KEY_CONTENT }} OCI_CLI_REGION: ${{ secrets.OCI_CLI_REGION }} - REACT_APP_CARLIST_URL: http:///car-service-redis/cars - REACT_APP_CARAPP_LOGINAUTH_URL: http:///user-service-redis/authn - REACT_APP_GET_USER_BY_ID: http:///user-service-redis/users/ - REACT_APP_CREATE_ORDER_API: http:///order-service/create-order + REACT_APP_CARLIST_URL: http://158.178.137.168/car-service-redis/cars + REACT_APP_CARAPP_LOGINAUTH_URL: http://158.178.137.168/user-service-redis/authn + REACT_APP_GET_USER_BY_ID: http://158.178.137.168/user-service-redis/users/ + REACT_APP_CREATE_ORDER_API: http://158.178.137.168/order-service/create-order runs-on: ubuntu-latest steps: - name: Checkout @@ -41,7 +41,7 @@ jobs: uses: docker/login-action@v3 with: registry: bom.ocir.io - username: ${{ secrets.OCI_USERNAME }} + username: ${{ secrets.OCIR_USERNAME }} password: ${{ secrets.OCI_AUTH_TOKEN }} - name: Use Node.js diff --git a/README.md b/README.md index fb94709..a939da2 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ * OCI_CLI_TENANCY * OCI_CLI_USER * OCI_COMPARTMENT_OCID - * OCI_USERNAME + * OCIR_USERNAME * OCI_AUTH_TOKEN * OCI_DEVOPS_PIPELINE_ID @@ -54,7 +54,7 @@ kubectl get secrets -n supremo #### Update Code and Run Github Action -1. Search for `` across all the files in this repository and update it with the IP address of the backend server. +1. Search for `158.178.137.168` across all the files in this repository and update it with the IP address of the backend server. 2. Commit and push the changes to Github. diff --git a/frontend/src/App.js b/frontend/src/App.js index 0fc4245..273a5e6 100644 --- a/frontend/src/App.js +++ b/frontend/src/App.js @@ -102,7 +102,7 @@ function App(backendData, setShowPopular, setShowFilter, setFilterOptions) { useEffect(() => { // Fetch booking data - fetch(`http:///order-service/user-orders?userid=${getUserId}`) + fetch(`http://158.178.137.168/order-service/user-orders?userid=${getUserId}`) .then((response) => response.json()) .then((data) => { console.log("Data from server:>> ", data); @@ -115,7 +115,7 @@ function App(backendData, setShowPopular, setShowFilter, setFilterOptions) { // Fetch car data const fetchUserData = async () => { try { - const response = await fetch(`http:///user-service-redis/users/${getUserId}`); + const response = await fetch(`http://158.178.137.168/user-service-redis/users/${getUserId}`); const userData = await response.json(); setUserData(userData); diff --git a/frontend/src/TopNavBarN.js b/frontend/src/TopNavBarN.js index a22bbe2..121fe7f 100644 --- a/frontend/src/TopNavBarN.js +++ b/frontend/src/TopNavBarN.js @@ -29,7 +29,7 @@ const TopNavBarN = ({ onLogout, userJsonVal, bookingCount, clearFilters }) => { setUserID(userId); console.log('Fetching data for user ID:', userJsonVal.userid); - fetch(`http:///order-service/user-orders?userid=${userId}`) + fetch(`http://158.178.137.168/order-service/user-orders?userid=${userId}`) .then((response) => response.json()) .then((data) => { console.log("Data from server:", data.length); @@ -47,7 +47,7 @@ const TopNavBarN = ({ onLogout, userJsonVal, bookingCount, clearFilters }) => { setUserID(userId); console.log('Fetching data for user ID: > ', userId); - fetch(`http:///order-service/user-orders?userid=${userId}`) + fetch(`http://158.178.137.168/order-service/user-orders?userid=${userId}`) .then((response) => response.json()) .then((data) => { console.log("Data from server:>> ", data); diff --git a/frontend/src/pages/AboutUs.js b/frontend/src/pages/AboutUs.js index 576deef..f019c68 100644 --- a/frontend/src/pages/AboutUs.js +++ b/frontend/src/pages/AboutUs.js @@ -20,7 +20,7 @@ function AboutUs({ onLogout, userJsonVal, bookingCount }) { useEffect(() => { if(getUserId){ console.log('Fetching data for user ID:', getUserId); - fetch(`http:///order-service/user-orders?userid=${getUserId}`) + fetch(`http://158.178.137.168/order-service/user-orders?userid=${getUserId}`) .then((response) => response.json()) .then((data) => { console.log("Data from server:)) ", data); diff --git a/frontend/src/pages/AskMe.js b/frontend/src/pages/AskMe.js index d0387ee..0825830 100644 --- a/frontend/src/pages/AskMe.js +++ b/frontend/src/pages/AskMe.js @@ -20,7 +20,7 @@ function AskMe({ onLogout, userJsonVal, bookingCount }) { useEffect(() => { if (getUserId) { console.log('Fetching data for user ID:', getUserId); - fetch(`http:///order-service/user-orders?userid=${getUserId}`) + fetch(`http://158.178.137.168/order-service/user-orders?userid=${getUserId}`) .then((response) => response.json()) .then((data) => { console.log("Data from server:)) ", data); @@ -78,7 +78,7 @@ function AskMe({ onLogout, userJsonVal, bookingCount }) { redirect: 'follow' }; - fetch("http:///askme-search", requestOptions) + fetch("http://158.178.137.168/askme-search", requestOptions) .then(response => response.json()) .then(result => { console.log(result); diff --git a/frontend/src/pages/CarCheckOut copy.js b/frontend/src/pages/CarCheckOut copy.js index 76f059d..78ff051 100644 --- a/frontend/src/pages/CarCheckOut copy.js +++ b/frontend/src/pages/CarCheckOut copy.js @@ -48,7 +48,7 @@ function CarCheckOut({ bookingDetails }) { useEffect(() => { - fetch("http:///car-service-redis/cars"+`/${id}`) + fetch("http://158.178.137.168/car-service-redis/cars"+`/${id}`) .then((response) => response.json()) .then((data) => { // console.log("from http://146.56.171.43:8081 ", id); @@ -61,7 +61,7 @@ function CarCheckOut({ bookingDetails }) { useEffect(() => { console.log('Fetching data for user ID:', getUserId); - fetch(`http:///order-service/user-orders?userid=${getUserId}`) + fetch(`http://158.178.137.168/order-service/user-orders?userid=${getUserId}`) .then((response) => response.json()) .then((data) => { console.log("Data from server:)) ", data); @@ -86,7 +86,7 @@ function CarCheckOut({ bookingDetails }) { //console.log("userDataN ", userDataN); useEffect(() => { - fetch(`http:///user-service-redis/users/${getUserId}`) + fetch(`http://158.178.137.168/user-service-redis/users/${getUserId}`) .then((response) => response.json()) .then((data) => { // console.log("from http://146.56.171.43:8081 ", id); @@ -148,7 +148,7 @@ function CarCheckOut({ bookingDetails }) { const handleCheckout = async () => { // Call your authentication API with username and password //console.log("api calling ", process.env.REACT_APP_CREATE_ORDER_API); - const response = await fetch("http:///order-service/create-order", { + const response = await fetch("http://158.178.137.168/order-service/create-order", { method: 'POST', headers: { 'Content-Type': 'application/json', diff --git a/frontend/src/pages/CarCheckOut.js b/frontend/src/pages/CarCheckOut.js index 0a88b40..e19c301 100644 --- a/frontend/src/pages/CarCheckOut.js +++ b/frontend/src/pages/CarCheckOut.js @@ -55,7 +55,7 @@ function CarCheckOut({ bookingDetails }) { useEffect(() => { - fetch("http:///car-service-redis/cars" + `/${id}`) + fetch("http://158.178.137.168/car-service-redis/cars" + `/${id}`) .then((response) => response.json()) .then((data) => { // console.log("from http://146.56.171.43:8081 ", id); @@ -68,7 +68,7 @@ function CarCheckOut({ bookingDetails }) { useEffect(() => { console.log('Fetching data for user ID:', getUserId); - fetch(`http:///order-service/user-orders?userid=${getUserId}`) + fetch(`http://158.178.137.168/order-service/user-orders?userid=${getUserId}`) .then((response) => response.json()) .then((data) => { console.log("Data from server:)) ", data); @@ -93,7 +93,7 @@ function CarCheckOut({ bookingDetails }) { //console.log("userDataN ", userDataN); useEffect(() => { - fetch(`http:///user-service-redis/users/${getUserId}`) + fetch(`http://158.178.137.168/user-service-redis/users/${getUserId}`) .then((response) => response.json()) .then((data) => { // console.log("from http://146.56.171.43:8081 ", id); @@ -155,7 +155,7 @@ function CarCheckOut({ bookingDetails }) { const handleCheckout = async () => { // Call your authentication API with username and password //console.log("api calling ", process.env.REACT_APP_CREATE_ORDER_API); - const response = await fetch("http:///order-service/create-order", { + const response = await fetch("http://158.178.137.168/order-service/create-order", { method: 'POST', headers: { 'Content-Type': 'application/json', diff --git a/frontend/src/pages/CarDetails copy 2.js b/frontend/src/pages/CarDetails copy 2.js index cb0f0cb..5ab8f1c 100644 --- a/frontend/src/pages/CarDetails copy 2.js +++ b/frontend/src/pages/CarDetails copy 2.js @@ -43,7 +43,7 @@ function CarDetails({ setBookingDetails }) { useEffect(() => { console.log('Fetching data for user ID:', getUserId); - fetch(`http:///order-service/user-orders?userid=${getUserId}`) + fetch(`http://158.178.137.168/order-service/user-orders?userid=${getUserId}`) .then((response) => response.json()) .then((data) => { console.log("Data from server:)) ", data); @@ -55,7 +55,7 @@ function CarDetails({ setBookingDetails }) { }, [getUserId]); useEffect(() => { - fetch(`http:///user-service-redis/users/${getUserId}`) + fetch(`http://158.178.137.168/user-service-redis/users/${getUserId}`) .then((response) => response.json()) .then((data) => { // console.log("from http://146.56.171.43:8081 ", id); diff --git a/frontend/src/pages/CarDetails copy.js b/frontend/src/pages/CarDetails copy.js index cb0f0cb..5ab8f1c 100644 --- a/frontend/src/pages/CarDetails copy.js +++ b/frontend/src/pages/CarDetails copy.js @@ -43,7 +43,7 @@ function CarDetails({ setBookingDetails }) { useEffect(() => { console.log('Fetching data for user ID:', getUserId); - fetch(`http:///order-service/user-orders?userid=${getUserId}`) + fetch(`http://158.178.137.168/order-service/user-orders?userid=${getUserId}`) .then((response) => response.json()) .then((data) => { console.log("Data from server:)) ", data); @@ -55,7 +55,7 @@ function CarDetails({ setBookingDetails }) { }, [getUserId]); useEffect(() => { - fetch(`http:///user-service-redis/users/${getUserId}`) + fetch(`http://158.178.137.168/user-service-redis/users/${getUserId}`) .then((response) => response.json()) .then((data) => { // console.log("from http://146.56.171.43:8081 ", id); diff --git a/frontend/src/pages/CarDetails.js b/frontend/src/pages/CarDetails.js index 4444ef8..8c2b612 100644 --- a/frontend/src/pages/CarDetails.js +++ b/frontend/src/pages/CarDetails.js @@ -35,7 +35,7 @@ function CarDetails({ setBookingDetails }) { }, [id]); useEffect(() => { - fetch(`http:///order-service/user-orders?userid=${getUserId}`) + fetch(`http://158.178.137.168/order-service/user-orders?userid=${getUserId}`) .then((response) => response.json()) .then((data) => { setcarsCountData(data); @@ -46,7 +46,7 @@ function CarDetails({ setBookingDetails }) { }, [getUserId]); useEffect(() => { - fetch(`http:///user-service-redis/users/${getUserId}`) + fetch(`http://158.178.137.168/user-service-redis/users/${getUserId}`) .then((response) => response.json()) .then((data) => { setUserData(data); diff --git a/frontend/src/pages/ConfirmBooking.js b/frontend/src/pages/ConfirmBooking.js index 2c18a76..191bea2 100644 --- a/frontend/src/pages/ConfirmBooking.js +++ b/frontend/src/pages/ConfirmBooking.js @@ -43,7 +43,7 @@ function ConfirmBooking() { }, [id]); useEffect(() => { - fetch(`http:///user-service-redis/users/${getUserId}`) + fetch(`http://158.178.137.168/user-service-redis/users/${getUserId}`) .then((response) => response.json()) .then((data) => { // console.log("from http://146.56.171.43:8081 ", id); @@ -57,7 +57,7 @@ function ConfirmBooking() { useEffect(() => { console.log('Fetching data for user ID:', getUserId); - fetch(`http:///order-service/user-orders?userid=${getUserId}`) + fetch(`http://158.178.137.168/order-service/user-orders?userid=${getUserId}`) .then((response) => response.json()) .then((data) => { console.log("Data from server:)) ", data); diff --git a/frontend/src/pages/MyBookings copy.js b/frontend/src/pages/MyBookings copy.js index 8ffb747..6964336 100644 --- a/frontend/src/pages/MyBookings copy.js +++ b/frontend/src/pages/MyBookings copy.js @@ -33,7 +33,7 @@ function MyBookings({ onLogout, userJsonVal, bookingCount }) { } }; useEffect(() => { - fetch(`http:///user-service-redis/users/${getUserId}`) + fetch(`http://158.178.137.168/user-service-redis/users/${getUserId}`) .then((response) => response.json()) .then((data) => { // console.log("from http://146.56.171.43:8081 ", id); @@ -47,7 +47,7 @@ function MyBookings({ onLogout, userJsonVal, bookingCount }) { useEffect(() => { console.log('Fetching data for user ID:', getUserId); - fetch(`http:///order-service/user-orders?userid=${getUserId}`) + fetch(`http://158.178.137.168/order-service/user-orders?userid=${getUserId}`) .then((response) => response.json()) .then((data) => { console.log("Data from server:)) ", data); @@ -87,7 +87,7 @@ function MyBookings({ onLogout, userJsonVal, bookingCount }) { setSelectedCarId(carId); setShowModal(true); - fetch(`http:///car-service-redis/carshealth/${carId}`) + fetch(`http://158.178.137.168/car-service-redis/carshealth/${carId}`) .then((response) => response.json()) .then((data) => { console.log("Car Details:", data); diff --git a/frontend/src/pages/MyBookings.js b/frontend/src/pages/MyBookings.js index 58db9cf..c92bda0 100644 --- a/frontend/src/pages/MyBookings.js +++ b/frontend/src/pages/MyBookings.js @@ -57,7 +57,7 @@ function MyBookings({ onLogout, userJsonVal, bookingCount }) { } }; useEffect(() => { - fetch(`http:///user-service-redis/users/${getUserId}`) + fetch(`http://158.178.137.168/user-service-redis/users/${getUserId}`) .then((response) => response.json()) .then((data) => { // console.log("from http://146.56.171.43:8081 ", id); @@ -68,7 +68,7 @@ function MyBookings({ onLogout, userJsonVal, bookingCount }) { }); console.log('Fetching data for user ID:', getUserId); - fetch(`http:///order-service/user-orders?userid=${getUserId}`) + fetch(`http://158.178.137.168/order-service/user-orders?userid=${getUserId}`) .then((response) => response.json()) .then((data) => { console.log("Data from server:)) ", data); @@ -121,7 +121,7 @@ function MyBookings({ onLogout, userJsonVal, bookingCount }) { console.log("car health check for car id", carId); setSelectedCarId(carId); - fetch(`http:///car-service-redis/carshealth/${carId}`) + fetch(`http://158.178.137.168/car-service-redis/carshealth/${carId}`) .then((response) => response.json()) .then((data) => { console.log("Car Details:", data); diff --git a/frontend/src/pages/login.js b/frontend/src/pages/login.js index 2f980ee..f7e7f9a 100644 --- a/frontend/src/pages/login.js +++ b/frontend/src/pages/login.js @@ -48,7 +48,7 @@ const Login = () => { // myHeaders.append("Content-Type", "application/json",); // let raw = JSON.stringify({ userid: username, password }); - // const response = await fetch("http:///user-service-redis/authn", { + // const response = await fetch("http://158.178.137.168/user-service-redis/authn", { // method: 'POST', // mode: 'cors', // this cannot be 'no-cors' // headers: { diff --git a/frontend/src/pages/profile.js b/frontend/src/pages/profile.js index ed01114..bfa9ec9 100644 --- a/frontend/src/pages/profile.js +++ b/frontend/src/pages/profile.js @@ -25,7 +25,7 @@ function Profile({ onLogout, userJsonVal, bookingCount }) { useEffect(() => { - fetch(`http:///user-service-redis/users/${getUserId}`) + fetch(`http://158.178.137.168/user-service-redis/users/${getUserId}`) .then((response) => response.json()) .then((data) => { setUserData(data); @@ -38,7 +38,7 @@ function Profile({ onLogout, userJsonVal, bookingCount }) { useEffect(() => { if(getUserId){ console.log('Fetching data for user ID:', getUserId); - fetch(`http:///order-service/user-orders?userid=${getUserId}`) + fetch(`http://158.178.137.168/order-service/user-orders?userid=${getUserId}`) .then((response) => response.json()) .then((data) => { console.log("Data from server:)) ", data);