Skip to main content

A build tools for CodeBuild

Project description

Build4s - A build tool for simple, standard, stable and speed

image image

About

受启发于AWS CodeBuild的自动化编译打包服务,抽取其中标准化编译打包功能实现的一个本地组件。AWS CodeBuild User Guide

  • Build提供了标准化的编译打包流程,可编译源代码,运行单元测试,并生成可供部署的项目。
  • Build提供了适用于最热门编程语言的预配置构建环境,只需配置简单的构建脚本就可以。

Requirements

  • Python3
  • PyYAML

Install

安装最新的Release包,通过pip命令安装:

pip install build4s

或者通过下载源码包或clone代码至本地,然后通过如下命令安装:

python setup.py install

Usage

buildcli --spec-file=buildspec.yml --target-file=target.zip

使用--help查看更多使用帮助。
--spec-file参数指定编译时使用的标准化流程文件,若为空则默认为buildspec.yml。 --target-file参数指定打包生成的压缩包文件,若为空则默认为target.zip。

Release

Example

一个示例的buildspec.yml文件如下所示:

version: 0.2
env:
  variables:
    JAVA_HOME: "/usr/lib/jvm/java-8-openjdk-amd64"

phases:
  install:
    commands:
      - echo Entered the install phase...
  pre_build:
    commands:
      - echo Entered the pre_build phase...
  build:
    commands:
      - echo Entered the build phase...
      - mvn clean package -e -Dmaven.test.skip=true
  post_build:
    commands:
      - echo Entered the post_build phase...
artifacts:
  files:
    - example.jar
    - classes/config/*
  discard-paths: no
  base-directory: target

将该文件置于源代码目录,在该目录下执行如下命令,即会在当前目录下生成target.zip文件。
与自动化部署服务Deploy4s配合使用,效果更佳,味道更美。

buildcli --target-file=target.zip

Author

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

build4s-1.0.3.zip (21.8 kB view details)

Uploaded Source

File details

Details for the file build4s-1.0.3.zip.

File metadata

  • Download URL: build4s-1.0.3.zip
  • Upload date:
  • Size: 21.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for build4s-1.0.3.zip
Algorithm Hash digest
SHA256 1b7ef8c3c5cbb618f94d72707af0c899e4b326a7f06b4b2d0cede68f9ea98a71
MD5 4cadd48f8f5c4f8930247ec51a07155c
BLAKE2b-256 ef086f575c5b79cd7324a1f3f5f68f3563232a7c0711c6f973c4298d8f691a16

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page