Jenkins + Github持续集成构建Docker容器,维基百科人工自能(AI)模块

本文主要是介绍Jenkins + Github持续集成构建Docker容器,维基百科人工自能(AI)模块,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

本文分两部分,第一部分是手动计划任务的方式构建Github上的Docker程序,第二部分是用Github webhook Trigger一个自动构建任务。

Jenkins采用2.5版本
Docker采用1.7.1
代码托管使用的Github官网
系统为IBM Bluemix提供的Cent6.7,服务器地址在美国南加州
 
1.1 创建一个Freestyle Project, let's say jenkins-docker
 
1.2 Set workplace to /var/lib/jenkins/jobs/jenkins-docker/workplace
 
1.3 Add Github address:Git@github.com:sangrealest/Jenkins_Docker_Ansible.git
 

Dockerfile 很简单,就是拉取最新的Nginx,并将2048游戏添加到Nginx根目录

FROM nginx:latest
MAINTAINER Shanker shanker@yeah.net
ADD 2048-master /usr/share/nginx/html
ADD testfile /root/
EXPOSE 80

 
1.4 Under Build Triggers, set Poll SCM: H * * * *
 
1.5 Under Build->Execute shell, use below shell script:
 
#!/bin/sh                                                                                                                                                            
echo '>>> Get old container id'
CID=$(docker ps | grep "jenkins-docker" | awk '{print $1}')
echo $CID
sudo /usr/bin/docker build -t jenkins-docker /var/lib/jenkins/jobs/jenkins-docker/workspace | tee /var/lib/jenkins/jobs/jenkins-docker/workspace/Docker_build_result.log
echo '>>> Stopping old container'
if [ "$CID" != "" ];then
sudo  /usr/bin/docker stop $CID
fi
echo '>>> Restarting docker'
sudo service docker restart
sleep 5
  
echo '>>> Starting new container'
sudo /usr/bin/docker run -p 3000:80 -d jenkins-docker

1.6 配置jenkins用户
 
因为jenkins service是用jenkins用户启动的,所有要执行docker相关命令需要将jenkins加入到docker group,赋予jenkins sudo without password

sudo usermod -G docker jenkins
visudo, add bellow 
jenkins ALL=(ALL:ALL) NOPASSWD: ALL"

然后Build Project, 如果成打开运行Jenkins机器的3000端口会看到2048游戏的界面:

以上的构建是基于计划任务的,每小时的随机分钟内执行一次构建任务(SCM H * * * *),然后懒人还有懒人的做法,就是添加Github webhook功能,当push一个更新的时候自动trigger一次构建。
 
2.1 在Github个人主页上安装Github Plugin并添加你的Jenkins server的webhook地址:比如我的Jenkins地址是mywebsite.com:8080,这里要写的地址就应该是http://mywebsite.com:8080/github-webhook
 

2.2 返回jenkins-docker项目首页,点击 Configure, 添加Github的账号密码信息,因为我用的个人仓库,需要使用私钥认证,选择Certificate, 将放在jenkins home/.ssh 下的私钥路径填上:
 

2.3 Build Triggers 勾上Build when a change is pushed to Github


 
2.4 这时候可以更新一下Github Project下面的文件并且push一下,看看是否触发了jenkins的构建动作:
如图,我刚push完成,jenkins这边就已经捕捉到并且开始构建新的任务:

我们在Github项目地下echo 一句话到testfile,并且添加到容器的/root下时间是7:49:58,然后我的容器更新后并启动运行的时间是7:50:26,只用了28秒钟就构建成功了!

有了这样的集成,后续我们就可以考虑将Ansible也加进来,做持续部署,当把jenkins pipeline, docker, ansible都集成到一起,就是CI/CD完全集成工作了,或者用Mesos+Marathon+Docker云数据中心的方式来做持续部署。
 
欢迎补充!

域网内利用GitLab+Jenkins自动生成GitBook并发布(Nginx)  http://www.linuxidc.com/Linux/2016-05/131136.htm

Linux+Git+Maven+Jenkins+Neuxs自动化编译环境搭建 http://www.linuxidc.com/Linux/2016-02/128652.htm

在CentOS 7上安装Jenkins  http://www.linuxidc.com/Linux/2016-11/137548.htm

CentOS6安装Jenkins  http://www.linuxidc.com/Linux/2016-05/131365.htm

使用Jenkins配置Git+Maven的自动化构建 http://www.linuxidc.com/Linux/2016-02/128641.htm

Jenkins+Maven+Git搭建持续集成和自动化部署的配置手记 http://www.linuxidc.com/Linux/2015-06/118606.htm

Jenkins的分布式构建及部署——节点  http://www.linuxidc.com/Linux/2015-05/116903.htm

CentOS7下Jenkins 服务器的安装  http://www.linuxidc.com/Linux/2017-02/141119.htm

Jenkins+Gitlab+Sonar代码检查平台搭建  http://www.linuxidc.com/Linux/2017-01/139900.htm

在Fedora 21上搭建Jenkins+SonarQube的Maven项目自动化测试平台  http://www.linuxidc.com/Linux/2017-02/140780.htm

Jenkins 的详细介绍:请点这里
Jenkins 的下载地址:请点这里

本文永久更新链接地址:http://www.linuxidc.com/Linux/2017-03/141642.htm

linux

Touhou Community Reliant Automatic Patcher

Join the chat at http://discord.thpatch.net

Description

Basically, this is an almost-generic, easily expandable and customizable framework to patch Windows applications in memory, specifically tailored towards the translation of Japanese games.

It is mainly developed to facilitate self-updating, multilingual translation of the Touhou Project games on Touhou Patch Center, but can theoretically be used for just about any other patch for these games, without going through that site.

Main features of the base engine
  • Easy DLL injection of the main engine and plug-ins into the target process.

  • Full propagation to child processes. This allows the usage of other third-party patches which also use DLL injection, together with thcrap. (Yes, this was developed mainly for vpatch.)

  • Uses JSON for all patch configuration data, making the patches themselves open-source by design. By recursively merging JSON objects, this gives us...

  • Patch stacking - apply any number of patches at the same time, sorted by a priority list. Supports wildcard-based blacklisting of files in certain patches through the run configuration.

  • Automatically adds transparent Unicode filename support via Win32 API wrappers to target processes using the Win32 ANSI functions, without the need for programs like AppLocale.

  • Patches can support multiple builds and versions of a single program, identified by a combination of SHA-256 hashes and .EXE file sizes.

  • Binary hacks for arbitrary in-memory modifications of the original program (mostly used for custom assembly).

  • Breakpoints to call custom DLL functions at any instruction of the original code. These functions can read and modify the current CPU register state.

  • Multiple sets of sequentially applied binary hacks and breakpoints, for working around EXE packers and DRM schemes.

  • File breakpoints to replace data files in memory with replacements from patches.

  • Wildcard-based file format patching hooks called on file replacements - can apply patches to data files according to a (stackable!) JSON description.

  • Optional Steam integration for games that are available through Steam, but don't come with Steam integration themselves. Can be disabled by deleting steam_api.dll.

  • ... and all that without any significant impact on performance. ☺

Modules included

  • win32_utf8: A UTF-8 wrapper library around the Win32 API calls we require. This is a stand-alone project and can (and should) be freely used in other applications, too.
  • thcrap: The main patch engine.
  • thcrap_loader: A command-line loader to call the injection functions of thcrap on a newly created process.
  • thcrap_configure: A rather cheap command-line patch configuration utility. Will eventually be replaced with a GUI tool.
  • thcrap_tsa: A thcrap plug-in containing patch hooks for games using the STG engine by Team Shanghai Alice.
  • thcrap_update: A thcrap plug-in containing updating functionality for patches as well as digitally signed automatic updates of thcrap itself.

Building

A ready-made Visual Studio build configuration, covering all modules and their dependencies, is provided as part of this repository. To set up the build:

  • Install Visual Studio Community 2013.

  • Make sure that you've pulled all Git submodules together with this repo:

    git clone --recursive https://github.com/thpatch/thcrap.git
  • (Optional) If your thcrap build should be able to automatically update itself, you need to create a code signing certificate. To do this, run the following commands on the Visual Studio command prompt (vcvarsall.bat) in the root directory of this repo (the one with thcrap.sln):

    makecert -n "CN=Your Name,E=yourmail@provider.net" -$ individual -a sha256 -len 4096 -r -cy authority -sky signature -pe -sv cert.pvk cert.cer pvk2pfx -pvk cert.pvk -spc cert.cer -pfx cert.pfx

    cert.pfx is used to sign the binaries as part of the build, so don't change the file name.

Then, open thcrap.sln, choose Debug or Release from the drop-down menu in the toolbar (or the Configuration Manager) and run Build → Build Solution from the main menu.

You can also build from the command line by running the Visual Studio tool environment batch file (vcvarsall.bat), then run

msbuild /m /p:Configuration=Debug

or

msbuild /m /p:Configuration=Release

in the thcrap directory. The binaries will end up in the bin/ subdirectory.

Signing a release archive for automatic updates

First, convert cert.pvk to a .pem file using OpenSSL, then use this file together with scripts/release_sign.py:

openssl rsa -inform pvk -in cert.pvk -outform pem -out cert.pempython release_sign.py -k cert.pem thcrap.zip

Using different compilers

Visual Studio Community 2013 is recommended for building, and the build configuration references the Visual Studio 2013 platform toolset with Windows XP targeting support by default. However, the project should generally build under every version since Visual C++ 2010 Express after changing the <PlatformToolset> value in Base.props. For a list of all platform toolsets available on your system, open the Properties dialog for any included project and refer to the drop-down menu at Configuration Properties → General → Platform Toolset.

Compilation with MinGW is currently not supported. This is not likely to change in the foreseeable future as we don't see much value in it.

Dependencies

All required third-party libraries for the C code are included as Git submodules. These are:

  • Jansson, required for every module apart from win32_utf8.

  • libpng (>= 1.6.0), required by thcrap_tsa for image patching.

  • zlib, required by thcrap_update for CRC32 verification. It's required by libpng anyway, though.

The scripts in the scripts directory are written in Python 3. Some of them require further third-party libraries not included in this repository:

  • PyCrypto is required by release_sign.py.

License

The Touhou Community Reliant Patcher and all accompanying modules are released to the Public Domain, unless stated otherwise. This means you can do whatever you want with this code without so much as crediting us.

That said, we do appreciate attribution. ☺

Characters

 

  1. MarisaKirisame
  2. MinamitsuMurasa
  3. ReimuHakurei
  4. SakuyaIzayoi
  5. WriggleNightbug
  6. YoumuKonpaku
  7. YuugiHoshiguma
  8. YuukaKazami
Stages

 

  1. ForestOfMagic
  2. HakureiShrine
  3. Makai
  4. Netherworld
Projects

 

  1. FantasyCrescendo
  2. HouraiLauncher
  3. HouraiLib
  4. HouraiLocalization
  5. SmashBrew
Navigation
  • Home
  • RecentChanges
  • FindPage
  • FantasyCrescendo
  • Development
  • ReimuHakurei
Last updated at 2017-03-29 05:41:44

reimu_portrait_1.png

Reimu Hakurei

Reimu Hakurei is a playable character in Fantasy Crescendo.

目录

  1. Reimu Hakurei
    1. General Information
    2. Attacks
    3. Images
    4. Trivia
    5. External Links

 

General Information

Home Stage: Hakurei Shrine 
Height: 1.5 m 
Weight: 1 weight unit 
Walk Speed: 5 m/s 
Run Speed: 10 m/s 

Attacks

 

Work in Progress This section is a work in progress. A lot of what is presented here is subject to potential future change.

Attack

Description

Damage

Knockback

Ground Attacks

Neutral Combo

TODO

N/A

N/A

Strong Attacks

Forward Tilt

TODO

N/A

N/A

Up Tilt

TODO

N/A

N/A

Down Tilt

TODO

N/A

N/A

Smash Attacks

Forward Smash

TODO

N/A

N/A

Up Smash

TODO

N/A

N/A

Down Smash

TODO

N/A

N/A

Aerial Attacks

Neutral Aerial

TODO

N/A

N/A

Up Aerial

TODO

N/A

N/A

Forward Aerial

TODO

N/A

N/A

Back Aerial

TODO

N/A

N/A

Special Attacks

Neutral Special

TODO

N/A

N/A

Up Special

TODO

N/A

N/A

Side Special

TODO

N/A

N/A

Down Special

TODO

N/A

N/A

 

Images

reimu_portrait_1.png reimu_portrait_2.png reimu_portrait_3.png reimu_portrait_4.png

Trivia

 

External Links

  • Reimu Hakurei on TouhouWiki

 


CategoryCharacters

转载于:https://www.cnblogs.com/totoo/p/GitHub.html

这篇关于Jenkins + Github持续集成构建Docker容器,维基百科人工自能(AI)模块的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/312786

相关文章

Python中构建终端应用界面利器Blessed模块的使用

《Python中构建终端应用界面利器Blessed模块的使用》Blessed库作为一个轻量级且功能强大的解决方案,开始在开发者中赢得口碑,今天,我们就一起来探索一下它是如何让终端UI开发变得轻松而高... 目录一、安装与配置:简单、快速、无障碍二、基本功能:从彩色文本到动态交互1. 显示基本内容2. 创建链

SpringCloud集成AlloyDB的示例代码

《SpringCloud集成AlloyDB的示例代码》AlloyDB是GoogleCloud提供的一种高度可扩展、强性能的关系型数据库服务,它兼容PostgreSQL,并提供了更快的查询性能... 目录1.AlloyDBjavascript是什么?AlloyDB 的工作原理2.搭建测试环境3.代码工程1.

Golang使用etcd构建分布式锁的示例分享

《Golang使用etcd构建分布式锁的示例分享》在本教程中,我们将学习如何使用Go和etcd构建分布式锁系统,分布式锁系统对于管理对分布式系统中共享资源的并发访问至关重要,它有助于维护一致性,防止竞... 目录引言环境准备新建Go项目实现加锁和解锁功能测试分布式锁重构实现失败重试总结引言我们将使用Go作

Node.js 中 http 模块的深度剖析与实战应用小结

《Node.js中http模块的深度剖析与实战应用小结》本文详细介绍了Node.js中的http模块,从创建HTTP服务器、处理请求与响应,到获取请求参数,每个环节都通过代码示例进行解析,旨在帮... 目录Node.js 中 http 模块的深度剖析与实战应用一、引言二、创建 HTTP 服务器:基石搭建(一

更改docker默认数据目录的方法步骤

《更改docker默认数据目录的方法步骤》本文主要介绍了更改docker默认数据目录的方法步骤,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一... 目录1.查看docker是否存在并停止该服务2.挂载镜像并安装rsync便于备份3.取消挂载备份和迁

SpringBoot使用注解集成Redis缓存的示例代码

《SpringBoot使用注解集成Redis缓存的示例代码》:本文主要介绍在SpringBoot中使用注解集成Redis缓存的步骤,包括添加依赖、创建相关配置类、需要缓存数据的类(Tes... 目录一、创建 Caching 配置类二、创建需要缓存数据的类三、测试方法Spring Boot 熟悉后,集成一个外

Docker集成CI/CD的项目实践

《Docker集成CI/CD的项目实践》本文主要介绍了Docker集成CI/CD的项目实践,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学... 目录一、引言1.1 什么是 CI/CD?1.2 docker 在 CI/CD 中的作用二、Docke

如何在一台服务器上使用docker运行kafka集群

《如何在一台服务器上使用docker运行kafka集群》文章详细介绍了如何在一台服务器上使用Docker运行Kafka集群,包括拉取镜像、创建网络、启动Kafka容器、检查运行状态、编写启动和关闭脚本... 目录1.拉取镜像2.创建集群之间通信的网络3.将zookeeper加入到网络中4.启动kafka集群

SpringBoot集成SOL链的详细过程

《SpringBoot集成SOL链的详细过程》Solanaj是一个用于与Solana区块链交互的Java库,它为Java开发者提供了一套功能丰富的API,使得在Java环境中可以轻松构建与Solana... 目录一、什么是solanaj?二、Pom依赖三、主要类3.1 RpcClient3.2 Public

SpringBoot3集成swagger文档的使用方法

《SpringBoot3集成swagger文档的使用方法》本文介绍了Swagger的诞生背景、主要功能以及如何在SpringBoot3中集成Swagger文档,Swagger可以帮助自动生成API文档... 目录一、前言1. API 文档自动生成2. 交互式 API 测试3. API 设计和开发协作二、使用