liuyuqi-dellpc 1 year ago
parent
commit
edae51d903
4 changed files with 80 additions and 0 deletions
  1. 15 0
      nodejs/.coding-ci.yml
  2. 15 0
      nodejs/.ide/Dockerfile
  3. 37 0
      python/.coding-ci.yml
  4. 13 0
      python/.ide/Dockerfile

+ 15 - 0
nodejs/.coding-ci.yml

@@ -0,0 +1,15 @@
+$:
+  api_trigger_vscode:
+    clouddev:
+      runner:
+        cpus: 1
+      docker:
+        cpus: 1
+        build: .ide/Dockerfile
+        image: codingci/default-env:latest
+      services:
+        - vscode
+        - docker
+      stages:
+        - name: 开启云原生远程开发
+          type: vscode:go

+ 15 - 0
nodejs/.ide/Dockerfile

@@ -0,0 +1,15 @@
+FROM node:14
+
+# install vscode and extension
+RUN curl -fsSL https://code-server.dev/install.sh | sh &&\
+    code-server --install-extension redhat.vscode-yaml &&\
+    code-server --install-extension orta.vscode-jest &&\
+    code-server --install-extension dbaeumer.vscode-eslint &&\
+    code-server --install-extension eamodio.gitlens &&\
+    echo done
+
+RUN apt-get update && apt-get install -y wget unzip openssh-server
+
+# 指定字符集支持命令行输入中文(根据需要选择字符集)
+ENV LANG C.UTF-8
+ENV LANGUAGE C.UTF-8

+ 37 - 0
python/.coding-ci.yml

@@ -0,0 +1,37 @@
+$:
+  api_trigger_vscode:
+    clouddev:
+      runner:
+        cpus: 1
+      docker:
+        cpus: 1
+        build: .ide/Dockerfile
+        image: codingci/default-env:latest
+      services:
+        - vscode
+        - docker
+      stages:
+        - name: 开启云原生远程开发
+          type: vscode:go
+
+# 匹配所有分支
+(**):
+  # 创建分支时自动创建创建开发环境
+  branch.create:
+    - name: vscode
+      services:
+        # 声明使用 vscode
+        - vscode
+      docker:
+        # 自定义开发环境
+        build: .ide/Dockerfile
+      wework:
+        title: 云原生开发
+      stages:
+        # - name: 执行自定义脚本
+        #   script:
+        #     - npm install
+        #     - npm run start
+        - name: ready
+          type: vscode:go
+          

+ 13 - 0
python/.ide/Dockerfile

@@ -0,0 +1,13 @@
+FROM python:3.8
+
+# install vscode and extension
+RUN curl -fsSL https://code-server.dev/install.sh | sh &&\
+    code-server --install-extension ms-python.python &&\
+    code-server --install-extension eamodio.gitlens &&\
+    echo done
+
+RUN apt-get update && apt-get install -y wget unzip openssh-server
+
+# 指定字符集支持命令行输入中文(根据需要选择字符集)
+ENV LANG C.UTF-8
+ENV LANGUAGE C.UTF-8