mirror of
https://gitee.com/mafgwo/stackedit
synced 2024-11-15 19:22:27 +08:00
gitea publish bugfix
This commit is contained in:
parent
12e4befa96
commit
2092045b7f
45
build.sh
45
build.sh
|
@ -1,8 +1,37 @@
|
||||||
docker build -t mafgwo/stackedit .
|
#!/bin/bash
|
||||||
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
|
if [ -z "$1" ]; then
|
||||||
docker push mafgwo/stackedit
|
echo "请提供版本号作为参数"
|
||||||
docker push registry.cn-hangzhou.aliyuncs.com/mafgwo/stackedit
|
exit 1
|
||||||
docker push mafgwo/stackedit:$1
|
fi
|
||||||
docker push registry.cn-hangzhou.aliyuncs.com/mafgwo/stackedit:$1
|
|
||||||
|
# 定义版本号变量
|
||||||
|
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 "操作完成"
|
|
@ -2,9 +2,12 @@
|
||||||
<modal-inner aria-label="提交信息">
|
<modal-inner aria-label="提交信息">
|
||||||
<p>自定义 <b>{{ config.name }}</b> 提交信息。</p>
|
<p>自定义 <b>{{ config.name }}</b> 提交信息。</p>
|
||||||
<div class="modal__content">
|
<div class="modal__content">
|
||||||
<form-entry label="提交信息">
|
<div class="form-entry">
|
||||||
<input slot="field" class="textfield" placeholder="提交信息非必填" type="text" v-model.trim="commitMessage" @keydown.enter="resolve()">
|
<label class="form-entry__label">提交信息</label>
|
||||||
</form-entry>
|
<div class="form-entry__field">
|
||||||
|
<input slot="field" class="textfield" placeholder="提交信息非必填" type="text" v-model.trim="commitMessage" @keydown.enter="resolve()">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal__button-bar">
|
<div class="modal__button-bar">
|
||||||
<button class="button" @click="config.reject()">取消</button>
|
<button class="button" @click="config.reject()">取消</button>
|
||||||
|
|
|
@ -4,11 +4,11 @@
|
||||||
<div class="modal__image">
|
<div class="modal__image">
|
||||||
<icon-provider provider-id="gitea"></icon-provider>
|
<icon-provider provider-id="gitea"></icon-provider>
|
||||||
</div>
|
</div>
|
||||||
<p>向您的<b> Gitea </b>项目发布<b> {{CurrentFileName}} </b>。</p>
|
<p>向您的<b> Gitea </b>项目发布<b> {{ currentFileName }} </b>。</p>
|
||||||
<form-entry label="Project URL" error="projectUrl">
|
<form-entry label="Project URL" error="projectUrl">
|
||||||
<input slot="field" class="textfield" type="text" v-model.trim="projectUrl" @keydown.enter="resolve()">
|
<input slot="field" class="textfield" type="text" v-model.trim="projectUrl" @keydown.enter="resolve()">
|
||||||
<div class="form-entry__info">
|
<div class="form-entry__info">
|
||||||
<b>例如:</b> {{config.token.serverUrl}}/path/to/project
|
<b>例如:</b> {{ config.token.serverUrl }}/path/to/project
|
||||||
</div>
|
</div>
|
||||||
</form-entry>
|
</form-entry>
|
||||||
<form-entry label="File path" error="path">
|
<form-entry label="File path" error="path">
|
||||||
|
|
|
@ -36,7 +36,7 @@ export default new Provider({
|
||||||
async uploadContent(token, content, syncLocation) {
|
async uploadContent(token, content, syncLocation) {
|
||||||
const updatedSyncLocation = {
|
const updatedSyncLocation = {
|
||||||
...syncLocation,
|
...syncLocation,
|
||||||
projectId: await giteaHelper.getProjectId(syncLocation),
|
projectId: await giteaHelper.getProjectId(token, syncLocation),
|
||||||
};
|
};
|
||||||
if (!savedSha[updatedSyncLocation.id]) {
|
if (!savedSha[updatedSyncLocation.id]) {
|
||||||
try {
|
try {
|
||||||
|
@ -59,7 +59,7 @@ export default new Provider({
|
||||||
async publish(token, html, metadata, publishLocation, commitMessage) {
|
async publish(token, html, metadata, publishLocation, commitMessage) {
|
||||||
const updatedPublishLocation = {
|
const updatedPublishLocation = {
|
||||||
...publishLocation,
|
...publishLocation,
|
||||||
projectId: await giteaHelper.getProjectId(publishLocation),
|
projectId: await giteaHelper.getProjectId(token, publishLocation),
|
||||||
};
|
};
|
||||||
try {
|
try {
|
||||||
// Get the last sha
|
// Get the last sha
|
||||||
|
@ -81,7 +81,7 @@ export default new Provider({
|
||||||
async openFile(token, syncLocation) {
|
async openFile(token, syncLocation) {
|
||||||
const updatedSyncLocation = {
|
const updatedSyncLocation = {
|
||||||
...syncLocation,
|
...syncLocation,
|
||||||
projectId: await giteaHelper.getProjectId(syncLocation),
|
projectId: await giteaHelper.getProjectId(token, syncLocation),
|
||||||
};
|
};
|
||||||
|
|
||||||
// Check if the file exists and open it
|
// Check if the file exists and open it
|
||||||
|
|
Loading…
Reference in New Issue
Block a user