Skip to content

fix #587 #621

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .asf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

# NOTE: All configurations could be found here: https://cwiki.apache.org/confluence/display/INFRA/Git+-+.asf.yaml+features
github:
description: "A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Answer."
description: "A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer."
homepage: https://answer.apache.org
labels:
- react
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# specific language governing permissions and limitations
# under the License.

name: "Goreleaser"
name: Build Binary For Release

on:
push:
Expand All @@ -26,7 +26,7 @@ permissions:

jobs:
build-goreleaser:
runs-on: [self-hosted, linux]
runs-on: ubuntu-latest

steps:
- name: Checkout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# specific language governing permissions and limitations
# under the License.

name: Build DockerHub Image
name: Build Docker Image For Release

on:
push:
Expand All @@ -29,7 +29,7 @@ on:

jobs:
build:
runs-on: [self-hosted, linux]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -38,7 +38,7 @@ jobs:
id: meta
uses: docker/metadata-action@v4
with:
images: answerdev/answer
images: apache/answer
tags: |
type=raw,value=latest
type=ref,enable=true,priority=600,prefix=,suffix=,event=branch
Expand All @@ -51,10 +51,10 @@ jobs:
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,16 @@
# specific language governing permissions and limitations
# under the License.

name: Build Dev Image
name: Build Docker Image For Test

on:
push:
branches: [ "test","dev" ]

branches: [ "test" ]

jobs:
build:
name: Build and Push
runs-on: [self-hosted,linux]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -34,24 +33,21 @@ jobs:
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ secrets.IMG_URL }}/${{ secrets.IMG_NAMESPACE }}/answer
images: apache/answer
tags: |
type=raw,value=latest

type=raw,value=test

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to Container Registry
uses: docker/login-action@v2
- name: Login to DockerHub
uses: docker/login-action@v3
with:
registry: ${{ secrets.IMG_URL }}
username: ${{ secrets.IMG_USERNAME }}
password: ${{ secrets.IMG_PASSWORD }}

username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v4
Expand All @@ -62,18 +58,3 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

sync-git:
name: Sync to Git
runs-on: [self-hosted,linux]
needs:
- build
steps:
- name: Sync to Gitlab
uses: aiworklab/git-mirror-action@master
env:
SSH_PRIVATE_KEY: ${{ secrets.GITLAB_RSA_PRIVATE_KEY }}
with:
source-repo: [email protected]:apache/incubator-answer.git
destination-repo: ${{ secrets.GITLAB_REPO }}

Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Check license header
uses: korandoru/hawkeye@v3
81 changes: 0 additions & 81 deletions .github/workflows/manual_build.yml

This file was deleted.

15 changes: 10 additions & 5 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,16 @@ builds:

archives:
- name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
apache-answer-{{ .Version }}-incubating-{{ .Os }}-{{ .Arch }}
files:
- src: "docs/release/LICENSE"
dst: LICENSE
- src: "docs/release/NOTICE"
dst: NOTICE
- src: "docs/release/licenses/*"
dst: licenses/
- src: "DISCLAIMER"
dst: DISCLAIMER
checksum:
name_template: 'checksums.txt'
snapshot:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ LABEL maintainer="[email protected]"

ARG GOPROXY
# ENV GOPROXY ${GOPROXY:-direct}
ENV GOPROXY=https://proxy.golang.com.cn,direct
# ENV GOPROXY=https://proxy.golang.com.cn,direct

ENV GOPATH /go
ENV GOROOT /usr/local/go
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,8 @@ install-ui-packages:
ui:
@cd ui && pnpm pre-install && pnpm build && cd -

lint: generate
@bash ./script/check-asf-header.sh
@gofmt -w -l .

all: clean build
37 changes: 36 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<img alt="logo" src="docs/img/logo.svg" height="99px">
</a>

# Answer - Build Q&A platform
# Apache Answer - Build Q&A platform

A Q&A platform software for teams at any scales. Whether it’s a community forum, help center, or knowledge management platform, you can always count on Answer.

Expand Down Expand Up @@ -36,6 +36,41 @@ We value your feedback and suggestions to improve our documentation. If you have

You can also check out the [plugins here](https://github.com/apache/incubator-answer-plugins).

## Building from Source

### Prerequisites
- Golang >= 1.18
- Node.js >= 16.17
- pnpm >= 8

### Build
```bash
$ make ui
$ make build
```

## Running from source

### Build UI

```bash
make ui
```

### Initialization and Installation

```bash
INSTALL_PORT=9080 go run cmd/answer/main.go --data-path=/data init
```

For more information, see [Installation](https://answer.apache.org/docs/installation)

### Local run

```bash
go run cmd/answer/main.go --data-path=/data run
```

## Contributing

Contributions are always welcome!
Expand Down
35 changes: 35 additions & 0 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,41 @@ docker run -d -p 9080:80 -v answer-data:/data --name answer answerdev/answer:lat

其他安装配置细节请参考 [Installation](https://answer.apache.org/docs/installation)

## 从源码构建

### 环境要求
- Golang >= 1.18
- Node.js >= 16.17
- pnpm >= 8

### 构建
```bash
$ make ui
$ make build
```

## 从源码运行

### 前端构建

```bash
make ui
```

### 系统初始化和安装

```bash
INSTALL_PORT=9080 go run cmd/answer/main.go --data-path=/data init
```

其他安装配置细节请参考 [Installation](https://answer.apache.org/docs/installation)

### 本地运行

```bash
go run cmd/answer/main.go --data-path=/data run
```

## 贡献

我们随时欢迎你的贡献!
Expand Down
7 changes: 0 additions & 7 deletions SECURITY.md

This file was deleted.

19 changes: 18 additions & 1 deletion charts/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
{{/*
Expand the name of the chart.

Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.

*/}}
{{- define "answer.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
Expand Down
Loading