CentOS 6.5 x86_64 系统定制自动化部署

一、制作环境准备

实验环境:

VMware Workstation

CentOS-6.5-x86_64-minimal 最小化安装

安装后,我们会使用系统 /root 目录下 install.log 和 anaconda-ks.cfg 这两个文件(在此基础上修改比较方便)

1.1 定制步骤

1、安装最小化的操作系统.包括基本的系统和所需要的工具等.

比如:对于http,mysql等软件,建议使用编译的方式安装, 然后打包放进去,可以减少许多依赖包的麻烦.

2、安装系统后,收集系统已安装的软件包,使用脚本统一转存到一个目录中.

3、在安装光盘复制images镜像,从光盘启动centos安装所需的文件等.

4、定义自己的kickstart安装脚本.

5、按照之前转存的软件(rpm)包, 重新生成光盘的report信息.

6、打包生成ISO文件,及MD5效验码.

1.2 安装所需工具包

[[email protected] ~]#  yum -y install anaconda repodata createrepo mkisofs rsync


1.3 下载CentOS 6.5镜像

为了方便制作,我们可以在VMware、vbox、xen等虚拟环境中进行安装,这里我们选用了VMware作为制作环境。我们可以在官网或者其他比较近的镜像站点下载CentOS 镜像文件。CentOS-6.4-x86_64-minimal.iso

二、定制系统

2.1 光盘目录结构

*isolinux 目录存放光盘启动时的安装界面信息

*images 目录包括了必要的启动映像文件

*Packages 目录存放安装软件包及信息

*.discinfo 文件是安装价质的识别信息

MediaCentOS 目录存放媒体中心安装包

Repodata 目录存放rpm包依赖信息

5.x 系列, boot.iso 存在于 images/ 这个目录。

6.x 系列, 存放于 /isolinux 目录下

6.x 网络安装需要在官网下载:netinstall.iso 镜像文件。

2.2 挂载并拷贝文件

目录规划:

  • 挂载目录为: /mnt
  • 定制光盘文件目录: /root/iso
[[email protected] ~]# pwd
/root
[[email protected] ~]# mkdir iso                            # 建立iso文件制作目录
[[email protected] ~]# mkdir -p  ./iso/{Packages,repodata}  # 建立软件包目录和repodata目录  
[[email protected] ~]# mount /dev/cdrom /mnt                # 挂载 DVD
mount: block device /dev/sr0 is write-protected, mounting read-only

# 拷贝 源DVD镜像中,除了Packages,repodata 目录外的所有文件到 iso 目录
[[email protected] ~]# /usr/bin/rsync -a --exclude=Packages --exclude=repodata  /mnt/  ./iso/
[[email protected] ~]# ls iso
CentOS_BuildTag  GPL       Packages                  RPM-GPG-KEY-CentOS-6           RPM-GPG-KEY-CentOS-Testing-6
EFI              images    RELEASE-NOTES-en-US.html  RPM-GPG-KEY-CentOS-Debug-6     TRANS.TBL
EULA             isolinux  repodata                  RPM-GPG-KEY-CentOS-Security-6

# 参考当前系统的安装包,拷贝
[[email protected] ~]# awk ‘/Installing/ {print $2}‘ install.log | xargs -i cp /mnt/Packages/{}.rpm  ./iso/Packages/
[[email protected] ~]# ls iso/Packages/ | wc -l
205

# 执行createrepo程序生成repodata下的comps.xml文件(重要)
#comps.xml 文件中包含了安装时用户所见到的与rpm相关的所有内容,它会检查Packages下
# 的RPM包的依赖关系,安装时如果缺少依赖包,它会提示您哪个RPM 包需要哪些依赖库。

[[email protected] ~]# pwd
/root
# 编辑 shell 脚本, 并执行
#!/bin/bash

ISO_DIR=/root/iso
cd  ${ISO_DIR}
declare -x discinfo=$(head -1 .discinfo)

cp  /mnt/repodata/*-minimal-x86_64.xml ${ISO_DIR}/repodata/minimal-x86_64.xml

createrepo   -g   ${ISO_DIR}/repodata/minimal-x86_64.xml  ${ISO_DIR}

createrepo -u "media://$discinfo" -g ${ISO_DIR}/repodata/*-minimal-x86_64.xml ${ISO_DIR}

### 
到这里,comps.xml文件和其他相关联的文件已被重新生成到repodata目录下。
Tips2:如果你新增或删除了Packages目录的RPM包,请重新生成comps.xml文件。

三、制作 ks.cfg 脚本

ks文件由系统安装所创建的 anaconda-ks.cfg进行修改,当然也可以用system-config-kickstart工具制作而得。这里大家需要根据实际情况进行修改:

  • 默认root用户密码: 123456
  • 静态获取地址
  • 硬盘至少15G
[[email protected] ~]# pwd
/root
[[email protected] ~]# cp anaconda-ks.cfg  ./iso/isolinux/ks.cfg
[[email protected] ~]# vim ./iso/isolinux/ks.cfg
## 请根据实际情况进行调整

# Kickstart file automatically generated byanaconda.
 
#version=DEVEL
install
cdrom
lang en_US.UTF-8
keyboard us
network --onboot yes --device eth0 --bootproto static --noipv6 --ip=192.168.3.132 --netmask=255.255.255.0 --gateway=192.168.3.254
rootpw --iscrypted$6$060kt9rryFXbrlgx$WWWNQYLnpz0Es8dTlouy3LXqjTdHIRToojidbpYoZrd2ETOJ.JsNbgnMylQVbFRThPZwSdRKJcrAml7LQDdR00
firewall --service=ssh
authconfig --enableshadow --passalgo=sha512
selinux --disabled
timezone --utc Asia/Chongqing
 
text
firstboot --disable
logging --level=info
reboot
 
 
bootloader --location=mbr --driveorder=sda --append="crashkernel=auto rhgb quiet"
zerombr
 
# The following is the partitioninformation you requested
# Note that any partitions you deleted arenot expressed
# here so unless you clear all partitionsfirst, this is
# not guaranteed to work
#clearpart --none
 
#part /boot --fstype=ext4 --size=200
#part swap --size=2048
#part / --fstype=ext4 --grow --size=200
 
clearpart --all --initlabel
part /boot --fstype=ext4 --size=200
part swap --size=2048
part / --fstype=ext4 --size=10240
part /data --fstype=ext4 --size=1 --grow
 
# repo --name="CentOS"  --baseurl=cdrom:sr0 --cost=100
 
%packages --nobase
@core
%end

四、修改 isolinux.cfg 配置文件,指定 ks 路径

注意,编辑这个文件,需要强制保存。 :wq!

[[email protected] ~]# vi ./iso/isolinux/isolinux.cfg

default vesamenu.c32
#prompt 1
timeout 600

display boot.msg

menu background splash.jpg
menu title Welcome to CentOS 6.5!
menu color border 0 #ffffffff #00000000
menu color sel 7 #ffffffff #ff000000
menu color title 0 #ffffffff #00000000
menu color tabmsg 0 #ffffffff #00000000
menu color unsel 0 #ffffffff #00000000
menu color hotsel 0 #ff000000 #ffffffff
menu color hotkey 7 #ffffffff #ff000000
menu color scrollbar 0 #ffffffff #00000000

label linux
  menu label ^Install or upgrade an existing system
  menu default
  kernel vmlinuz
  append initrd=initrd.img ks=cdrom:/isolinux/ks.cfg    # 仅修改这里即可
label vesa
  menu label Install system with ^basic video driver
  kernel vmlinuz
  append initrd=initrd.img xdriver=vesa nomodeset
label rescue
  menu label ^Rescue installed system
  kernel vmlinuz
  append initrd=initrd.img rescue
label local
  menu label Boot from ^local drive
  localboot 0xffff
label memtest86
  menu label ^Memory test
  kernel memtest
  append -

五、生成iso镜像,并生成 MD5校验码

## 注意所在的目录
[[email protected] ~]# pwd
/root
[[email protected] ~]# cd iso
[[email protected] iso]# pwd
/root/iso
[[email protected] iso]# mkisofs -o CentOS-6.4_64.iso -input-charset utf-8 -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -R -J -v -T -joliet-long  /root/iso

genisoimage 1.1.9 (Linux)
Scanning /root/iso
Excluded: /root/iso/TRANS.TBL
Scanning /root/iso/repodata
Scanning /root/iso/isolinux
Excluded: /root/iso/isolinux/TRANS.TBL
Excluded by match: /root/iso/isolinux/boot.cat
Scanning /root/iso/EFI
Excluded: /root/iso/EFI/TRANS.TBL
Scanning /root/iso/EFI/BOOT
Excluded: /root/iso/EFI/BOOT/TRANS.TBL
Scanning /root/iso/images
Excluded: /root/iso/images/TRANS.TBL
Scanning /root/iso/images/pxeboot
Excluded: /root/iso/images/pxeboot/TRANS.TBL
Scanning /root/iso/Packages
Using RPM_G000.;1 for  /RPM-GPG-KEY-CentOS-Debug-6 (RPM-GPG-KEY-CentOS-Security-6)
Using RPM_G001.;1 for  /RPM-GPG-KEY-CentOS-Security-6 (RPM-GPG-KEY-CentOS-6)
Using RPM_G002.;1 for  /RPM-GPG-KEY-CentOS-6 (RPM-GPG-KEY-CentOS-Testing-6)
Using CE2D6000.GZ;1 for  /root/iso/repodata/ce2d698b9fb1413b668443e88835a0642cea8f387c7f25cc946f56dd93f109bb-34bae2d3c9c78e04ed2429923bc095005af1b166d1a354422c4c04274bae0f59-minimal-x86_64.xml.gz (ce2d698b9fb1413b668443e88835a0642cea8f387c7f25cc946f56dd93f109bb-minimal-x86_64.xml.gz)
Using NSS_S000.RPM;1 for  /root/iso/Packages/nss-softokn-freebl-3.14.3-9.el6.x86_64.rpm (nss-softokn-3.14.3-9.el6.x86_64.rpm)
Using OPENS000.RPM;1 for  /root/iso/Packages/openssh-5.3p1-94.el6.x86_64.rpm (openssh-clients-5.3p1-94.el6.x86_64.rpm)
Using DEVIC000.RPM;1 for  /root/iso/Packages/device-mapper-persistent-data-0.2.8-2.el6.x86_64.rpm (device-mapper-event-libs-1.02.79-8.el6.x86_64.rpm)
Using FIPSC000.RPM;1 for  /root/iso/Packages/fipscheck-1.2.0-7.el6.x86_64.rpm (fipscheck-lib-1.2.0-7.el6.x86_64.rpm)
Using DEVIC001.RPM;1 for  /root/iso/Packages/device-mapper-event-libs-1.02.79-8.el6.x86_64.rpm (device-mapper-multipath-libs-0.4.9-72.el6.x86_64.rpm)
Using CRYPT000.RPM;1 for  /root/iso/Packages/cryptsetup-luks-1.2.0-7.el6.x86_64.rpm (cryptsetup-luks-libs-1.2.0-7.el6.x86_64.rpm)
Using DEVIC002.RPM;1 for  /root/iso/Packages/device-mapper-multipath-libs-0.4.9-72.el6.x86_64.rpm (device-mapper-libs-1.02.79-8.el6.x86_64.rpm)
Using IPTAB000.RPM;1 for  /root/iso/Packages/iptables-1.4.7-11.el6.x86_64.rpm (iptables-ipv6-1.4.7-11.el6.x86_64.rpm)
Using LIBSE000.RPM;1 for  /root/iso/Packages/libselinux-utils-2.0.94-5.3.el6_4.1.x86_64.rpm (libselinux-2.0.94-5.3.el6_4.1.x86_64.rpm)
Using NCURS000.RPM;1 for  /root/iso/Packages/ncurses-libs-5.7-3.20090208.el6.x86_64.rpm (ncurses-5.7-3.20090208.el6.x86_64.rpm)
Using DEVIC003.RPM;1 for  /root/iso/Packages/device-mapper-libs-1.02.79-8.el6.x86_64.rpm (device-mapper-event-1.02.79-8.el6.x86_64.rpm)
Using DEVIC004.RPM;1 for  /root/iso/Packages/device-mapper-event-1.02.79-8.el6.x86_64.rpm (device-mapper-multipath-0.4.9-72.el6.x86_64.rpm)
Using NCURS001.RPM;1 for  /root/iso/Packages/ncurses-5.7-3.20090208.el6.x86_64.rpm (ncurses-base-5.7-3.20090208.el6.x86_64.rpm)
Using SELIN000.RPM;1 for  /root/iso/Packages/selinux-policy-3.7.19-231.el6.noarch.rpm (selinux-policy-targeted-3.7.19-231.el6.noarch.rpm)
Using E2FSP000.RPM;1 for  /root/iso/Packages/e2fsprogs-libs-1.41.12-18.el6.x86_64.rpm (e2fsprogs-1.41.12-18.el6.x86_64.rpm)
Using COREU000.RPM;1 for  /root/iso/Packages/coreutils-8.4-31.el6.x86_64.rpm (coreutils-libs-8.4-31.el6.x86_64.rpm)
Using CYRUS000.RPM;1 for  /root/iso/Packages/cyrus-sasl-2.1.23-13.el6_3.1.x86_64.rpm (cyrus-sasl-lib-2.1.23-13.el6_3.1.x86_64.rpm)
Using P11_K000.RPM;1 for  /root/iso/Packages/p11-kit-trust-0.18.5-2.el6.x86_64.rpm (p11-kit-0.18.5-2.el6.x86_64.rpm)
Using OPENS001.RPM;1 for  /root/iso/Packages/openssh-clients-5.3p1-94.el6.x86_64.rpm (openssh-server-5.3p1-94.el6.x86_64.rpm)
Using PLYMO000.RPM;1 for  /root/iso/Packages/plymouth-core-libs-0.8.3-27.el6.centos.x86_64.rpm (plymouth-0.8.3-27.el6.centos.x86_64.rpm)
Using CRACK000.RPM;1 for  /root/iso/Packages/cracklib-dicts-2.8.16-4.el6.x86_64.rpm (cracklib-2.8.16-4.el6.x86_64.rpm)
Using DEVIC005.RPM;1 for  /root/iso/Packages/device-mapper-multipath-0.4.9-72.el6.x86_64.rpm (device-mapper-1.02.79-8.el6.x86_64.rpm)
Using PLYMO001.RPM;1 for  /root/iso/Packages/plymouth-0.8.3-27.el6.centos.x86_64.rpm (plymouth-scripts-0.8.3-27.el6.centos.x86_64.rpm)
Writing:   Initial Padblock                        Start Block 0
Done with: Initial Padblock                        Block(s)    16
Writing:   Primary Volume Descriptor               Start Block 16
Done with: Primary Volume Descriptor               Block(s)    1
Writing:   Eltorito Volume Descriptor              Start Block 17
Size of boot image is 4 sectors -> No emulation
Done with: Eltorito Volume Descriptor              Block(s)    1
Writing:   Joliet Volume Descriptor                Start Block 18
Done with: Joliet Volume Descriptor                Block(s)    1
Writing:   End Volume Descriptor                   Start Block 19
Done with: End Volume Descriptor                   Block(s)    1
Writing:   Version block                           Start Block 20
Done with: Version block                           Block(s)    1
Writing:   Path table                              Start Block 21
Done with: Path table                              Block(s)    4
Writing:   Joliet path table                       Start Block 25
Done with: Joliet path table                       Block(s)    4
Writing:   Directory tree                          Start Block 29
Done with: Directory tree                          Block(s)    27
Writing:   Joliet directory tree                   Start Block 56
Done with: Joliet directory tree                   Block(s)    18
Writing:   Directory tree cleanup                  Start Block 74
Done with: Directory tree cleanup                  Block(s)    0
Writing:   Extension record                        Start Block 74
Done with: Extension record                        Block(s)    1
Writing:   The File(s)                             Start Block 75
  2.48% done, estimate finish Sat Apr  4 23:51:32 2015
  4.95% done, estimate finish Sat Apr  4 23:51:12 2015
  7.43% done, estimate finish Sat Apr  4 23:51:05 2015
  9.90% done, estimate finish Sat Apr  4 23:51:02 2015
 12.37% done, estimate finish Sat Apr  4 23:51:08 2015
 14.85% done, estimate finish Sat Apr  4 23:51:05 2015
 17.32% done, estimate finish Sat Apr  4 23:51:03 2015
 19.80% done, estimate finish Sat Apr  4 23:51:07 2015
 22.28% done, estimate finish Sat Apr  4 23:51:09 2015
 24.75% done, estimate finish Sat Apr  4 23:51:08 2015
 27.22% done, estimate finish Sat Apr  4 23:51:06 2015
 29.69% done, estimate finish Sat Apr  4 23:51:05 2015
 32.17% done, estimate finish Sat Apr  4 23:51:07 2015
 34.64% done, estimate finish Sat Apr  4 23:51:06 2015
 37.12% done, estimate finish Sat Apr  4 23:51:08 2015
 39.59% done, estimate finish Sat Apr  4 23:51:07 2015
 42.07% done, estimate finish Sat Apr  4 23:51:08 2015
 44.54% done, estimate finish Sat Apr  4 23:51:07 2015
 47.02% done, estimate finish Sat Apr  4 23:51:06 2015
 49.49% done, estimate finish Sat Apr  4 23:51:08 2015
 51.97% done, estimate finish Sat Apr  4 23:51:09 2015
 54.44% done, estimate finish Sat Apr  4 23:51:08 2015
 56.91% done, estimate finish Sat Apr  4 23:51:09 2015
 59.39% done, estimate finish Sat Apr  4 23:51:08 2015
 61.86% done, estimate finish Sat Apr  4 23:51:09 2015
 64.34% done, estimate finish Sat Apr  4 23:51:09 2015
 66.81% done, estimate finish Sat Apr  4 23:51:08 2015
 69.29% done, estimate finish Sat Apr  4 23:51:07 2015
 71.76% done, estimate finish Sat Apr  4 23:51:07 2015
 74.24% done, estimate finish Sat Apr  4 23:51:06 2015
 76.71% done, estimate finish Sat Apr  4 23:51:06 2015
 79.18% done, estimate finish Sat Apr  4 23:51:05 2015
 81.66% done, estimate finish Sat Apr  4 23:51:05 2015
 84.14% done, estimate finish Sat Apr  4 23:51:05 2015
 86.61% done, estimate finish Sat Apr  4 23:51:05 2015
 89.09% done, estimate finish Sat Apr  4 23:51:05 2015
 91.56% done, estimate finish Sat Apr  4 23:51:06 2015
 94.04% done, estimate finish Sat Apr  4 23:51:05 2015
 96.51% done, estimate finish Sat Apr  4 23:51:05 2015
 98.98% done, estimate finish Sat Apr  4 23:51:05 2015
Total translation table size: 63812
Total rockridge attributes bytes: 28361
Total directory bytes: 49152
Path table size(bytes): 112
Done with: The File(s)                             Block(s)    201838
Writing:   Ending Padblock                         Start Block 201913
Done with: Ending Padblock                         Block(s)    150
Max brk space used 5e000
202063 extents written (394 MB)

## OK, 此时会在 /root/iso 目录创建一个名为CentOS-6.4_64.iso 的镜像文件
[[email protected] iso]# ls *.iso
CentOS-6.4_64.iso

### MD5 校验码
[[email protected] iso]# pwd
/root/iso
[[email protected] iso]# ls
CentOS-6.4_64.iso  EULA    isolinux                  repodata                    RPM-GPG-KEY-CentOS-Security-6
CentOS_BuildTag    GPL     Packages                  RPM-GPG-KEY-CentOS-6        RPM-GPG-KEY-CentOS-Testing-6
EFI                images  RELEASE-NOTES-en-US.html  RPM-GPG-KEY-CentOS-Debug-6  TRANS.TBL

[[email protected] iso]# /usr/bin/implantisomd5 CentOS-6.4_64.iso
Inserting md5sum into iso image...
md5 = 90d069e78dddfb79877b4ab346ff2d50
Inserting fragment md5sums into iso image...
fragmd5 = 16b043bf617895ecdee76fae52dfa8c926525e3a645ae1bf96f259a5e895
frags = 20
Setting supported flag to 0
[[email protected] iso]#

六、安装测试

可以通过 Filezilla ,winscp  等软件把 iso 镜像传出来。然后可以通过虚拟机安装测试,如果测试没有问题,那么就可以刻录成光盘了。

通过 VMware Workstation 创建虚拟机,然后使用刚才我们创建的镜像。然后启动虚拟机,就会自动安装了。是不是 so easy ...

时间: 2024-07-30 05:13:38

CentOS 6.5 x86_64 系统定制自动化部署的相关文章

CentOS 6.5 x86_64系统手动释放内存

1.查询当前内存使用情况和释放缓存的参数 redismaster 10:29:24 [~] [root] free -m total used free shared buffers cachedMem: 7872 777 7095 0 117 435-/+ buffers/cache: 223 7648Swap: 16383 0 16383 查看释放缓存参数的命令,如下所示: redismaster 10:29:27 [~] [root] cat /proc/sys/vm/drop_cache

python 自动化部署工具Fabric简介

自动化部署工具Fabric简介 Fabric就是一个帮助我们在上线时减少重复/繁琐操作的自动化部署利器,对于缺乏成熟运维平台的众多小公司的运维或开发人员来说,掌握这个工具是有必要的. 1. Fabric是什么 Fabric官方文档的描述如下:      Fabric is a Python (2.5-2.7) library and command-line tool for streamlining the use of SSH for application deployment or sy

DHCP+TFTP+HTTP+kickstart实现PXE自动化部署系统Centos

前提:对DHCP,tftp-server,httpd有一定了结,本文将略过对服务的讲解和安装过程,主要讲通过这三个服务来实现PXE服务器的搭建过程. 准备工作: 安装软件包: 安装制作ks.cfg文件工具(图形界面下):yum-y system-config-kickstart 安装服务:yum -y installdchp tftp-server httpd 安装syslinux:yum -yinstall syslinux 或者使用下面的安装方法一次性全部安装: yum -y install

一键自动化部署(定制rpm包,yum仓库)

部署--前篇 上午将MySQL多实例部署完成,由于有公司特定一些需求,需要源码安装,现在需要批量部署,如果一台台部署,就太过麻烦,而且浪费时间,这个时候自动化部署 就体现出价值了 我们将MySQL制作定制化rpm包,然后放到我们的yum仓库中,在将yum所有客户端,都指向yum源,之后就是喝喝茶,看看片,轻松批量部署了,废话不多说,开干. 如果MySQL多实例还没配置的,或不了解软件的安装方式 的 请参考:http://qiuyt.blog.51cto.com/1229789/1920686 一

Linux基于PXE实现系统自动化部署

一.前言: 通常为计算机安装操作系统的方式主要是,光盘安装和U盘安装:在企业生产环境中,会需要对多台客户机或服务器安装Linux操作系统,如果还用常规的方法去安装,费时又费力:PXE批量部署系统即可高效完成此类工作. 二.原理: 使用光盘(镜像)安装Linux操作系统过程:POST(加电自检)-->引导序列(通过BISO发现引导CD-ROM或U盘)--Bootloader(kernel+ramdisk)-->anaconda(安装程序) 1.自动化部署服务器所需环境: PXE:Preboot

cobbler 批量自动化部署 Linux 系统

实验介绍:Cobbler自动化部署linux系统,比PXE部署方式效率更高,因此在大多环境中,以cobbler 方式部署系统,更为方便:具体步骤如下所示: 若描述有误欢迎拍砖交流QQ:45223208 1.安装cobbler 和 DHCP服务: yum install cobbler -y yum install dhcp -y 2. 启动服务 systemctl start cobbler tftp httpd systemctl enable cobbler tftp httpd 3. 根据

Redhat 7 配置Kickstart自动化部署多种系统

使用kickstart自动化部署多种系统,我想到的有两种场景,一种适合于日常运维,当机房上架个别新增的服务器时,根据不同的用途需求,通过一个多系统的启动菜单,输入相应的操作系统名称,即可自动化部署对应的操作系统.例如我在网上看到如下图这样的方案: 但是在第二种场景即系统集成项目中,如果同时要安装50台.100台的话,每台都要去输入,那也真是令人蛋疼了.系统集成项目通常会遇到服务器数量较多.且不同的项目对操作系统的需求不同的情况,如果准备一台Kickstart一次只是推送一种操作系统的自动化部署,

.NET 半天搭建Jenkins持续集成与自动化部署系统

前言 相信每一位程序员都经历过深夜加班上线的痛苦!而作为一个加班上线如家常便饭的码农,更是深感其痛.由于我们所做的系统业务复杂,系统庞大,设计到多个系统之间的合作,而核心系统更是采用分布式系统架构,由于当时对系统划分的不合理等等原因导致每次发版都会设计到多个系统的发布,小的版本三五个,大的版本十几个甚至几十个系统的同时发布!而我们也没有相应的基础设施的支撑,发版方式更是最传统的,开发人员将发布包发给运维人员,由其讲各个发布包一个一个覆盖到生产环境.因此每次上线仅仅发版就需要2-3个小时.这种方式

Web系统自动化部署脚本

Web开发的项目,除了在本地直接运行外,还可能经常需要在服务器上部署. 写了个自动化部署的脚本,仅供参考. 不少地方需要配置路径,个人建议使用绝对路径,不用依赖执行脚本时所在的路径. #!/bin/sh #删除源代码目录,重新更新最新代码 echo 'delete git project dir'rm -rf projectecho 'delete project done'echo 'start clone git project'git clone http://git.company.co