baxtian/bitbucket-upload-file 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

baxtian/bitbucket-upload-file

最新稳定版本:0.1.6

Composer 安装命令:

composer require baxtian/bitbucket-upload-file

包简介

Upload released files to bictbucket

README 文档

README

Create an archive and update it to bitbucket.

This library allows to upload an archive to the downloads directory in Bitbucket.

Access token

To use Bitbucket API you have to create an access token with write permissions.

  1. Go to the Repository settings in the left menu.
  2. Look for the item Access tokens inside the section labeled Security.
  3. Create a new Access token with permisions to write in the Repository.
  4. Copy the access token.

Set the environment

At root of your project create or modify the .env and add these fields:

WORKSPACE=your-bitbucket-name
PACKAGE=package-name
ACCESS_TOKEN=xxxxxxxx

Workspace and Package are parte of the URL to your Bitbucket repository. https://bitbucket.org/{workspace}/{package}/src/master/

How to use with composer

Install the library

Run the next command

composer install baxtian/bitbucket-upload-file

Add to the composer.json file the scripts and archive elements.

{
	.
	.
	.
	"scripts": {
		.
		.
		.
		"dist": "composer archive --format=zip",
		"release": [
			"@dist",
			"BitbucketUploadFile\\App::archive"
		]
	},
	"archive": {
		"exclude": [
			"/.vscode/",
			"/.env",
			"/.env.example",
			"/vendor/",
			".gitignore",
			"composer.*",
			"README.md",
			"*.zip"
		]
	}
	.
	.
	.
}

Pay attention to the archive section in composer.json. Read the documentation to understand how to add or remove elements to the archive.

How to use this?

run this command to create your archive

composer dist

run this command to upload your archive

composer release

NPM

Install the library

Run the next command

npm install bitbucket-upload-file

Add to the package.json file the scripts.

{
	.
	.
	.
	"scripts": {
		.
		.
		.
		"build": "your own build command",
		"dist": "npm run build && node node_modules/bitbucket-upload-file/scripts/archive.js",
		"release": "npm run dist && node node_modules/bitbucket-upload-file/scripts/upload.js"
	},
	.
	.
	.
}

Additionall fields in environment

Add to the .env file the next information:

DIST_DIR=dist

DistDir is the directory where the version to be distributed will be created, so the file will have the files in this directory.

How to use this?

run this command to create your archive

composer dist

run this command to upload your archive

composer release

统计信息

  • 总下载量: 67
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2023-09-22