云计算与devops

什么是云计算

  • 以虚拟化为基础,为用户提供计算、存储、网络等IT资源的设施
  • 提供产品化的服务,产品类型有(Iaas,Pass,Saas,caas…..)
  • 可弹性伸缩的

云计算分类:
- 公有云
- 私有云

Devops

  • devops研发周期
    • dev –》CI/BUILD—》deploy—-》Ops—》feedback—》 dev
package main

import (
        "io"
        "net/http"
)

func firstPage(w http.ResponseWriter, r *http.Request){
        io.WriteString(w,"<h1>Hello,this is my first page</h1>")
}

func main(){
        http.HandleFunc("/",firstPage)
        http.ListenAndServe(":8000",nil)

}

*编译程序*
zhongtian@zhongtian-Inspiron-7559:~/workdir/devops/newweb$ env GOOS=linux GOARCH=amd64 go build
zhongtian@zhongtian-Inspiron-7559:~/workdir/devops/newweb$ ls
main.go  newweb

package main ort (
“io”
“net/http”
“os/exec”
“log”
)

func reLaunch() {
cmd := exec.Command(“sh”, “./deploy.sh”)
err := cmd.Start()
if err != nil {
log.Fatal(err)
}
err = cmd.Wait()
}

func firstPage(w http.ResponseWriter, r *http.Request) {
    io.WriteString(w, "<h1>Hello, this is my deploy server!</h1>")
    reLaunch()
}

func main() {
    http.HandleFunc("/", firstPage)
    http.ListenAndServe(":5000", nil)
}
#! /bin/sh

kill -9 $(pgrep webserver)
cd ~/newweb/
git pull https://github.com/avenssi/newweb.git
cd webserver/
./webserver &

github地址github

  • 使用github的webhook触发部署服务
    这里写图片描述

  • 在阿里云配置站点监控

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值