前言

  在互联网项目中,项目测试、部署往往需要花费大量时间。传统方式是在本地打包、测试完毕程序,然后通过ftp上传至服务器,再把测试的配置文件修改为生产环境的配置文件,最后重新运行服务。这一过程如果交给人工完成往往容易出错,如项目有大量的配置,而仅有一处配置不正确将会发生重大的灾难,因此项目的持续集成和持续交付则尤为重要。之前,笔者的项目是通过git+maven+tomcat+jenkins来完成的,而如今阿里云推出了持续交付平台,笔者来为大家踩坑。

 

一、准备工作(spring boot+maven的项目)


 

package com.github.carter659.springskill01;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * 入口类 博客出处:http://www.cnblogs.com/GoodHelper/
 *
 */
@SpringBootApplication
@Controller
public class App {

    @Value("${name}")
    private String name;

    public static void main(String[] args) {
        SpringApplication.run(App.class, args);
    }

    @GetMapping("/")
    public String index(Model model) {
        model.addAttribute("name", name);
        return "index";
    }
}
App.java

相关文章:

  • 2021-04-30
  • 2022-02-13
  • 2021-09-18
  • 2022-02-09
  • 2022-12-23
  • 2021-12-25
猜你喜欢
  • 2021-06-26
  • 2021-09-06
  • 2021-07-06
  • 2022-01-05
  • 2021-10-31
  • 2021-12-06
  • 2021-12-05
相关资源
相似解决方案