#!/usr/bin/env lk args := os.args version_reg := `[0-9]+\.[0-9]+\.[0-9]+` if #args != 3 { errorf('need version: %s', args) } version := args.2 if !version:match(version_reg).0 { errorf('invalid version format: %s', version) } cmd_parts := { 'docker buildx build', '-t lollipopkit/srvbox_monitor:%s', '-t lollipopkit/srvbox_monitor:latest', '--platform=linux/arm64,linux/amd64', '--build-arg APPVER=%s', '.', '--push', } cmd := fmt(' ':join(cmd_parts), version, version) result, err := os.exec(cmd) if err != nil { errorf('%s:\n%s', err, result) } printf('%sSuccess%s', term.green, term.nocolor)