Skip to content

Commit

Permalink
changed api to testnet aut backend
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtmeeseeks committed Sep 6, 2024
1 parent a0dae7d commit 2adbbd5
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 36 deletions.
12 changes: 1 addition & 11 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,8 @@ jobs:
sudo git checkout main;
sudo git pull origin main;
echo "Stopping and removing specific service: aut_os_main"
sudo docker-compose stop aut_os_main
sudo docker-compose rm -f aut_os_main
echo "Removing dangling images"
sudo docker rmi $(sudo docker images -f "dangling=true" -q) || true
sudo docker build -t autlabs/aut-os:main . --build-arg ENV_FILE=.env
# sudo docker push autlabs/aut-os:main
echo "Pulling the new image"
# sudo docker-compose pull aut_os_main
docker-compose up -d --build aut_os_main
sudo docker-compose up --build aut_os_main -d
exit 0;
12 changes: 1 addition & 11 deletions .github/workflows/deploy_prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,8 @@ jobs:
sudo git checkout mainnet;
sudo git pull origin mainnet;
echo "Stopping and removing specific service: aut_os_mainnet"
sudo docker-compose stop aut_os_mainnet
sudo docker-compose rm -f aut_os_mainnet
echo "Removing dangling images"
sudo docker rmi $(sudo docker images -f "dangling=true" -q) || true
sudo docker build -t autlabs/aut-os:mainnet . --build-arg ENV_FILE=.env_prod
# sudo docker push autlabs/aut-os:mainnet
echo "Pulling the new image"
# sudo docker-compose pull aut_os_mainnet
docker-compose up -d --build aut_os_mainnet
sudo docker-compose up --build aut_os_mainnet -d
exit 0;
20 changes: 15 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
FROM node:latest as build
FROM node:alpine as build

WORKDIR /app

ENV PATH /app/node_modules/.bin:$PATH
ENV GENERATE_SOURCEMAP=false
ENV NODE_OPTIONS=--openssl-legacy-provider

ARG ENV_FILE
ENV ENV_FILE=${ENV_FILE}
ARG REACT_APP_NETWORK_ENV
ARG REACT_APP_API_URL
ARG REACT_APP_NODE_ENV
ARG REACT_APP_DEFAULT_CHAIN_ID
ARG REACT_APP_GRAPH_API_URL

ENV REACT_APP_NETWORK_ENV=$REACT_APP_NETWORK_ENV
ENV REACT_APP_API_URL=$REACT_APP_API_URL
ENV REACT_APP_NODE_ENV=$REACT_APP_NODE_ENV
ENV REACT_APP_DEFAULT_CHAIN_ID=$REACT_APP_DEFAULT_CHAIN_ID
ENV REACT_APP_GRAPH_API_URL=$REACT_APP_GRAPH_API_URL

# COPY .npmrc ./
COPY package.json ./
Expand All @@ -14,11 +25,10 @@ COPY package-lock.json ./
RUN npm install --legacy-peer-deps

COPY . ./
COPY ${ENV_FILE} .env

RUN npm run build

FROM nginx:stable-alpine
FROM nginx:alpine
COPY --from=build /app/build /usr/share/nginx/html
COPY nginx/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
Expand Down
26 changes: 21 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,30 @@
version: '3.7'
version: "3.7"

services:
aut_os_mainnet:
container_name: aut_os_mainnet
image: autlabs/aut-os:mainnet
build:
context: .
dockerfile: Dockerfile
args:
REACT_APP_NETWORK_ENV: "mainnet"
REACT_APP_API_URL: "https://mainnet-api.aut.id/api"
REACT_APP_NODE_ENV: "production"
REACT_APP_DEFAULT_CHAIN_ID: "137"
REACT_APP_GRAPH_API_URL: "https://subgraph.satsuma-prod.com/57f77e118c8e/3zi14w18sr5q42jggc1n6a--464735/aut-mainnet/api"
ports:
- '5003:80'
- "5003:80"

aut_os_main:
container_name: aut_os_main
image: autlabs/aut-os:main
build:
context: .
dockerfile: Dockerfile
args:
REACT_APP_NETWORK_ENV: "testnet"
REACT_APP_API_URL: "https://testnet-api.aut.id/api"
REACT_APP_NODE_ENV: "development"
REACT_APP_DEFAULT_CHAIN_ID: "80002"
REACT_APP_GRAPH_API_URL: "https://subgraph.satsuma-prod.com/57f77e118c8e/3zi14w18sr5q42jggc1n6a--464735/aut-amoy/api"
ports:
- '5003:80'
- "5003:80"
2 changes: 1 addition & 1 deletion src/api/aut.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useEffect, useState } from "react";

export const getAppConfig = (): Promise<NetworkConfig[]> => {
return axios
.get(`${environment.apiUrl}/autid/config/network/${environment.networkEnv}`)
.get(`${environment.apiUrl}/aut/config/network/${environment.networkEnv}`)
.then((r) => r.data);
};

Expand Down
6 changes: 3 additions & 3 deletions src/pages/Oauth2/oauth2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const useOAuth = () => {
onFailure(error);
} else {
const response = await axios.post(
`${environment.apiUrl}/autID/config/oauth2AccessTokenDiscord`,
`${environment.apiUrl}/aut/config/oauth2AccessTokenDiscord`,
{
code: message.data.payload.code,
callbackUrl
Expand Down Expand Up @@ -113,7 +113,7 @@ export const useOAuth = () => {
onFailure(error);
} else {
const response = await axios.post(
`${environment.apiUrl}/autID/config/oauth2AccessTokenX`,
`${environment.apiUrl}/aut/config/oauth2AccessTokenX`,
{
code: message.data.payload.code,
callbackUrl
Expand Down Expand Up @@ -173,7 +173,7 @@ export const useOAuth = () => {
onFailure(error);
} else {
const response = await axios.post(
`${environment.apiUrl}/autID/config/oauth2AccessTokenGithub`,
`${environment.apiUrl}/aut/config/oauth2AccessTokenGithub`,
{
code: message.data.payload.code,
callbackUrl
Expand Down

0 comments on commit 2adbbd5

Please sign in to comment.