Skip to main content

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

image 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

Metadata

Release files for build4s 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for build4s 1.0.4
File Size Uploaded
build4s-1.0.4.zip 14.3 kB Details

Release files / build4s-1.0.4.zip

Download URL build4s-1.0.4.zip
Size 14.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b84c185e152b29e569164c78a8c2b99a15e48b6c494bea475646c54d9144032e
BLAKE2b-256 checksum
How to use checksums
9d8362fc06c765f17b730d544bfa150f09436b84f2ff2bf9fd6f614382203c49
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.26.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.8

Release history Release notifications | RSS feed

This release

1.0.4 This release

1 release file

1.0.3

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page