Devops===》Jenkins部署Golang

Jenkins部署Golang

编译环境:

​ 1.安装go语言

​ 2.优化测试

部署环境:

​ 1.部署

第一步:编译环境(Jenkins)

1.安装golang语言
#1.下载golang
[root@jenkins opt]# wget https://golang.google.cn/dl/go1.16.3.linux-amd64.tar.gz

#2.安装
[root@jenkins opt]# tar -xf go1.16.3.linux-amd64.tar.gz -C /usr/local/

#3.添加环境变量
[root@jenkins opt]# vim /etc/profile
export GO_HOME=/usr/local/go
export GO_ROOT=/usr/local/go
export GO_PATH=/opt/go
export GOPROXY=https://mirrors.aliyun.com/goproxy/
PATH=$PATH:$GO_HOME:$GO_ROOT:$GO_PATH:$GO_HOME/bin
export PATH

[root@jenkins opt]# source /etc/profile
[root@jenkins opt]# printenv |grep GO
GO_PATH=/opt/go
GOPROXY=https://mirrors.aliyun.com/goproxy/
GO_HOME=/usr/local/go
GO_ROOT=/usr/local/go
2.测试
[root@jenkins opt]# mkdir /opt/go
[root@jenkins opt]# cd !$
cd /opt/go
[root@jenkins go]# go mod init jenkins-go  #创建一个go.mod文件
go: creating new go.mod: module jenkins-go
[</
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值