Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
root authored and root committed Dec 7, 2024
0 parents commit 8843676
Show file tree
Hide file tree
Showing 30 changed files with 798 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Set default behavior to automatically normalize line endings.
* text=auto
39 changes: 39 additions & 0 deletions .github/workflows/upload.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: publish
on:
push:
branches:
- master
- release/*

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build_vue:
runs-on: ubuntu-latest
name: publish
steps:
- uses: actions/checkout@v2
- uses: Pivot-Studio/action-qiniu-upload@master
with:
# Your qiniu access key, required.
access_key: ${{ secrets.QINIU_ACCESS_KEY }}

# Your qiniu secret key, required.
secret_key: ${{ secrets.QINIU_SECRET_KEY }}

# Bucket name, required.
bucket: ${{ secrets.QINIU_BUCKET }}

# The local directory (or file) you want to upload to bucket.
# Default: './'
source_dir: './'

# The directory inside of the bucket you want to upload to, namely key prefix prepended to dest file key.
# Default: '/'
dest_dir: '/apt'

# Whether to ignore source maps.
# Default: true
ignore_source_map: true
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
target
*.plb
*.piv
.VSCodeCounter
*.ll
*.out
*.ilk
*.exe
*.pdb

test.cpp
*.bc
.idea
*.o
*.plist
out.*
*.asm
*out
*.dSYM
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 The pivot-lang Authors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<div align="center"> <h1> Pivot Studio apt repository </h1>


```bash
sudo add-apt-repository "deb [arch=amd64] https://lang.pivotstudio.cn/apt/repo focal main"
sudo add-apt-repository "deb [arch=amd64] https://lang.pivotstudio.cn/apt/repo jammy main"
```
</div>
20 changes: 20 additions & 0 deletions deb/DEBIAN/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
GREEN='\033[0;32m'
NC='\033[0m'
RED='\033[0;31m'

if [ "$1" = configure ]; then
if [[ -z "${KAGARI_LIB_ROOT}" ]]; then
echo "export KAGARI_LIB_ROOT=/pl/planglib" >> ~/.bashrc
echo "export PL_ROOT=/pl" >> ~/.bashrc
fi
echo "${GREEN}"
echo "-------------------------------------------------------------------"
echo "Successfully installed pivot-lang compiler with JIT feature!"
echo "the pivot-lang compiler is now available as 'plc' command"
echo "${RED}**jit feature does not support debug**"
echo "you may need to restart your shell to load environment variables"
echo "to install aot feature, please install clang-14 manually"
echo "see https://apt.llvm.org/ for more details"
echo "-------------------------------------------------------------------"
echo "${NC}"
fi
93 changes: 93 additions & 0 deletions deb/apt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
apiVersion: v1
kind: Service
metadata:
labels:
app: apt-repo
name: apt-repo
namespace: lang
spec:
ports:
- name: "8110"
port: 8110
targetPort: 8110
selector:
app: apt-repo
status:
loadBalancer: {}

---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: apt-repo
name: apt-repo
namespace: lang
spec:
replicas: 1
selector:
matchLabels:
app: apt-repo
strategy:
type: RollingUpdate
template:
metadata:
labels:
app: apt-repo
spec:
priorityClassName: high-priority
containers:
- image: registry.cn-hangzhou.aliyuncs.com/pivotstudio/lang-apt:{{.build_tag}}
name: apt-repo
ports:
- containerPort: 8110
resources:
limits:
cpu: 100m
memory: 100Mi
requests:
cpu: 100m
memory: 50Mi
restartPolicy: Always
status: {}
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: apt-repo
namespace: lang
annotations:
kubernetes.io/ingress.class: "nginx"
# 开启use-regex,启用path的正则匹配
nginx.ingress.kubernetes.io/use-regex: "true"
kubernetes.io/tls-acme: "true"
cert-manager.io/cluster-issuer: "letsencrypt-prod"
# ratelimit
nginx.ingress.kubernetes.io/limit-connections: "60"
nginx.ingress.kubernetes.io/limit-rps: "60"
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
nginx.ingress.kubernetes.io/backend-protocol: HTTP
nginx.ingress.kubernetes.io/configuration-snippet: |
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_ssl_server_name on;
proxy_ssl_name $host;
spec:
rules:
- host: apt.lang.pivotstudio.cn
http:
paths:
# 不同path转发到不同端口
- path: /
pathType: Prefix
backend:
service:
name: apt-repo
port:
number: 8110
tls:
- secretName: pivot-tls-cert
hosts:
- apt.lang.pivotstudio.cn

Loading

0 comments on commit 8843676

Please sign in to comment.