技术平台-开发环境-集成部署

abstiger大约 2 分钟

集成部署

基于 gitlab-runner 的持续集成及持续部署管理。

gitlab-runner的安装与配置

参考文档:https://docs.gitlab.com/runner/install/linux-repository.htmlopen in new window

安装步骤

# For Debian/Ubuntu/Mint
curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh | sudo bash

# For Debian/Ubuntu/Mint
sudo apt-get install gitlab-runner

安装检查

  • 系统服务状态:
systemctl status gitlab-runner

安装配置

注册本runner,参考文档:https://docs.gitlab.com/runner/register/index.htmlopen in new window

注册gitlab-runner

gitlab-runner register

注意:tags留空

开发语言

为了完成DevOps的实践,我们整个仓库服务器的搭建采用以下软件的安装与配合:

编译基础安装

包括 C/C++ 语言的编译安装

安装步骤

# GCC and G++
sudo apt install -y build-essential 

安装检查

tiger@dev:~$ gcc --version
gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

java及maven 安装与配置

Java 语言的开发相关,采用 OpenJDK8

OpenJDK8 安装步骤

sudo apt install -y openjdk-8-jdk

OpenJDK8 安装检查

tiger@dev:~$ java -version
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-8u292-b10-0ubuntu1~20.04-b10)
OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)

Maven 安装步骤

sudo apt install -y maven

Maven 安装检查

tiger@dev:~$ mvn -v
Apache Maven 3.6.3
Maven home: /usr/share/maven
Java version: 1.8.0_292, vendor: Private Build, runtime: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "linux", version: "5.4.0-85-generic", arch: "amd64", family: "unix"

nodejs及pnpm 安装与配置

官方安装参考文档:https://github.com/nodesource/distributions/blob/master/README.md#debinstallopen in new window

Nodejs 安装步骤

# Using Ubuntu
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt install -y nodejs

Nodejs 安装检查

node -v

pnpm 安装步骤

参考文档:https://pnpm.io/installationopen in new window

curl -fsSL https://get.pnpm.io/install.sh | sh -

pnpm 安装检查

pnpm -v

docker-ce 安装与配置

官方安装参考文档:https://docs.docker.com/engine/install/ubuntu/open in new window

安装步骤

# 安装 docker-ce 及 docker compose
sudo apt-get -y install docker-ce docker-compose-plugin

安装检查

docker version
docker compose version

安装配置

# Create the docker group.
sudo groupadd docker

# Add your user to the docker group.
sudo usermod -aG docker $USER

helm 安装与配置

TODO

ansible 安装与配置

用于自动化运维,官方参考文档:https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#installing-ansible-on-ubuntuopen in new window

安装步骤

sudo apt install -y ansible

安装检查

ansible --version
Loading...