Compare commits

..

5 Commits

4
.gitignore vendored

@ -1,8 +1,7 @@
# ---> Java # ---> Java
#
# Compiled class file # Compiled class file
fsf
*.class *.class
#.fsl
# Log file # Log file
*.log *.log
@ -24,4 +23,3 @@ fsf
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid* hs_err_pid*
*.mac

@ -1,21 +1,15 @@
kind: pipeline kind: pipeline
type: docker type: docker
name: 开发流水线 name: 测试流水线
platform: platform:
os: linux os: linux
arch: amd64 arch: amd64
volumes:
- name: cache
host:
path: /var/lib/cache
steps: steps:
- name: maven - name: maven
image: maven:3-jdk-10 image: maven:3-jdk-10
volumes:
- name: cache
path: /root/.m2
commands: commands:
- mvn package -DskipTests=true - mvn install -DskipTests=true
# 本模板示例为上传软件包和部署脚本到home目录 # 本模板示例为上传软件包和部署脚本到home目录
# host、username、password可在参数管理中配置 # host、username、password可在参数管理中配置
- name: 上传文件 - name: 上传文件
@ -27,7 +21,7 @@ steps:
from_secret: deploy_name from_secret: deploy_name
password: password:
from_secret: deploy_pwd from_secret: deploy_pwd
port: 22 port: 3522
command_timeout: 2m command_timeout: 2m
target: /opt/demo target: /opt/demo
source: source:
@ -44,7 +38,7 @@ steps:
from_secret: deploy_name from_secret: deploy_name
password: password:
from_secret: deploy_pwd from_secret: deploy_pwd
port: 22 port: 3522
script: script:
- echo ====暂停容器开始11======= - echo ====暂停容器开始11=======
- docker rm -f mo-test - docker rm -f mo-test
@ -54,3 +48,8 @@ steps:
- docker build -t mo-test:1.0 . - docker build -t mo-test:1.0 .
- docker run -d -p 8080:8080 --name mo-test mo-test:1.0 - docker run -d -p 8080:8080 --name mo-test mo-test:1.0
- echo ====部署成功====== - echo ====部署成功======
trigger:
branch:
- develop
event:
- push

@ -1,6 +1,6 @@
#添加docker镜像 #添加docker镜像
FROM tomcat:8.5.83-jdk8-temurin-focal FROM tomcat
#添加作者信息 #添加作者信息
MAINTAINER moshenglv@163.com MAINTAINER moshenglv@163.com

@ -1,16 +1,15 @@
## 操作步骤11 ## 操作步骤
#### 1. 在线修改信息 src/main/java/controller/HelloWorld.java 文件信息内容,如下图: #### 1. 在线修改信息 src/main/java/controller/HelloWorld.java 文件信息内容,如下图:
![](https://forge.educoder.net/api/attachments/1663370?raw=true) ![](https://forge.educoder.net/api/attachments/1663370?raw=true)
#### 2. 修改成功后,会自动发构建、自动测试、自动部署 #### 2. 修改成功后,会自动发构建、自动测试、自动部署
![](https://forge.educoder.net/api/attachments/1663375?raw=true) ![](https://forge.educoder.net/api/attachments/1663375)
#### 3. 构建成功后,访问如下链接,即可查看效果 #### 3. 构建成功后,访问如下链接,即可查看效果
http://39.98.49.211:8080/demo/hello http://106.75.236.63:8080/demo/hello
![](https://forge.educoder.net/api/attachments/1663377)
![](https://forge.educoder.net/api/attachments/1663377?raw=true)

@ -1 +0,0 @@
// hello world java .

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" <project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId> <groupId>com.example</groupId>

@ -9,11 +9,12 @@ import java.io.IOException;
import java.io.PrintWriter; import java.io.PrintWriter;
public class HelloWorld extends HttpServlet { public class HelloWorld extends HttpServlet {
private String message; private String message;
@Override @Override
public void init() throws ServletException { public void init() throws ServletException {
message = "Hello JAVA20230919, this message is from servlet! 2023-09-13 09:10 <br /> <img width=\"1200px\" src=\"https://ali-cdn.educoder.net/images/avatars/HomeDiscipline/5?t=1614734991\">"; message = "Hello world, this message is from servlet! Good Luck. ";
} }
@Override @Override

@ -1,3 +0,0 @@
# 添加一些内容
## 二级标题
## 三级标题
Loading…
Cancel
Save