Go to file
2024-11-20 18:38:59 +08:00
cmd [fix] fix bugs on gen-ide-env cmd. 2024-11-20 18:38:59 +08:00
common known executable script file, like .lua/.sh will be chmod to 0755 when upload. 2024-11-19 14:16:40 +08:00
detector init sylixos-uploader. 2024-11-18 17:56:36 +08:00
log better print style. 2024-11-19 12:49:06 +08:00
parser init sylixos-uploader. 2024-11-18 17:56:36 +08:00
pusher known executable script file, like .lua/.sh will be chmod to 0755 when upload. 2024-11-19 14:16:40 +08:00
.gitignore init sylixos-uploader. 2024-11-18 17:56:36 +08:00
build.sh build more platforms, better build.sh. 2024-11-19 13:58:05 +08:00
clean.sh add clean.sh. 2024-11-19 13:14:31 +08:00
go.mod ELF executable or shared object file will be chmod to 0755 when upload. 2024-11-18 19:39:07 +08:00
go.sum ELF executable or shared object file will be chmod to 0755 when upload. 2024-11-18 19:39:07 +08:00
LICENSE add README and LICENSE. 2024-11-19 14:47:53 +08:00
main.go init sylixos-uploader. 2024-11-18 17:56:36 +08:00
README.md [feature] add gen-ide-env cmd. 2024-11-20 17:52:51 +08:00

SylixOS Uploader

SylixOS Uploader is a command-line tool designed for uploading SylixOS projects via CORBA. It simplifies the process of transferring files to remote devices, setting appropriate permissions, and generating configuration YAML files for project uploads.

Features

  1. File Uploads:

    • Upload project files to remote devices using FTP.
    • Automatically set permissions (chmod 0755) for:
      • ELF executables or shared object files.
      • Known executable scripts (e.g., .sh, .py, .lua, etc.).
  2. YAML Generation:

    • Generate structured YAML configuration files for SylixOS projects, ensuring easier management and deployment.
  3. Generate-Ide-Env-Example:

    • Generate environment variables on linux from IDE projects.
  4. Versioning:

    • Injects Git version information into the build, including the latest tag, commit hash, and dirty state (if there are uncommitted changes).
  5. Flexible Build Options:

    • Default: Build only for the local platform.
    • Optionally: Cross-compile for multiple platforms (Linux, Windows, macOS, SylixOS).
    • Supports installation to a specified directory.

Usage

Upload Example

sylixos-uploader upload --path ~/sylixos-workspace/base-project --device 10.13.16.250 --method ftp

Generate YAML Example

sylixos-uploader gen-yaml --path ~/sylixos-workspace/base-project

Generate IDE ENV Example

source <(sylixos-uploader gen-ide-env --workspace ~/sylixos-workspace)

YAML File Example

base-settings:
    project-name: app_test
    project-type: SylixOSAppProject
    $(ProjectPath): /home/user/sylixos-workspace/app_test
    $(Output): Release
remote-settings:
    ipaddr: 10.7.130.102
    work-path: /apps/app_test
    protocol: ftp
upload-pair:
    - local-path: $(ProjectPath)/$(Output)/strip
      remote-path: /usr/bin

Building SylixOS Uploader

Requirements

  • Golang installed and configured with GOOS=sylixos support.
  • Git available in the environment.

Build Script

Use the build.sh script to compile the tool. The script determines the version based on Git tags and the latest commit, providing flexible options.

Script Options

  • --all: Build for all supported platforms (Linux, Windows, macOS, SylixOS).
  • --install-dir <dir>: Install the binary to the specified directory.

Examples

Build for the local platform

./build.sh

Build for all platforms

./build.sh --all

Build local platform and Install to a directory

./build.sh --install-dir /usr/local/bin

Supported Platforms

  • Linux:

    • amd64
    • arm64
  • Windows:

    • amd64
    • arm64
  • macOS:

    • amd64
    • arm64
  • SylixOS:

    • arm64

Known Issues

  1. Currently, only FTP is supported for uploads.

Known Behaviors

  1. Uploads projects to the specified remote device.
  2. On the remote device:
    • ELF executables or shared objects are set to chmod 0755.
    • Known executable scripts are set to chmod 0755.
  3. Generates a YAML file from the actual SylixOS project.

Contributing

Feel free to submit pull requests or report issues on the projects repository. Ensure that your code adheres to the project guidelines and includes relevant tests.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

For any issues, questions, or feature requests, reach out to the maintainers via Gitea.