Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/build-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
- name: Build lake image
run: |
cd devops/lake-builder/
cd devops/docker/lake-builder/
export IMAGE_LAKE=mericodev/lake-builder
export IMAGE_VER=${GITHUB_REF:18}
docker build -t $IMAGE_LAKE:latest --file ./Dockerfile .
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ jobs:
path: golangci-lint
key: ${{ runner.os }}-golangci-lint
- name: generate mock
run: make mock
run: |
cd backend
make mock
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.49.0
args: ""
version: v1.50.1
working-directory: ./backend
10 changes: 6 additions & 4 deletions .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,10 @@ jobs:
DB_URL: mysql://root:root@db:3306/lake?charset=utf8mb4&parseTime=True
E2E_DB_URL: mysql://root:root@db:3306/lake?charset=utf8mb4&parseTime=True
run: |
cp .env.example .env
cp .env.example backend/.env
cd backend
make e2e-test
make e2e-plugins
make e2e-plugins-test
e2e-postgres:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -90,6 +91,7 @@ jobs:
DB_URL: postgres://merico:merico@db:5432/lake
E2E_DB_URL: postgres://merico:merico@db:5432/lake
run: |
cp .env.example .env
cp .env.example backend/.env
cd backend
make e2e-test
make e2e-plugins
make e2e-plugins-test
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,5 @@ jobs:
${{ runner.os }}-go-
- name: Unit tests
run: |
cd backend
make unit-test
12 changes: 6 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ mysql-data/
.docker/

# config files
config/local.js
local.js

# Editors
.idea
Expand Down Expand Up @@ -154,8 +154,8 @@ libgit2
.air.toml

# auto generated code
mocks/
api/docs/swagger.json
api/docs/swagger.yaml
api/docs/docs.go
*.result/
backend/mocks/
backend/server/api/docs/swagger.json
backend/server/api/docs/swagger.yaml
backend/server/api/docs/docs.go
*.result/
72 changes: 0 additions & 72 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,37 +22,6 @@ TAG ?= $(shell git tag --points-at HEAD)
IMAGE_REPO ?= "apache"
VERSION = $(TAG)@$(SHA)

go-dep:
go install github.com/vektra/mockery/v2@latest
go install github.com/swaggo/swag/cmd/swag@v1.8.4
go install github.com/atombender/go-jsonschema/cmd/gojsonschema@latest
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.49.0

python-dep:
pip install -r requirements.txt

dep: go-dep python-dep

swag:
swag init --parseDependency --parseInternal -o ./api/docs -g ./api/api.go -g plugins/*/api/*.go
@echo "visit the swagger document on http://localhost:8080/swagger/index.html"

build-plugin:
@sh scripts/compile-plugins.sh

build-plugin-debug:
@sh scripts/compile-plugins.sh -gcflags='all=-N -l'

build-worker:
go build -ldflags "-X 'github.com/apache/incubator-devlake/version.Version=$(VERSION)'" -o bin/lake-worker ./worker/

build-server: swag
go build -ldflags "-X 'github.com/apache/incubator-devlake/version.Version=$(VERSION)'" -o bin/lake

build: build-plugin build-server

all: build build-worker

build-server-image:
docker build -t $(IMAGE_REPO)/devlake:$(TAG) --build-arg TAG=$(TAG) --build-arg SHA=$(SHA) --file ./Dockerfile .

Expand All @@ -64,10 +33,6 @@ build-grafana-image:

build-images: build-server-image build-config-ui-image build-grafana-image

tap-models:
chmod +x ./scripts/singer-model-generator.sh
@sh scripts/singer-model-generator.sh config/singer/pagerduty.json plugins/pagerduty --all

push-server-image: build-server-image
docker push $(IMAGE_REPO)/devlake:$(TAG)

Expand All @@ -79,17 +44,6 @@ push-grafana-image: build-grafana-image

push-images: push-server-image push-config-ui-image push-grafana-image

run:
go run main.go

worker:
go run worker/*.go

dev: build-plugin run

debug: build-plugin-debug
dlv debug main.go

configure:
docker-compose up config-ui

Expand All @@ -99,31 +53,5 @@ configure-dev:
commit:
git cz

mock:
rm -rf mocks
mockery --dir=./plugins/core --unroll-variadic=false --name='.*'
mockery --dir=./plugins/core/dal --unroll-variadic=false --name='.*'
mockery --dir=./plugins/helper --unroll-variadic=false --name='.*'

test: unit-test e2e-test

unit-test: mock build
set -e; for m in $$(go list ./... | egrep -v 'test|models|e2e'); do echo $$m; go test -timeout 60s -v $$m; done

e2e-test: build
PLUGIN_DIR=$(shell readlink -f bin/plugins) go test -timeout 300s -p 1 -v ./test/...

e2e-plugins:
export ENV_PATH=$(shell readlink -f .env); set -e; for m in $$(go list ./plugins/... | egrep 'e2e'); do echo $$m; go test -timeout 300s -gcflags=all=-l -v $$m; done

lint:
golangci-lint run

fmt:
find . -name \*.go | xargs gofmt -s -w -l

clean:
@rm -rf bin

restart:
docker-compose down; docker-compose up -d
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div align="center">
<br/>
<img src="img/logo.svg" width="120px">
<img src="resources/img/logo.svg" width="120px">
<br/>

# Apache DevLake(Incubating)
Expand Down Expand Up @@ -102,7 +102,7 @@ Please read the [contribution guidelines](https://devlake.apache.org/community)
- <a href="https://join.slack.com/t/devlake-io/shared_invite/zt-18uayb6ut-cHOjiYcBwERQ8VVPZ9cQQw" target="_blank">Slack</a>: Message us on Slack
- <a href="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/apache/incubator-devlake/wiki/FAQ" target="_blank">FAQ</a>: Frequently Asked Questions
- Wechat Community:<br/>
![](img/wechat_community_barcode.png)
![](resources/img/wechat_community_barcode.png)

## 📄 License<a id="license"></a>

Expand Down
155 changes: 0 additions & 155 deletions api/README.md

This file was deleted.

Loading