Skip to content

Commit

Permalink
init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ming535 committed Dec 27, 2018
0 parents commit 2d81331
Show file tree
Hide file tree
Showing 11,740 changed files with 5,087,250 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
8 changes: 8 additions & 0 deletions .dev.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export SOURCE_DB_HOST="127.0.0.1"
export SOURCE_DB_USER="root"
export SOURCE_DB_PORT=3306
export SOURCE_DB_URL="$SOURCE_DB_USER:@tcp($SOURCE_DB_HOST:$SOURCE_DB_PORT)/?loc=Local&interpolateParams=true&readTimeout=30s&parseTime=true&collation=utf8mb4_general_ci"
export TARGET_DB_HOST="127.0.0.1"
export TARGET_DB_USER="root"
export TARGET_DB_PORT=3306
export TARGET_DB_URL="$TARGET_DB_USER:@tcp($TARGET_DB_HOST:$TARGET_DB_PORT)/?loc=Local&interpolateParams=true&readTimeout=30s&parseTime=true&collation=utf8mb4_general_ci"
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.git
3 changes: 3 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DB_HOST=source-db
DB_PORT=3306
DB_USER=root
46 changes: 46 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
.DS_Store
*.out
*.prof
/bin
*/*.iml
cmd/scratch
profile
*.idea
*.meta
config.toml
master_config.toml
*_dev.toml
*_dev.json

gravity/config_dev
nuclear/config_dev
scanner/config_dev

*.log
.schema-store
*.coverprofile

*.retry

test.sh
test.sql
tmp.py

gravity.timestamp.toml
gravity.timestamp.toml.backup

nuclear/configdata/dev.toml
nuclear/configdata/mysql-pb.toml

etc/scripts/mongo_bike/mongo2mysql_*

scripts/set_position.py

default.etcd

gravity_mongo.meta.toml

__pycache__
/deploy/k8s/drc/charts/

k8s_operator/mock_gravity/mock-linux
39 changes: 39 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
before_script:
- export git_branch=$(git rev-parse --abbrev-ref HEAD)
- export git_hash=$(git rev-parse --short HEAD)
- docker image prune -f
- export PS4='\t '
- set -x

after_script:
- set +x

build:
stage: build
variables:
builder_work_dir: /go/src/github.com/moiot/gravity
script:
- docker pull docker.mobike.io/common/golang:1.11.4
- docker build -t golang-builder -f Dockerfile.build .
- docker run --rm -e LOCAL_USER_ID=`id -u $USER` -v `pwd`:$builder_work_dir -w $builder_work_dir golang-builder make build-linux
- docker build -t docker.mobike.io/$CI_PROJECT_PATH/drc:$CI_COMMIT_REF_NAME-$git_hash -f Dockerfile.drc .
- docker push docker.mobike.io/$CI_PROJECT_PATH/drc:$CI_COMMIT_REF_NAME-$git_hash
- docker build -t docker.mobike.io/$CI_PROJECT_PATH/operator:$CI_COMMIT_REF_NAME-$git_hash -f Dockerfile.operator .
- docker push docker.mobike.io/$CI_PROJECT_PATH/operator:$CI_COMMIT_REF_NAME-$git_hash
- docker build -t docker.mobike.io/$CI_PROJECT_PATH/gatekeeper:$CI_COMMIT_REF_NAME-$git_hash -f Dockerfile.gatekeeper .
- docker push docker.mobike.io/$CI_PROJECT_PATH/gatekeeper:$CI_COMMIT_REF_NAME-$git_hash
after_script:
- docker rmi golang-builder
- docker rmi $(docker images --filter=reference="docker.mobike.io/$CI_PROJECT_PATH/*" -q)

test:
stage: build
dependencies: []
script:
- make test
after_script:
- make test-down

stages:
- build
3 changes: 3 additions & 0 deletions .gometalinter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"Enable": ["vet", "staticcheck", "errcheck", "gas", "safesql", "golint", "gosimple", "unconvert", "interfacer", "unused", "ineffassign"]
}
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
language: golang

services:
- docker

script:
- go env
11 changes: 11 additions & 0 deletions Dockerfile.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM docker.mobike.io/common/golang:1.11.4

ADD http://dbtools-1252726293.coscd.myqcloud.com/bin/gosu-amd64 /usr/local/bin/gosu

RUN chmod +x /usr/local/bin/gosu

COPY entrypoint.sh /usr/local/bin/entrypoint.sh

RUN chmod +x /usr/local/bin/entrypoint.sh

ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
11 changes: 11 additions & 0 deletions Dockerfile.gatekeeper
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM frolvlad/alpine-glibc

COPY alpine.repositories /etc/apk/repositories

RUN apk update && apk upgrade && apk add bash && apk add tzdata

RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo "Asia/Shanghai" > /etc/timezone

WORKDIR /

COPY bin/drc-gatekeeper-linux-amd64 /drc-gatekeeper
11 changes: 11 additions & 0 deletions Dockerfile.gravity
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM frolvlad/alpine-glibc

COPY alpine.repositories /etc/apk/repositories

RUN apk update && apk upgrade && apk add bash && apk add tzdata

RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo "Asia/Shanghai" > /etc/timezone

WORKDIR /

COPY bin/gravity-linux-amd64 /gravity
11 changes: 11 additions & 0 deletions Dockerfile.operator
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM frolvlad/alpine-glibc

COPY alpine.repositories /etc/apk/repositories

RUN apk update && apk upgrade && apk add bash && apk add tzdata

RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo "Asia/Shanghai" > /etc/timezone

WORKDIR /

COPY bin/drc-operator-linux-amd64 /drc-operator
15 changes: 15 additions & 0 deletions Dockerfile.prometheus_sd
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM frolvlad/alpine-glibc

COPY alpine.repositories /etc/apk/repositories

RUN apk update && apk upgrade && apk add bash && apk add tzdata

RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

RUN echo "Asia/Shanghai" > /etc/timezone

COPY bin/prometheus_sd-linux-amd64 /prometheus_sd

COPY wait-for-it.sh /wait-for-it.sh

WORKDIR /
7 changes: 7 additions & 0 deletions Dockerfile.test.drc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM docker.mobike.io/common/golang:1.11.4

WORKDIR /go/src/github.com/moiot/gravity

COPY . /go/src/github.com/moiot/gravity

CMD ["make go-test"]
Loading

0 comments on commit 2d81331

Please sign in to comment.