master into ansible
| @@ -11,22 +11,15 @@ volumes: | |||
| path: /var/lib/cache | |||
| steps: | |||
| - name: maven | |||
| image: maven:3-jdk-10 | |||
| image: maven:3-jdk-8 | |||
| volumes: | |||
| - name: cache | |||
| path: /root/.m2 | |||
| commands: | |||
| - mvn compile | |||
| - name: test | |||
| image: maven:3-jdk-10 | |||
| volumes: | |||
| - name: cache | |||
| path: /root/.m2 | |||
| commands: | |||
| - mvn test | |||
| - name: 远程主机部署 | |||
| image: appleboy/drone-ssh | |||
| image: appleboy/drone-ssh:linux-arm64 | |||
| settings: | |||
| host: | |||
| from_secret: ip | |||
| @@ -37,7 +30,7 @@ steps: | |||
| port: 22 | |||
| script: | |||
| - chmod +x /home/deploy.sh | |||
| - ./home/deploy.sh | |||
| - nohup bash /home/deploy.sh & | |||
| trigger: | |||
| branch: | |||
| - master | |||
| @@ -1,5 +1,5 @@ | |||
| public class { | |||
| public static void main(String[] args) { | |||
| System.out.println | |||
| System.out.println(); | |||
| } | |||
| } | |||
| @@ -2,7 +2,7 @@ ImageMagick License | |||
| The legally binding and authoritative terms and conditions for use, reproduction, and distribution of ImageMagick follow: | |||
| Copyright 1999-2009 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. | |||
| Copyright 1999-2009 WW, a non-profit organization dedicated to making software imaging solutions freely available. | |||
| 1. Definitions. License shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. Licensor shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. Legal Entity shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, control means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. You (or Your) shall mean an individual or Legal Entity exercising permissions granted by this License. Source form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. Object form shall mean any form resulting from mechanical transformation or translation of a Source form, including limited to compiled object code, generated documentation, conversions to other media types. Work shall mean the work of authorship, whether in Source Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). Derivative Works shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. Contribution shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, submitted means any form of electronic, verbal, or written communication intentionally sent to the Licensor by its copyright holder or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as Not a Contribution. Contributor shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. | |||
| @@ -0,0 +1,23 @@ | |||
| ##########wukongclite | |||
| Hard id are no longer required. | |||
| ##########wukongmac | |||
| 02:42:ac:11:00:03 | |||
| ##########wukongc | |||
| Hard id are no longer required. | |||
| ##########wukonglite | |||
| Ft6btsp+r21M77RiV7CovJCBvVcYiXgaA3thP9HdgLGZWdt1SNGWPdMcNaAjt7mYOtSdN8P46dOiWKoi9/64NmL+Rl2zeq+ZDgpsN3LOpdhsfrXvUW0ZPW0xr1kTIpQbRVkU73knAG5pcjjClZqqdRiZnia4dg9SNb+4rsx72z8= | |||
| enhlWWhJcaABzAcczsxnosB+Moj6Vw0ZuPWvXbh5igEnKtBDb1WVKjI21U+IUdzXcxvlJJwNJy9Sbq4rch/Bt3JmShPq6hOVSDxLYD4E3fpCEVKGQ+FBOc8P4JXNJzKS1pTtCL3E0Ylc6hOI2yNy5WNzve0++JbtVXO7U2Ogxz4= | |||
| xDxmfNyQx7NRmWwAMYpXre1tY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eji1CAXWuUN8xM+nKiLhhOMbrzP5ykgAui0ocKfV1OyTsE9YzvVS+9Y0rU6sQt3yb3QQxVRcBf0+fV2BJaKnZjUTZI4DIksMiykdYk4sWUGNwihpIrsJGPoU7EdYDwNEWUquHj3EJkH6vlmSeSytNX1A= | |||
| WyLr/WW0XXboVN4Lu2dafcU0VCLyYWoyxiytKCo5EK/Z2WlGO6SHHtzRwmxnLSPkaT8t0MfhFQsEHpebms68G+OXThZUSjmJctxkBJxHCvYQTzu4/OtuERNB3IZTSrzWliQiM8LTQesEoETJMiQGhCMqSpDpBcGn2gmZCxpLRp8= | |||
| @@ -0,0 +1 @@ | |||
| niasda | |||
| @@ -172,7 +172,7 @@ | |||
| <artifactId>maven-surefire-plugin</artifactId> | |||
| <version>2.18.1</version> | |||
| <configuration> | |||
| <skipTests>true</skipTests> | |||
| <skipTests>false</skipTests> | |||
| </configuration> | |||
| </plugin> | |||
| @@ -0,0 +1,36 @@ | |||
| package com.educoder.bridge.service; | |||
| /** | |||
| * @Author: youys | |||
| * @Date: 2023/2/27 | |||
| * @Description: | |||
| */ | |||
| public class CalculatorService { | |||
| public int add(int a, int b) { | |||
| return a + b; | |||
| } | |||
| public int subtract(int a, int b) { | |||
| return a - b; | |||
| } | |||
| public int multiply(int a, int b) { | |||
| return a * b; | |||
| } | |||
| public double divide(double a, double b) { | |||
| if (b == 0) { | |||
| throw new IllegalArgumentException("Cannot divide by zero!"); | |||
| } | |||
| return a / b; | |||
| } | |||
| public double sqrt(double a) { | |||
| if (a < 0) { | |||
| throw new IllegalArgumentException("Cannot calculate square root of negative number!"); | |||
| } | |||
| return Math.sqrt(a); | |||
| } | |||
| } | |||
| @@ -0,0 +1,65 @@ | |||
| package com.educoder.bridge; | |||
| import com.educoder.bridge.service.CalculatorService; | |||
| import org.junit.Test; | |||
| import static org.junit.Assert.assertEquals; | |||
| import static org.junit.Assert.fail; | |||
| /** | |||
| * @Author: youys | |||
| * @Date: 2023/2/27 | |||
| * @Description: | |||
| */ | |||
| public class CalculatorServiceTest { | |||
| @Test | |||
| public void testAdd() { | |||
| CalculatorService calculator = new CalculatorService(); | |||
| int result = calculator.add(1, 2); | |||
| assertEquals(3, result); | |||
| } | |||
| @Test | |||
| public void testSubtract() { | |||
| CalculatorService calculator = new CalculatorService(); | |||
| int result = calculator.subtract(5, 2); | |||
| assertEquals(3, result); | |||
| } | |||
| @Test | |||
| public void testMultiply() { | |||
| CalculatorService calculator = new CalculatorService(); | |||
| int result = calculator.multiply(3, 4); | |||
| assertEquals(12, result); | |||
| } | |||
| @Test | |||
| public void testDivide() { | |||
| CalculatorService calculator = new CalculatorService(); | |||
| double result = calculator.divide(10, 2); | |||
| assertEquals(5.0, result, 0); | |||
| try { | |||
| calculator.divide(10, 0); | |||
| fail("Expected an IllegalArgumentException to be thrown"); | |||
| } catch (IllegalArgumentException e) { | |||
| assertEquals("Cannot divide by zero!", e.getMessage()); | |||
| } | |||
| } | |||
| @Test | |||
| public void testSqrt() { | |||
| CalculatorService calculator = new CalculatorService(); | |||
| double result = calculator.sqrt(16); | |||
| assertEquals(4.0, result, 0); | |||
| try { | |||
| calculator.sqrt(-1); | |||
| fail("Expected an IllegalArgumentException to be thrown"); | |||
| } catch (IllegalArgumentException e) { | |||
| assertEquals("Cannot calculate square root of negative number!", e.getMessage()); | |||
| } | |||
| } | |||
| } | |||
| @@ -0,0 +1,26 @@ | |||
| package com.educoder.bridge; | |||
| import org.junit.Test; | |||
| /** | |||
| * @Author: youys | |||
| * @Date: 2023/2/27 | |||
| * @Description: | |||
| */ | |||
| public class MainTest { | |||
| @Test | |||
| public void test(){ | |||
| int a = 1; | |||
| int b = 1; | |||
| assert b > 0 : String.format("%s/%s, 除数不能为0",a, b); | |||
| } | |||
| @Test | |||
| public void test2(){ | |||
| int i=11; | |||
| assert i > 10 : String.format("变量i=%s,需要大于10", i); | |||
| } | |||
| } | |||
| @@ -0,0 +1,190 @@ | |||
| 1、命令行评测实训 | |||
| 链接: https://test.educoder.net/tasks/augzqmrx5nw9 | |||
| 启动命令行接口:https://test-data.educoder.net/api/myshixuns/4yzwfose6q/start.json?game_id=2215157 | |||
| 返回参数 | |||
| { | |||
| "status": 0, | |||
| "message": "success", | |||
| "data": { | |||
| "host": "172.16.95.1", | |||
| "port": "41279", | |||
| "link_url": "wss://pre-webssh.educoder.net/ws", # 这个是之前的ws_url | |||
| "username": "root", | |||
| "password": "XhKb4HwQ2FrnqjiS", | |||
| "myshixun_id": 584178, | |||
| "webssh_url": "http://172.16.94.254:8890/bridge", | |||
| "remainingTime": 1800000, | |||
| "mapping_service_url": "https://41280testsvc1.vnc.educoder.net" | |||
| } | |||
| } | |||
| 激活接口:https://test-data.educoder.net/api/myshixuns/4yzwfose6q/active_pod.json?game_id=2215157 | |||
| 返回参数: | |||
| { | |||
| "status": 0, | |||
| "message": "success", | |||
| "data": { | |||
| "remaining_time": 1800000 | |||
| } | |||
| } | |||
| 重置命令行接口:https://test-data.educoder.net/api/myshixuns/4yzwfose6q/reset_pod.json?game_id=2215157 | |||
| 返回接口: | |||
| { | |||
| "status": 0, | |||
| "message": "success", | |||
| "data": { | |||
| "host": "172.16.95.1", | |||
| "port": "41279", | |||
| "link_url": "wss://pre-webssh.educoder.net/ws", | |||
| "username": "root", | |||
| "password": "XhKb4HwQ2FrnqjiS", | |||
| "myshixun_id": 584178, | |||
| "webssh_url": "http://172.16.94.254:8890/bridge", | |||
| "remainingTime": 1800000, | |||
| "mapping_service_url": "https://41280testsvc1.vnc.educoder.net" | |||
| } | |||
| } | |||
| 2、命令行练习模式 | |||
| 链接:https://test.educoder.net/tasks/xjf8k5cvglpe | |||
| 命令行练习模式链接接口:https://test-data.educoder.net/api/myshixuns/ulzyaw86j7/start.json?game_id=2215160 | |||
| 返回参数: | |||
| { | |||
| "status": 0, | |||
| "message": "success", | |||
| "data": { | |||
| "host": "172.16.95.1", | |||
| "port": "41281", | |||
| "link_url": "wss://pre-webssh.educoder.net/ws", | |||
| "username": "root", | |||
| "password": "UoeOXal40rkNrOSM", | |||
| "myshixun_id": 584179, | |||
| "webssh_url": "http://172.16.94.254:8890/bridge", | |||
| "remainingTime": 1800000, | |||
| "mapping_service_url": null | |||
| } | |||
| } | |||
| 重置命令行接口: https://test-data.educoder.net/api/myshixuns/ulzyaw86j7/reset_pod.json?game_id=2215160 | |||
| 返回参数: | |||
| { | |||
| "status": 0, | |||
| "message": "success", | |||
| "data": { | |||
| "host": "172.16.95.1", | |||
| "port": "41284", | |||
| "link_url": "wss://pre-webssh.educoder.net/ws", | |||
| "username": "root", | |||
| "password": "4tsMtsXr5hxnrAMg", | |||
| "myshixun_id": 584179, | |||
| "webssh_url": "http://172.16.94.254:8890/bridge", | |||
| "remainingTime": 1800000, | |||
| "mapping_service_url": null | |||
| } | |||
| } | |||
| 激活命令行接口:https://test-data.educoder.net/api/myshixuns/ulzyaw86j7/active_pod.json?game_id=2215157 | |||
| 3、 图形化模式 | |||
| 链接: https://test.educoder.net/tasks/qjo69pf4yen2 | |||
| 图形化链接的接口:https://test-data.educoder.net/api/myshixuns/68we3nqvlo/start.json | |||
| 返回参数: | |||
| { | |||
| "status": 0, | |||
| "message": "success", | |||
| "data": { | |||
| "link_url": "https://41285testsvc1.vnc.educoder.net/vnc_lite.html?password=krFgfmEUo1eoJXSp", | |||
| "remaining_time": 1800000, | |||
| "mapping_service_url": null | |||
| } | |||
| } | |||
| 图形化激活:https://test-data.educoder.net/api/myshixuns/68we3nqvlo/active_pod.json | |||
| 返回参数: | |||
| { | |||
| "status": 0, | |||
| "message": "success", | |||
| "data": { | |||
| "remaining_time": 1800000 | |||
| } | |||
| } | |||
| 图形化重置:https://test-data.educoder.net/api/myshixuns/68we3nqvlo/reset_pod.json | |||
| 返回参数 | |||
| { | |||
| "status": 0, | |||
| "message": "success", | |||
| "data": { | |||
| "link_url": "https://41286testsvc1.vnc.educoder.net/vnc_lite.html?password=ubUfnZXfTaP2v8FS", | |||
| "remaining_time": 1800000, | |||
| "mapping_service_url": null | |||
| } | |||
| } | |||
| 4、 jupyter类型 | |||
| 链接:https://test.educoder.net/tasks/kgilr324mf/jupyter | |||
| 获取链接地址:https://test-data.educoder.net/api/myshixuns/kgilr324mf/start.json | |||
| 返回参数: | |||
| { | |||
| "status": 0, | |||
| "message": "success", | |||
| "data": [{ | |||
| "name": "", | |||
| "link_url": "https://41293testsvc1.vnc.educoder.net/notebooks/data/workspace/myshixun_584124/kgilr324mf20221213161642/01.ipynb?token=YkKtEKzePMHKe8tJ", | |||
| "remaining_time": 3600000 | |||
| }] | |||
| } | |||
| 激活时间:https://test-data.educoder.net/api/myshixuns/kgilr324mf/active_pod.json | |||
| 重置环境:https://test-data.educoder.net/api/myshixuns/kgilr324mf/reset_pod.json | |||
| 5. Vscode模式 | |||
| 链接:https://test.educoder.net/tasks/xzty6mscw4ak | |||
| 获取链接接口:https://test-data.educoder.net/api/myshixuns/3cr9h8szfe/start.json | |||
| 激活时间接口:https://test-data.educoder.net/api/myshixuns/3cr9h8szfe/active_pod.json | |||
| 重置环境接口:https://test-data.educoder.net/api/myshixuns/3cr9h8szfe/reset_pod.json | |||
| 6. jupytelab模式 | |||
| 链接:https://test.educoder.net/tasks/w3ku7g6hlt/jupyter | |||
| 获取链接接口:https://test-data.educoder.net/api/myshixuns/w3ku7g6hlt/start.json | |||
| 激活时间:https://test-data.educoder.net/api/myshixuns/w3ku7g6hlt/active_pod.json | |||
| 重置接口:https://test-data.educoder.net/api/myshixuns/w3ku7g6hlt/reset_pod.json | |||
| 7. 容器启动web类型 | |||
| 链接:https://test.educoder.net/tasks/iumv78glocw3 | |||
| 获取链接地址:https://test-data.educoder.net/api/myshixuns/gp24f3a5mr/start.json?game_id=2215349 | |||
| 激活时间:https://test-data.educoder.net/api/myshixuns/gp24f3a5mr/active_pod.json?game_id=2215349 | |||
| 重置接口:https://test-data.educoder.net/api/myshixuns/gp24f3a5mr/reset_pod.json?game_id=2215349 | |||
| 8. 阿里云命令行 | |||
| 链接:https://test.educoder.net/tasks/6vts7iqz5bok | |||
| 获取链接地址:https://test-data.educoder.net/api/myshixuns/metj9p8uvg/start.json?position=1(position表示第几个命令行) | |||
| 激活时间:https://test-data.educoder.net/api/myshixuns/metj9p8uvg/active_pod.json?position=1 | |||
| 重置环境:https://test-data.educoder.net/api/myshixuns/metj9p8uvg/reset_pod.json?position=1 | |||
| 9.算能云(目前测试版还不能测) | |||
| 链接:https://test.educoder.net/tasks/nilpzk5f34ya | |||
| 获取链接地址:https://test-data.educoder.net/api/myshixuns/9uakizlso8/start.json | |||
| 激活时间:https://test-data.educoder.net/api/myshixuns/9uakizlso8/active_pod.json | |||
| 重置环境:https://test-data.educoder.net/api/myshixuns/9uakizlso8/reset_pod.json | |||
| 10. 交大云 | |||
| 链接:https://test.educoder.net/tasks/eyugo7923hxf | |||
| 获取链接地址:https://test-data.educoder.net/api/myshixuns/ijpzyrtfqv/start.json?position=1 (position命令行的位置) | |||
| 激活时间:https://test-data.educoder.net/api/myshixuns/ijpzyrtfqv/active_pod.json?position=1 | |||
| 重置环境: https://test-data.educoder.net/api/myshixuns/ijpzyrtfqv/reset_pod.json?position=1 | |||
| 11. windows云主机 | |||
| 链接:https://test.educoder.net/tasks/erws5kijf9cf | |||
| 获取链接地址:https://test-data.educoder.net/api/myshixuns/gqszl4u3ef/start.json | |||
| 激活时间:https://test-data.educoder.net/api/myshixuns/gqszl4u3ef/active_pod.json | |||
| 重置环境:https://test-data.educoder.net/api/myshixuns/gqszl4u3ef/reset_pod.json | |||
| 12.虚拟机 | |||
| 链接:https://test.educoder.net/tasks/ir8p4ockhygt | |||
| 获取链接地址:https://test-data.educoder.net/api/myshixuns/zo85g3lv2y/start.json | |||
| 激活时间:https://test-data.educoder.net/api/myshixuns/zo85g3lv2y/active_pod.json | |||
| 重置环境:https://test-data.educoder.net/api/myshixuns/zo85g3lv2y/reset_pod.json | |||
| 13. 阿里云Linux图形化 | |||
| 链接:https://test.educoder.net/tasks/bhiv3eyfug56 | |||
| 获取链接地址:https://test-data.educoder.net/api/myshixuns/zf6hb4pwnj/start.json | |||
| 激活时间:https://test-data.educoder.net/api/myshixuns/zf6hb4pwnj/active_pod.json | |||
| 重置环境:https://test-data.educoder.net/api/myshixuns/zf6hb4pwnj/reset_pod.json | |||