zbpack

module
v0.0.0-...-2d1dbde Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2024 License: MPL-2.0

README

zbpack

zbpack (pronounced “Zeabur Pack”) aims to automatically analyze the language, version, and framework used based on the source code and package the service into the most suitable deployment form, such as static resources, cloud functions, containers, or multiple types by one click. It is mainly used in the Zeabur platform as the build tool to determine the code type and build the container image automatically (without writing the Dockerfile manually.)

Components

zbpack is consist of the following components:

  • Planners: The planners are responsible for analyzing the source code and determining the type of the code. The planners are located in the internal directory.
  • zeaburpack library: The zeaburpack library is the library of zbpack that can be used in your platform directly. It is located in the pkg/zeaburpack directory.
  • CLI: The CLI is the command-line interface of zbpack for testing purpose. It is located in the cmd/zbpack directory.

Usage

Common Part
  1. Fork the repository and clone it to your local machine.
  2. Make sure you have Go installed on your machine. You can download it from the official website: https://golang.org/dl/
  3. Navigate to the root of the project and run go mod download to download the necessary dependencies.
  4. Make sure buildctl is installed and buildkitd is running.
zbpack

zbpack analyzes your projects, constructs the image recipes, and builds the container image automatically.

  1. Build the binary by running go build -o zbpack ./cmd/zbpack/main.go.
  2. Run the binary with ./zbpack [the directory to analyze and build].

You should see the build plan block and the subsequent build log block. The build plan block shows the metadata and the information (“recipes”) to build an image of this project. The build log block shows the build log of the container image, which is outputted by docker build.

Use -i or --info to show the build plan only.

$ ./zbpack --info ./tests/node-corepack

╔══════════════════════════ Build Plan ═════════════════════════╗
║ provider         │ nodejs                                     ║
║───────────────────────────────────────────────────────────────║
║ startCmd         │ node index.js                              ║
║───────────────────────────────────────────────────────────────║
║ packageManager   │ pnpm                                       ║
║───────────────────────────────────────────────────────────────║
║ framework        │ none                                       ║
║───────────────────────────────────────────────────────────────║
║ nodeVersion      │ 16                                         ║
║───────────────────────────────────────────────────────────────║
║ installCmd       │ pnpm install                               ║
╚═══════════════════════════════════════════════════════════════╝

Get some more usage information by using -h or --help.

Contributing

See CONTRIBUTING.md for more information.

License

zbpack is licensed under the Mozilla Public License 2.0. According to MPL 2.0 (and the summarization of Bing AI), if you want to use, modify or distribute MPL 2.0 software, you have the following rights and obligations:

  • You have the right to use, modify and distribute MPL 2.0 software for any purpose, without paying any fees.
  • You have the obligation to preserve the license notice, copyright notice and disclaimer in MPL 2.0 source code files.
  • You have the obligation to disclose any modifications you make to MPL 2.0 source code files, and to provide them to others under MPL 2.0 or a more permissive license.
  • You have the right to combine MPL 2.0 source code files with source code files under other licenses in a software, but you cannot change the license of MPL 2.0 source code files.
  • You have the right to choose to provide MPL 2.0 source code files to others under another compatible Copyleft license, such as GNU GPL, LGPL or AGPL.

Contributors

Directories

Path Synopsis
cmd
zbpack
Zbpack is a tool to help you build your project as Docker image in one click.
Zbpack is a tool to help you build your project as Docker image in one click.
internal
bun
Package bun generates the Dockerfile for Bun projects.
Package bun generates the Dockerfile for Bun projects.
dart
Package dart provides a Dart packer.
Package dart provides a Dart packer.
deno
Package deno is the planner for Deno projects.
Package deno is the planner for Deno projects.
dockerfile
Package dockerfile is the planner for projects already include Dockerfile.
Package dockerfile is the planner for projects already include Dockerfile.
dotnet
Package dotnet is the planner of Dotnet projects.
Package dotnet is the planner of Dotnet projects.
elixir
Package elixir is the planner of elixir projects.
Package elixir is the planner of elixir projects.
gleam
Package gleam is the packer for Gleam projects.
Package gleam is the packer for Gleam projects.
golang
Package golang is the planner for Golang projects.
Package golang is the planner for Golang projects.
java
Package java is the planner of Java projects.
Package java is the planner of Java projects.
nodejs
Package nodejs generates the Dockerfile for Node.js projects.
Package nodejs generates the Dockerfile for Node.js projects.
nodejs/nextjs
Package nextjs is used to transform build output of Next.js app to the serverless build output format of Zeabur
Package nextjs is used to transform build output of Next.js app to the serverless build output format of Zeabur
nodejs/nuxtjs
Package nuxtjs is used to transform build output of Nuxt.js app to the serverless build output format of Zeabur
Package nuxtjs is used to transform build output of Nuxt.js app to the serverless build output format of Zeabur
nodejs/remix
Package remix is used to transform build output of Remix app to the serverless build output format of Zeabur
Package remix is used to transform build output of Remix app to the serverless build output format of Zeabur
nodejs/waku
Package waku is used to transform build output of Waku app to the serverless build output format of Zeabur
Package waku is used to transform build output of Waku app to the serverless build output format of Zeabur
php
Package php is the planner for PHP projects.
Package php is the planner for PHP projects.
python
Package python is the build planner for Python projects.
Package python is the build planner for Python projects.
ruby
Package ruby is the build planner for Ruby projects.
Package ruby is the build planner for Ruby projects.
rust
Package rust is the build planner for Rust projects.
Package rust is the build planner for Rust projects.
source
Package source is the interface for filesystems.
Package source is the interface for filesystems.
static
Package static is the planner of static files
Package static is the planner of static files
swift
Package swift is the build planner for Swift projects.
Package swift is the build planner for Swift projects.
utils
Package utils is the uncategorized utils for zbpack.
Package utils is the uncategorized utils for zbpack.
zbpack
Package zbpack is internal package, contain the main logic of zbpack command-line interface.
Package zbpack is internal package, contain the main logic of zbpack command-line interface.
pkg
packer
Package packer is the interface definition of packers.
Package packer is the interface definition of packers.
plan
Package plan contains the interface about the build plan and the core plan operations.
Package plan contains the interface about the build plan and the core plan operations.
types
Package types is the type definitions for the build plan in Zbpack.
Package types is the type definitions for the build plan in Zbpack.
zeaburpack
Package zeaburpack is the library of zbpack.
Package zeaburpack is the library of zbpack.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL