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的time模块一些常用功能(各种与时间相关的函数)

《Python的time模块一些常用功能(各种与时间相关的函数)》Python的time模块提供了各种与时间相关的函数,包括获取当前时间、处理时间间隔、执行时间测量等,:本文主要介绍Python的... 目录1. 获取当前时间2. 时间格式化3. 延时执行4. 时间戳运算5. 计算代码执行时间6. 转换为指

Python正则表达式语法及re模块中的常用函数详解

《Python正则表达式语法及re模块中的常用函数详解》这篇文章主要给大家介绍了关于Python正则表达式语法及re模块中常用函数的相关资料,正则表达式是一种强大的字符串处理工具,可以用于匹配、切分、... 目录概念、作用和步骤语法re模块中的常用函数总结 概念、作用和步骤概念: 本身也是一个字符串,其中

Python中的getopt模块用法小结

《Python中的getopt模块用法小结》getopt.getopt()函数是Python中用于解析命令行参数的标准库函数,该函数可以从命令行中提取选项和参数,并对它们进行处理,本文详细介绍了Pyt... 目录getopt模块介绍getopt.getopt函数的介绍getopt模块的常用用法getopt模

Windows Docker端口占用错误及解决方案总结

《WindowsDocker端口占用错误及解决方案总结》在Windows环境下使用Docker容器时,端口占用错误是开发和运维中常见且棘手的问题,本文将深入剖析该问题的成因,介绍如何通过查看端口分配... 目录引言Windows docker 端口占用错误及解决方案汇总端口冲突形成原因解析诊断当前端口情况解

Spring Boot 集成 Quartz并使用Cron 表达式实现定时任务

《SpringBoot集成Quartz并使用Cron表达式实现定时任务》本篇文章介绍了如何在SpringBoot中集成Quartz进行定时任务调度,并通过Cron表达式控制任务... 目录前言1. 添加 Quartz 依赖2. 创建 Quartz 任务3. 配置 Quartz 任务调度4. 启动 Sprin

使用Python构建一个Hexo博客发布工具

《使用Python构建一个Hexo博客发布工具》虽然Hexo的命令行工具非常强大,但对于日常的博客撰写和发布过程,我总觉得缺少一个直观的图形界面来简化操作,下面我们就来看看如何使用Python构建一个... 目录引言Hexo博客系统简介设计需求技术选择代码实现主框架界面设计核心功能实现1. 发布文章2. 加

SpringBoot集成Milvus实现数据增删改查功能

《SpringBoot集成Milvus实现数据增删改查功能》milvus支持的语言比较多,支持python,Java,Go,node等开发语言,本文主要介绍如何使用Java语言,采用springboo... 目录1、Milvus基本概念2、添加maven依赖3、配置yml文件4、创建MilvusClient

python logging模块详解及其日志定时清理方式

《pythonlogging模块详解及其日志定时清理方式》:本文主要介绍pythonlogging模块详解及其日志定时清理方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地... 目录python logging模块及日志定时清理1.创建logger对象2.logging.basicCo

Qt spdlog日志模块的使用详解

《Qtspdlog日志模块的使用详解》在Qt应用程序开发中,良好的日志系统至关重要,本文将介绍如何使用spdlog1.5.0创建满足以下要求的日志系统,感兴趣的朋友一起看看吧... 目录版本摘要例子logmanager.cpp文件main.cpp文件版本spdlog版本:1.5.0采用1.5.0版本主要

如何高效移除C++关联容器中的元素

《如何高效移除C++关联容器中的元素》关联容器和顺序容器有着很大不同,关联容器中的元素是按照关键字来保存和访问的,而顺序容器中的元素是按它们在容器中的位置来顺序保存和访问的,本文介绍了如何高效移除C+... 目录一、简介二、移除给定位置的元素三、移除与特定键值等价的元素四、移除满足特android定条件的元