Skip to content

Commit

Permalink
Initial commit for the devbox of terminus
Browse files Browse the repository at this point in the history
  • Loading branch information
hysyeah committed Apr 29, 2024
0 parents commit 94bba0e
Show file tree
Hide file tree
Showing 227 changed files with 60,966 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/build-server.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Build Server

on:
workflow_dispatch:

push:
branches:
- "main"
tags:
- "v*"

jobs:
update_dockerhub:
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v3
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASS }}

- name: Download release check-chart
uses: dsaltares/fetch-gh-release-asset@master
with:
file: check-chart_0.0.1_linux_amd64.tar.gz
repo: beclab/check-chart
target: check-chart.tar.gz
version: tags/v0.0.1
- name: get latest tag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
id: get-latest-tag
with:
fallback: latest

- name: unpack check-chart
run: |
tar zxvf check-chart.tar.gz
pwd
ls
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: beclab/devbox-server:${{ steps.get-latest-tag.outputs.tag }}
file: Dockerfile.server
54 changes: 54 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build frontend
on:
workflow_dispatch:

push:
branches:
- "main"
tags:
- "v*"
jobs:
build-main:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASS }}
- name: get latest tag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
id: get-latest-tag
with:
fallback: latest
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: "16.18"
- name: Cache
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/packagge-lock.json')}}
restore-keys: |
${{ runner.os }}-node-
- name: Bootstrap
run: |
npm install
- run: npm i -g @quasar/cli
- run: npm install
- name: Build
run: npm run app:build
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: beclab/devbox:${{ steps.get-latest-tag.outputs.tag }}
file: Dockerfile
27 changes: 27 additions & 0 deletions .github/workflows/release-dc-go.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Publish to Dockerhub ( GO )

on:
workflow_dispatch:
inputs:
tags:
description: 'Release Tags'

jobs:
update_dockerhub:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASS }}

- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
push: true
tags: beclab/go-dev:${{ github.event.inputs.tags }}
file: containers/Dockerfile.dev.go
27 changes: 27 additions & 0 deletions .github/workflows/release-dc-node.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Publish to Dockerhub ( NodeJS )

on:
workflow_dispatch:
inputs:
tags:
description: 'Release Tags'

jobs:
update_dockerhub:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASS }}

- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
push: true
tags: beclab/node-ts-dev:${{ github.event.inputs.tags }}
file: containers/Dockerfile.dev.node-ts
27 changes: 27 additions & 0 deletions .github/workflows/release-dc-python.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Publish to Dockerhub ( Python )

on:
workflow_dispatch:
inputs:
tags:
description: 'Release Tags'

jobs:
update_dockerhub:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASS }}

- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
push: true
tags: beclab/python-dev:${{ github.event.inputs.tags }}
file: containers/Dockerfile.dev.python
41 changes: 41 additions & 0 deletions .github/workflows/release-server.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish to Dockerhub ( server )

on:
workflow_dispatch:
inputs:
tags:
description: 'Release Tags'

jobs:
update_dockerhub:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASS }}

- name: Download release check-chart
uses: dsaltares/fetch-gh-release-asset@master
with:
file: check-chart_0.0.1_linux_amd64.tar.gz
repo: beclab/check-chart
target: check-chart.tar.gz
version: tags/v0.0.1
token: ${{ secrets.DOWNLOAD_TOKEN }}

- name: unpack check-chart
run: |
tar zxvf check-chart.tar.gz
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
push: true
context: .
tags: beclab/devbox-server:${{ github.event.inputs.tags }}
file: Dockerfile.server
46 changes: 46 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Publish to Dockerhub ( frontend )

on:
workflow_dispatch:
inputs:
tags:
description: 'Release Tags'

jobs:
update_dockerhub:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASS }}

- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '16.18'
- name: Cache
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/packagge-lock.json')}}
restore-keys: |
${{ runner.os }}-node-
- name: Bootstrap
run: |
npm install
- run: npm i -g @quasar/cli
- run: npm install
- name: Build
run: npm run app:build
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: beclab/devbox:${{ github.event.inputs.tags }}
file: Dockerfile
48 changes: 48 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# If you prefer the allow list template instead of the deny list, see community template:
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
#
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
.idea
*.out

# Dependency directories (remove the comment below to include it)
# vendor/

# Go workspace file
go.work
tmp
devbox

.DS_Store
.thumbs.db
node_modules
output

.history
packages/**/server/web-box
packages/**/db/
packages/**/cmd
.env
node_modules
packages/**/dist/
.quasar
.lintcache
.eslintcache
packages/**/data/

npm-debug.log*
yarn-debug.log*
yarn-error.log*

web/.vscode
packages/web/pkg/sumdb/sum.golang.org
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
save-exact=true
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v16.13.1
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"vue.vscode-typescript-vue-plugin",
"vue.volar"
]
}
12 changes: 12 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"editor.bracketPairColorization.enabled": true,
"editor.guides.bracketPairs": true,
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": ["source.fixAll.eslint"],
"eslint.validate": ["javascript", "javascriptreact", "typescript", "vue"],
"typescript.tsdk": "node_modules/typescript/lib",
"[vue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
35 changes: 35 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM nginx:stable-alpine

COPY packages/web/dist/spa /app

RUN apk --no-cache add nginx

RUN echo ' \
server { \
listen 80 default_server; \
root /app; \
\
location / { \
add_header Cache-Control "no-store"; \
try_files $uri $uri/index.html /index.html; \
} \
\
location /api/ { \
proxy_pass http://devbox-server:8080; \
proxy_set_header Host $http_host; \
proxy_set_header X-real-ip $remote_addr; \
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; \
proxy_http_version 1.1; \
proxy_set_header Upgrade $http_upgrade; \
proxy_set_header Connection $http_connection; \
proxy_set_header Accept-Encoding gzip; \
proxy_read_timeout 180; \
} \
\
}' > /etc/nginx/conf.d/default.conf

RUN ln -sf /dev/stdout /var/log/nginx/access.log && ln -sf /dev/stderr /var/log/nginx/error.log

EXPOSE 80

CMD [ "nginx", "-g", "daemon off;" ]
Loading

0 comments on commit 94bba0e

Please sign in to comment.