- 浏览: 2539388 次
- 性别:
- 来自: 成都
文章分类
最新评论
-
nation:
你好,在部署Mesos+Spark的运行环境时,出现一个现象, ...
Spark(4)Deal with Mesos -
sillycat:
AMAZON Relatedhttps://www.godad ...
AMAZON API Gateway(2)Client Side SSL with NGINX -
sillycat:
sudo usermod -aG docker ec2-use ...
Docker and VirtualBox(1)Set up Shared Disk for Virtual Box -
sillycat:
Every Half an Hour30 * * * * /u ...
Build Home NAS(3)Data Redundancy -
sillycat:
3 List the Cron Job I Have>c ...
Build Home NAS(3)Data Redundancy
Circle CI build Project
Recently our company start to use Circle CI to build and deploy our projects instead of Jenkins. Frankly speaking, I am an old man. I use jenkins a lot, I used to be a “DevOps” for sometime, I am a developer for 15 years, so I know in detail how these codes are compile and build to projects, so I think I am a better “DevOps”, haha. Ok, let’s try Circle CI, new tools should always be easier than old ones.
I put a .circleci directory under the GitHub project, add a config.yml according to the official document.
version: 2
jobs:
build:
machine: true
enviroment:
WORKSPACE: /home/circleci/repo
VERSION: 1.4
steps:
- checkout
- run: make prepare
- run: make build
- run: make run-dev
- run: make run-stage
- run: make run-prod
- run:
name: Install awscli
command: sudo pip install awscli
- run:
name: Deploy to S3
command: aws s3 sync ./dist/ s3://sillycat.artifacts/services.xxxxxxx --region us-west-1 --acl public-read
I am not that totally understand these, but I just take some other projects as example. My build step begins from checkout source codes, and run a lot of shell scripts, finally it install awscli and upload the binary to S3.
Different ways to deploy
https://circleci.com/docs/2.0/deployment-integrations/#aws
Using variable
https://circleci.com/docs/2.0/env-vars/#setting-an-environment-variable-in-a-project
We can integrate and use Jfrog Artifactory as well
http://sillycat.iteye.com/blog/2431253
Another Example Project
config.yml
defaults: &defaults
working_directory: ~/repo
docker:
# specify the version you desire here
- image: circleci/node:8.11.1
environment:
WORKSPACE: /home/circleci/repo
version: 2
jobs:
build:
<<: *defaults
steps:
- checkout
- run:
name: Write NPM Token to ~/.npmrc
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
- run:
name: Install global dependencies
command: sudo npm i -g serverless@latest webpack webpack-dev-server gulp @types/node typescript
- run:
name: Old Build Script
command: ./build.sh stage
deploy-to-recording-prod:
<<: *defaults
steps:
- checkout
- run:
name: Write NPM Token to ~/.npmrc
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
- run:
name: Install global dependencies
command: sudo npm i -g serverless@latest webpack webpack-dev-server gulp @types/node typescript
- run:
name: Old Build Script
command: ./build.sh prod
workflows:
version: 2
build-n-publish:
jobs:
- build:
context: aws-staging
filters:
branches:
only: /master/
- recording-prod-approval:
type: approval
requires:
- build
context: aws-staging
- deploy-to-recording-prod:
requires:
- recording-prod-approval
context: aws-production
filters:
branches:
only: /master/
build.sh is as follow
#!/usr/bin/env bash
STAGE=$1
# the following is from: https://circleci.com/docs/2.0/using-shell-scripts/
# Exit script if you try to use an uninitialized variable.
set -o nounset
# Exit script if a statement returns a non-true return value.
set -o errexit
# Use the error status of the first failure, rather than that of the last item in a pipeline.
set -o pipefail
# get current versions
node --version
npm --version
# # AWS Prod
# set +x
# export AWS_ACCESS_KEY_ID=$PROMOTED_AWS_ACCESS_KEY_ID_PROD
# export AWS_SECRET_ACCESS_KEY=$PROMOTED_AWS_SECRET_ACCESS_KEY_PROD
# export AWS_DEFAULT_REGION=us-west-2
# set -x
# npm i -g serverless@latest webpack webpack-dev-server gulp || exit 1
cd ${WORKSPACE}/auth || exit 1
npm install || exit 1
#aws sns create-topic --name user-clientapi-prod-crud || exit 1
serverless deploy --force --stage $STAGE || exit 1
#aws dynamodb put-item --table-name sillycatproxy__rpc_map_prod --item '{"call":{"S": “sillycat.user" },"endpoint":{ "S": "arn:aws:lambda:us-west-2:xxxxxxx:function:user-clientapi-prod-handler"}}' --region=us-west-2 || exit 1
References:
https://circleci.com
https://circleci.com/docs/2.0/deployment-integrations/#aws
Recently our company start to use Circle CI to build and deploy our projects instead of Jenkins. Frankly speaking, I am an old man. I use jenkins a lot, I used to be a “DevOps” for sometime, I am a developer for 15 years, so I know in detail how these codes are compile and build to projects, so I think I am a better “DevOps”, haha. Ok, let’s try Circle CI, new tools should always be easier than old ones.
I put a .circleci directory under the GitHub project, add a config.yml according to the official document.
version: 2
jobs:
build:
machine: true
enviroment:
WORKSPACE: /home/circleci/repo
VERSION: 1.4
steps:
- checkout
- run: make prepare
- run: make build
- run: make run-dev
- run: make run-stage
- run: make run-prod
- run:
name: Install awscli
command: sudo pip install awscli
- run:
name: Deploy to S3
command: aws s3 sync ./dist/ s3://sillycat.artifacts/services.xxxxxxx --region us-west-1 --acl public-read
I am not that totally understand these, but I just take some other projects as example. My build step begins from checkout source codes, and run a lot of shell scripts, finally it install awscli and upload the binary to S3.
Different ways to deploy
https://circleci.com/docs/2.0/deployment-integrations/#aws
Using variable
https://circleci.com/docs/2.0/env-vars/#setting-an-environment-variable-in-a-project
We can integrate and use Jfrog Artifactory as well
http://sillycat.iteye.com/blog/2431253
Another Example Project
config.yml
defaults: &defaults
working_directory: ~/repo
docker:
# specify the version you desire here
- image: circleci/node:8.11.1
environment:
WORKSPACE: /home/circleci/repo
version: 2
jobs:
build:
<<: *defaults
steps:
- checkout
- run:
name: Write NPM Token to ~/.npmrc
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
- run:
name: Install global dependencies
command: sudo npm i -g serverless@latest webpack webpack-dev-server gulp @types/node typescript
- run:
name: Old Build Script
command: ./build.sh stage
deploy-to-recording-prod:
<<: *defaults
steps:
- checkout
- run:
name: Write NPM Token to ~/.npmrc
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
- run:
name: Install global dependencies
command: sudo npm i -g serverless@latest webpack webpack-dev-server gulp @types/node typescript
- run:
name: Old Build Script
command: ./build.sh prod
workflows:
version: 2
build-n-publish:
jobs:
- build:
context: aws-staging
filters:
branches:
only: /master/
- recording-prod-approval:
type: approval
requires:
- build
context: aws-staging
- deploy-to-recording-prod:
requires:
- recording-prod-approval
context: aws-production
filters:
branches:
only: /master/
build.sh is as follow
#!/usr/bin/env bash
STAGE=$1
# the following is from: https://circleci.com/docs/2.0/using-shell-scripts/
# Exit script if you try to use an uninitialized variable.
set -o nounset
# Exit script if a statement returns a non-true return value.
set -o errexit
# Use the error status of the first failure, rather than that of the last item in a pipeline.
set -o pipefail
# get current versions
node --version
npm --version
# # AWS Prod
# set +x
# export AWS_ACCESS_KEY_ID=$PROMOTED_AWS_ACCESS_KEY_ID_PROD
# export AWS_SECRET_ACCESS_KEY=$PROMOTED_AWS_SECRET_ACCESS_KEY_PROD
# export AWS_DEFAULT_REGION=us-west-2
# set -x
# npm i -g serverless@latest webpack webpack-dev-server gulp || exit 1
cd ${WORKSPACE}/auth || exit 1
npm install || exit 1
#aws sns create-topic --name user-clientapi-prod-crud || exit 1
serverless deploy --force --stage $STAGE || exit 1
#aws dynamodb put-item --table-name sillycatproxy__rpc_map_prod --item '{"call":{"S": “sillycat.user" },"endpoint":{ "S": "arn:aws:lambda:us-west-2:xxxxxxx:function:user-clientapi-prod-handler"}}' --region=us-west-2 || exit 1
References:
https://circleci.com
https://circleci.com/docs/2.0/deployment-integrations/#aws
发表评论
-
Stop Update Here
2020-04-28 09:00 310I will stop update here, and mo ... -
NodeJS12 and Zlib
2020-04-01 07:44 465NodeJS12 and Zlib It works as ... -
Docker Swarm 2020(2)Docker Swarm and Portainer
2020-03-31 23:18 361Docker Swarm 2020(2)Docker Swar ... -
Docker Swarm 2020(1)Simply Install and Use Swarm
2020-03-31 07:58 363Docker Swarm 2020(1)Simply Inst ... -
Traefik 2020(1)Introduction and Installation
2020-03-29 13:52 328Traefik 2020(1)Introduction and ... -
Portainer 2020(4)Deploy Nginx and Others
2020-03-20 12:06 419Portainer 2020(4)Deploy Nginx a ... -
Private Registry 2020(1)No auth in registry Nginx AUTH for UI
2020-03-18 00:56 428Private Registry 2020(1)No auth ... -
Docker Compose 2020(1)Installation and Basic
2020-03-15 08:10 364Docker Compose 2020(1)Installat ... -
VPN Server 2020(2)Docker on CentOS in Ubuntu
2020-03-02 08:04 444VPN Server 2020(2)Docker on Cen ... -
Buffer in NodeJS 12 and NodeJS 8
2020-02-25 06:43 376Buffer in NodeJS 12 and NodeJS ... -
NodeJS ENV Similar to JENV and PyENV
2020-02-25 05:14 464NodeJS ENV Similar to JENV and ... -
Prometheus HA 2020(3)AlertManager Cluster
2020-02-24 01:47 413Prometheus HA 2020(3)AlertManag ... -
Serverless with NodeJS and TencentCloud 2020(5)CRON and Settings
2020-02-24 01:46 330Serverless with NodeJS and Tenc ... -
GraphQL 2019(3)Connect to MySQL
2020-02-24 01:48 242GraphQL 2019(3)Connect to MySQL ... -
GraphQL 2019(2)GraphQL and Deploy to Tencent Cloud
2020-02-24 01:48 443GraphQL 2019(2)GraphQL and Depl ... -
GraphQL 2019(1)Apollo Basic
2020-02-19 01:36 320GraphQL 2019(1)Apollo Basic Cl ... -
Serverless with NodeJS and TencentCloud 2020(4)Multiple Handlers and Running wit
2020-02-19 01:19 306Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(3)Build Tree and Traverse Tree
2020-02-19 01:19 310Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(2)Trigger SCF in SCF
2020-02-19 01:18 284Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(1)Running with Component
2020-02-19 01:17 302Serverless with NodeJS and Tenc ...
相关推荐
在本文中,我们将深入探讨如何使用Scala编程语言和构建工具sbt(Simple Build Tool)结合Circle CI(持续集成服务)来构建一个Scala Play框架的应用。首先,我们需要了解这些技术的基本概念。 **Scala**: Scala是一...
用法: st2 run circle_ci.get_build_number project= < project> vcs_type=github username= < username> vcs_revision= 等待构建完成wait_until_build_finishes 该操作可用于等待构建完成以获取内部版本号。...
标题"circle:Circle CI API的R客户端软件包"表明这是一个R语言的软件包,专门用于与Circle CI(一个流行的持续集成/持续部署服务)的API进行交互。这个软件包使得R用户能够更方便地利用Circle CI的功能,如触发构建...
Circle CI和Docker 使用Circle CI测试Docker容器的依存关系。概述这是一个示例存储库,用于在需要Docker容器依赖项时测试Circle CI的构建。 该项目包含一个基本节点应用程序,它将尝试访问Docker容器中托管的...
在Circle CI中运行命令并将其结果发布到GitHub Pull Request的命令 用法 $ circle-gh-tee [OPTIONS] -- <COMMAND>... 必需的环境变量 GITHUB_ACCESS_TOKEN GitHub的个人访问令牌 要求范围repo :完全控制私有存储库...
Circle-CI Github 子模块该存储库包含将 GitHub Webhooks Handler 与 Circle-CI API 构建触发集成的模块。 一旦挂钩到此端点的子模块在 GitHub 上更新,它将在它更新的给定分支上触发构建。问题解决了它是由于 ...
与您的Github或Bitbucket帐户关联的Circle CI项目。 在服务器中配置的SSH密钥,并通过PERMISSIONS > SSH Permissions将其添加到Circle CI项目中。 项目配置 将部署程序包作为dev依赖项添加到您的laravel项目中。 ...
circle-ci-android-sample-源码.rar
《Norimaki:Circle CI的Android客户端》 Norimaki是一款专为Circle CI设计的Android应用程序,它使得持续集成和持续交付(CI/CD)流程在移动设备上变得轻松便捷。这款应用充分利用了Kotlin语言的优势,同时整合了...
因此,我们制作了一个带有所有ci脚本的小型应用程序,用于构建,测试和打包该应用程序,所有这些脚本均存储在ci文件夹下。 我们最终想要一个具有以下工作的管道: 向下克隆:进行git克隆,并准备存储库以分发到...
CI生成 模糊 自动生成用于持续集成(CI)服务的配置yaml文件。 永远不要再手动写入CI yaml文件! 用例 设置项目并想使用CI服务 切换CI服务,只需运行并立即生成yaml文件 运行过程 安装: composer require kerrialn/...
一个关键的问题是如何安全地在持续集成(CI)服务如Circle CI和Travis CI中处理和存储密钥库文件,这正是`ciappsigningexample`项目所关注的。这个项目提供了一个例子,演示如何在这些平台上进行应用签名,同时确保...
python-ci 简单的游乐场,可测试python项目并圈出ci想法
这是使用Symfony控制台构建的CLI实用程序,用于查询Circle CI项目。 安装 与作曲家一起 # Install with composer. composer require "code-drop/circle-cli ~1.0" # Copy the sample private file, then add your ...
"point to circle.zip" 是一个针对Cinema 4D(简称C4D)用户的插件包,该插件在建模领域中具有很高的实用性和流行度。Cinema 4D是一款强大的3D建模、动画和渲染软件,广泛应用于电影特效、电视广告以及产品设计等...
Git流动Circle CI 此仓库定义了与Git Flow兼容的典型Circle CI管道定义在此仓库中,使用git flow以及所有默认配置: 这个git flow init --defaults是用git flow init --defaults初始化的git flow init --defaults ...
CircleCITestApp 演示应用程序以测试Circle CI测试集成
"circle_Circle_"这个标题可能指的是一个用于创建圆环的代码或函数,可能是用某种编程语言实现的。圆环是由一个内圆和一个外圆共同构成的闭合图形,通常在二维坐标系中表示。在描述中提到的“原点、大小任意改动”,...
Circle CI示范项目 该存储库包含Spring Boot应用程序中Circle CI配置的代码示例。
在Circle CI上配置构建 在“项目设置”页面的“ AWS权限”选项卡上添加AWS凭证。 建议使用IAM用户。 用户必须有权创建和销毁实例,以及创建标签并将其与实例相关联。 将build / provision-test-instance.yml中的...