gitea publish bugfix

This commit is contained in:
xiaoqi.cxq 2023-09-08 14:40:22 +08:00
parent 12e4befa96
commit 2092045b7f
4 changed files with 48 additions and 16 deletions

View File

@ -1,8 +1,37 @@
docker build -t mafgwo/stackedit .
docker tag mafgwo/stackedit mafgwo/stackedit:$1 .
docker tag mafgwo/stackedit registry.cn-hangzhou.aliyuncs.com/mafgwo/stackedit
docker tag mafgwo/stackedit registry.cn-hangzhou.aliyuncs.com/mafgwo/stackedit:$1
docker push mafgwo/stackedit
docker push registry.cn-hangzhou.aliyuncs.com/mafgwo/stackedit
docker push mafgwo/stackedit:$1
docker push registry.cn-hangzhou.aliyuncs.com/mafgwo/stackedit:$1
#!/bin/bash
# 检查参数是否提供版本号
if [ -z "$1" ]; then
echo "请提供版本号作为参数"
exit 1
fi
# 定义版本号变量
VERSION="$1"
IMAGE_NAME="mafgwo/stackedit"
# 构建 Docker 镜像
build_image() {
docker build -t "$IMAGE_NAME" .
}
# 标记 Docker 镜像
tag_image() {
docker tag "$IMAGE_NAME" "$IMAGE_NAME:$VERSION"
docker tag "$IMAGE_NAME" "registry.cn-hangzhou.aliyuncs.com/$IMAGE_NAME:$VERSION"
}
# 推送 Docker 镜像
push_image() {
docker push "$IMAGE_NAME"
docker push "registry.cn-hangzhou.aliyuncs.com/$IMAGE_NAME"
docker push "$IMAGE_NAME:$VERSION"
docker push "registry.cn-hangzhou.aliyuncs.com/$IMAGE_NAME:$VERSION"
}
# 执行构建、标记和推送
build_image
tag_image
push_image
echo "操作完成"

View File

@ -2,9 +2,12 @@
<modal-inner aria-label="提交信息">
<p>自定义 <b>{{ config.name }}</b> 提交信息</p>
<div class="modal__content">
<form-entry label="提交信息">
<div class="form-entry">
<label class="form-entry__label">提交信息</label>
<div class="form-entry__field">
<input slot="field" class="textfield" placeholder="提交信息非必填" type="text" v-model.trim="commitMessage" @keydown.enter="resolve()">
</form-entry>
</div>
</div>
</div>
<div class="modal__button-bar">
<button class="button" @click="config.reject()">取消</button>

View File

@ -4,7 +4,7 @@
<div class="modal__image">
<icon-provider provider-id="gitea"></icon-provider>
</div>
<p>向您的<b> Gitea </b>项目发布<b> {{CurrentFileName}} </b></p>
<p>向您的<b> Gitea </b>项目发布<b> {{ currentFileName }} </b></p>
<form-entry label="Project URL" error="projectUrl">
<input slot="field" class="textfield" type="text" v-model.trim="projectUrl" @keydown.enter="resolve()">
<div class="form-entry__info">

View File

@ -36,7 +36,7 @@ export default new Provider({
async uploadContent(token, content, syncLocation) {
const updatedSyncLocation = {
...syncLocation,
projectId: await giteaHelper.getProjectId(syncLocation),
projectId: await giteaHelper.getProjectId(token, syncLocation),
};
if (!savedSha[updatedSyncLocation.id]) {
try {
@ -59,7 +59,7 @@ export default new Provider({
async publish(token, html, metadata, publishLocation, commitMessage) {
const updatedPublishLocation = {
...publishLocation,
projectId: await giteaHelper.getProjectId(publishLocation),
projectId: await giteaHelper.getProjectId(token, publishLocation),
};
try {
// Get the last sha
@ -81,7 +81,7 @@ export default new Provider({
async openFile(token, syncLocation) {
const updatedSyncLocation = {
...syncLocation,
projectId: await giteaHelper.getProjectId(syncLocation),
projectId: await giteaHelper.getProjectId(token, syncLocation),
};
// Check if the file exists and open it