changes
This commit is contained in:
@@ -1,51 +0,0 @@
|
|||||||
name: Deploy Utopia Dev
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- dev
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ gitea.workflow }}-${{ gitea.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
deploy:
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Deploy to server via SSH
|
|
||||||
uses: appleboy/ssh-action@v1.2.5
|
|
||||||
with:
|
|
||||||
host: ${{ secrets.SSH_HOST_DEV }}
|
|
||||||
username: ${{ secrets.SSH_USER_DEV }}
|
|
||||||
password: ${{ secrets.SSH_PASSWORD_DEV }}
|
|
||||||
port: ${{ secrets.SSH_PORT_DEV }}
|
|
||||||
script: |
|
|
||||||
cd ~/deploy/utopiadev
|
|
||||||
echo "Pulling latest code..."
|
|
||||||
git pull
|
|
||||||
echo "Starting deployment..."
|
|
||||||
sh start.sh
|
|
||||||
echo "Deploy done"
|
|
||||||
|
|
||||||
cleanup:
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
needs: deploy
|
|
||||||
if: always()
|
|
||||||
steps:
|
|
||||||
- name: Cleanup Docker on server
|
|
||||||
uses: appleboy/ssh-action@v1.2.5
|
|
||||||
with:
|
|
||||||
host: ${{ secrets.SSH_HOST_DEV }}
|
|
||||||
username: ${{ secrets.SSH_USER_DEV }}
|
|
||||||
password: ${{ secrets.SSH_PASSWORD_DEV }}
|
|
||||||
port: ${{ secrets.SSH_PORT_DEV }}
|
|
||||||
script: |
|
|
||||||
echo "=== Starting Docker cleanup ==="
|
|
||||||
docker images --format "{{.Repository}}:{{.Tag}} {{.ID}}" | \
|
|
||||||
grep -v ":latest" | \
|
|
||||||
awk '{print $2}' | \
|
|
||||||
xargs -r docker rmi || true
|
|
||||||
docker system prune -f
|
|
||||||
echo "=== Cleanup completed ==="
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
name: Deploy Utopia Product
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- product
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ gitea.workflow }}-${{ gitea.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
deploy:
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Deploy to server via SSH
|
|
||||||
uses: appleboy/ssh-action@v1.2.5
|
|
||||||
with:
|
|
||||||
host: ${{ secrets.SSH_HOST_PRO }}
|
|
||||||
username: ${{ secrets.SSH_USER_PRO }}
|
|
||||||
password: ${{ secrets.SSH_PASSWORD_PRO }}
|
|
||||||
port: ${{ secrets.SSH_PORT_PRO }}
|
|
||||||
script: |
|
|
||||||
cd ~/deploy/utopia
|
|
||||||
echo "Pulling latest code..."
|
|
||||||
git pull
|
|
||||||
echo "Starting deployment..."
|
|
||||||
sh start.sh
|
|
||||||
echo "Deploy done"
|
|
||||||
|
|
||||||
cleanup:
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
needs: deploy
|
|
||||||
if: always()
|
|
||||||
steps:
|
|
||||||
- name: Cleanup Docker on server
|
|
||||||
uses: appleboy/ssh-action@v1.2.5
|
|
||||||
with:
|
|
||||||
host: ${{ secrets.SSH_HOST_PRO }}
|
|
||||||
username: ${{ secrets.SSH_USER_PRO }}
|
|
||||||
password: ${{ secrets.SSH_PASSWORD_PRO }}
|
|
||||||
port: ${{ secrets.SSH_PORT_PRO }}
|
|
||||||
script: |
|
|
||||||
echo "=== Starting Docker cleanup ==="
|
|
||||||
docker images --format "{{.Repository}}:{{.Tag}} {{.ID}}" | \
|
|
||||||
grep -v ":latest" | \
|
|
||||||
awk '{print $2}' | \
|
|
||||||
xargs -r docker rmi || true
|
|
||||||
docker system prune -f
|
|
||||||
echo "=== Cleanup completed ==="
|
|
||||||
8
build.sh
8
build.sh
@@ -1,10 +1,6 @@
|
|||||||
# docker build -t y99-application .
|
|
||||||
# docker tag y99-application docker.bigdatatech.vn/y99-application
|
|
||||||
# docker push docker.bigdatatech.vn/y99-application
|
|
||||||
|
|
||||||
python3 envprod.py
|
PROJECT="erp"
|
||||||
PROJECT="utopia"
|
IMAGE="hrm"
|
||||||
IMAGE="biz"
|
|
||||||
|
|
||||||
docker build -t docker.bigdatatech.vn/$PROJECT/$IMAGE:latest .
|
docker build -t docker.bigdatatech.vn/$PROJECT/$IMAGE:latest .
|
||||||
docker push docker.bigdatatech.vn/$PROJECT/$IMAGE:latest
|
docker push docker.bigdatatech.vn/$PROJECT/$IMAGE:latest
|
||||||
|
|||||||
10
buildbiz.sh
10
buildbiz.sh
@@ -1,10 +0,0 @@
|
|||||||
# docker build -t y99-application .
|
|
||||||
# docker tag y99-application docker.bigdatatech.vn/y99-application
|
|
||||||
# docker push docker.bigdatatech.vn/y99-application
|
|
||||||
|
|
||||||
python3 envdev.py
|
|
||||||
PROJECT="utopia"
|
|
||||||
IMAGE="biz"
|
|
||||||
|
|
||||||
docker build -t docker.bigdatatech.vn/$PROJECT/$IMAGE:latest .
|
|
||||||
docker push docker.bigdatatech.vn/$PROJECT/$IMAGE:latest
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
# docker build -t y99-application .
|
|
||||||
# docker tag y99-application docker.bigdatatech.vn/y99-application
|
|
||||||
# docker push docker.bigdatatech.vn/y99-application
|
|
||||||
|
|
||||||
python3 envproddealer.py
|
|
||||||
PROJECT="utopia"
|
|
||||||
IMAGE="dealer"
|
|
||||||
|
|
||||||
docker build -t docker.bigdatatech.vn/$PROJECT/$IMAGE:latest .
|
|
||||||
docker push docker.bigdatatech.vn/$PROJECT/$IMAGE:latest
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
# docker build -t y99-application .
|
|
||||||
# docker tag y99-application docker.bigdatatech.vn/y99-application
|
|
||||||
# docker push docker.bigdatatech.vn/y99-application
|
|
||||||
|
|
||||||
python3 envdevdealer.py
|
|
||||||
PROJECT="utopia"
|
|
||||||
IMAGE="dealer-dev"
|
|
||||||
|
|
||||||
docker build -t docker.bigdatatech.vn/$PROJECT/$IMAGE:latest .
|
|
||||||
docker push docker.bigdatatech.vn/$PROJECT/$IMAGE:latest
|
|
||||||
10
builddev.sh
10
builddev.sh
@@ -1,10 +0,0 @@
|
|||||||
# docker build -t y99-application .
|
|
||||||
# docker tag y99-application docker.bigdatatech.vn/y99-application
|
|
||||||
# docker push docker.bigdatatech.vn/y99-application
|
|
||||||
|
|
||||||
python3 envdev.py
|
|
||||||
PROJECT="utopia"
|
|
||||||
IMAGE="biz-dev"
|
|
||||||
|
|
||||||
docker build -t docker.bigdatatech.vn/$PROJECT/$IMAGE:latest .
|
|
||||||
docker push docker.bigdatatech.vn/$PROJECT/$IMAGE:latest
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
apps: [
|
apps: [
|
||||||
{
|
{
|
||||||
name: 'UtopiaBiz',
|
name: 'HRM',
|
||||||
port: '3000',
|
port: '3000',
|
||||||
exec_mode: 'cluster',
|
exec_mode: 'cluster',
|
||||||
instances: 'max',
|
instances: 'max',
|
||||||
|
|||||||
26
envdev.py
26
envdev.py
@@ -1,26 +0,0 @@
|
|||||||
def search_text(file, text, new_text):
|
|
||||||
f = open(file, 'r', newline='\n')
|
|
||||||
content = f.read()
|
|
||||||
print(text, content.find(new_text))
|
|
||||||
content = content.replace(text, new_text)
|
|
||||||
f.close()
|
|
||||||
with open(file, 'w', newline='\n') as f:
|
|
||||||
f.write(content)
|
|
||||||
|
|
||||||
file = './app/plugins/02-connection.js'
|
|
||||||
text1 = 'mode = "prod"'
|
|
||||||
newtext1 = 'mode = "dev"'
|
|
||||||
newtext2 = 'module = "application"'
|
|
||||||
text2 = 'module = "dealer"'
|
|
||||||
newtext3 = 'Biz_Setting'
|
|
||||||
text3 = 'Dealer_Setting'
|
|
||||||
newtext4 = 'Biz_Rights'
|
|
||||||
text4 = 'Dealer_Rights'
|
|
||||||
search_text(file, text1, newtext1)
|
|
||||||
search_text(file, text2, newtext2)
|
|
||||||
search_text(file, text3, newtext3)
|
|
||||||
search_text(file, text4, newtext4)
|
|
||||||
file = './app/assets/styles/main.scss'
|
|
||||||
search_text(file, '/logo.png', '/logo_dev.png')
|
|
||||||
file = './app/stores/index.js'
|
|
||||||
search_text(file,'export const useStore = defineStore("main", {','export const useStore = defineStore("maindev", {')
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
def search_text(file, text, new_text):
|
|
||||||
f = open(file, 'r', newline='\n')
|
|
||||||
content = f.read()
|
|
||||||
print(text, content.find(new_text))
|
|
||||||
content = content.replace(text, new_text)
|
|
||||||
f.close()
|
|
||||||
with open(file, 'w', newline='\n') as f:
|
|
||||||
f.write(content)
|
|
||||||
|
|
||||||
file = './app/plugins/02-connection.js'
|
|
||||||
|
|
||||||
text1 = 'mode = "prod"'
|
|
||||||
newtext1 = 'mode = "dev"'
|
|
||||||
text2 = 'module = "application"'
|
|
||||||
newtext2 = 'module = "dealer"'
|
|
||||||
text3 = 'Biz_Setting'
|
|
||||||
newtext3 = 'Dealer_Setting'
|
|
||||||
text4 = 'Biz_Rights'
|
|
||||||
newtext4 = 'Dealer_Rights'
|
|
||||||
search_text(file, text1, newtext1)
|
|
||||||
search_text(file, text2, newtext2)
|
|
||||||
search_text(file, text3, newtext3)
|
|
||||||
search_text(file, text4, newtext4)
|
|
||||||
file = './app/assets/styles/main.scss'
|
|
||||||
search_text(file, '/logo.png', '/logo_dev.png')
|
|
||||||
file = './app/stores/index.js'
|
|
||||||
search_text(file,'export const useStore = defineStore("main", {','export const useStore = defineStore("maindev", {')
|
|
||||||
26
envprod.py
26
envprod.py
@@ -1,26 +0,0 @@
|
|||||||
def search_text(file, text, new_text):
|
|
||||||
f = open(file, 'r', newline='\n')
|
|
||||||
content = f.read()
|
|
||||||
print(text, content.find(new_text))
|
|
||||||
content = content.replace(text, new_text)
|
|
||||||
f.close()
|
|
||||||
with open(file, 'w', newline='\n') as f:
|
|
||||||
f.write(content)
|
|
||||||
|
|
||||||
file = './app/plugins/02-connection.js'
|
|
||||||
newtext1 = 'mode = "prod"'
|
|
||||||
text1 = 'mode = "dev"'
|
|
||||||
newtext2 = 'module = "application"'
|
|
||||||
text2 = 'module = "dealer"'
|
|
||||||
newtext3 = 'Biz_Setting'
|
|
||||||
text3 = 'Dealer_Setting'
|
|
||||||
newtext4 = 'Biz_Rights'
|
|
||||||
text4 = 'Dealer_Rights'
|
|
||||||
search_text(file, text1, newtext1)
|
|
||||||
search_text(file, text2, newtext2)
|
|
||||||
search_text(file, text3, newtext3)
|
|
||||||
search_text(file, text4, newtext4)
|
|
||||||
file = './app/assets/styles/main.scss'
|
|
||||||
search_text(file, '/logo_dev.png', '/logo.png')
|
|
||||||
file = './app/stores/index.js'
|
|
||||||
search_text(file,'export const useStore = defineStore("maindev", {','export const useStore = defineStore("main", {')
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
def search_text(file, text, new_text):
|
|
||||||
f = open(file, 'r', newline='\n')
|
|
||||||
content = f.read()
|
|
||||||
print(text, content.find(new_text))
|
|
||||||
content = content.replace(text, new_text)
|
|
||||||
f.close()
|
|
||||||
with open(file, 'w', newline='\n') as f:
|
|
||||||
f.write(content)
|
|
||||||
|
|
||||||
file = './app/plugins/02-connection.js'
|
|
||||||
text1 = 'mode = "dev"'
|
|
||||||
text2 = 'module = "application"'
|
|
||||||
newtext1 = 'mode = "prod"'
|
|
||||||
newtext2 = 'module = "dealer"'
|
|
||||||
text3 = 'Biz_Setting'
|
|
||||||
newtext3 = 'Dealer_Setting'
|
|
||||||
text4 = 'Biz_Rights'
|
|
||||||
newtext4 = 'Dealer_Rights'
|
|
||||||
search_text(file, text1, newtext1)
|
|
||||||
search_text(file, text2, newtext2)
|
|
||||||
search_text(file, text3, newtext3)
|
|
||||||
search_text(file, text4, newtext4)
|
|
||||||
file = './app/assets/styles/main.scss'
|
|
||||||
search_text(file, '/logo_dev.png', '/logo.png')
|
|
||||||
file = './app/stores/index.js'
|
|
||||||
search_text(file,'export const useStore = defineStore("maindev", {','export const useStore = defineStore("main", {')
|
|
||||||
Reference in New Issue
Block a user