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

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.4.zip (14.3 kB view details)

Uploaded Source

File details

Details for the file build4s-1.0.4.zip.

File metadata

  • Download URL: build4s-1.0.4.zip
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for build4s-1.0.4.zip
Algorithm Hash digest
SHA256 b84c185e152b29e569164c78a8c2b99a15e48b6c494bea475646c54d9144032e
MD5 69d2dfa2c3ee79c7dd99999882c79c23
BLAKE2b-256 9d8362fc06c765f17b730d544bfa150f09436b84f2ff2bf9fd6f614382203c49

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.4 This release

1 file

1.0.3

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page