-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
205 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: deploy-docker | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
jobs: | ||
build: | ||
runs-on: self-hosted | ||
steps: | ||
- name: docker login | ||
run: | | ||
docker login -u ${{ secrets.name }} -p ${{ secrets.pass }} | ||
- name: deploy docker | ||
run: | | ||
echo $GITHUB_SHA | ||
tag=$(git describe --tags $(git rev-list --tags --max-count=1) --abbrev=0 --always) | ||
echo $tag | ||
git clone https://github.com/TarsCloud/TarsDocker | ||
cd TarsDocker/framework | ||
./build-docker.sh $tag |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: test-pull-request | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- release/* | ||
jobs: | ||
build: | ||
runs-on: self-hosted | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: init submodules | ||
run: | | ||
git submodule init tarscpp | ||
git submodule update | ||
cd tarscpp | ||
git submodule init unittest servant/protocol | ||
git submodule update | ||
cd .. | ||
- name: test framework | ||
run: | | ||
echo "Pull request's base branch is: ${{ github.base_ref }}" | ||
BASE_BRANCH=${{ github.base_ref }} | ||
echo $GITHUB_SHA | ||
echo $GITHUB_REF | ||
echo $BASE_BRANCH > /tmp/$GITHUB_SHA | ||
release=$(sed "s/release\///g" /tmp/$GITHUB_SHA) | ||
cp test/Dockerfile ../ | ||
cd .. | ||
rm -rf TarsWeb | ||
git clone --branch $BASE_BRANCH https://github.com/TarsCloud/TarsWeb | ||
cd TarsWeb | ||
webLatestTag=$(git describe --tags `git rev-list --tags --max-count=1` --abbrev=0 --always) | ||
git checkout $webLatestTag | ||
cd .. | ||
docker build . --file Dockerfile --tag tarscloud/framework:$release | ||
rm -rf TarsDemo | ||
git clone https://github.com/TarsCloud/TarsDemo | ||
cd TarsDemo | ||
./autorun.sh $release latest false false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: test-release | ||
|
||
on: | ||
push: | ||
branches: | ||
- release/* | ||
jobs: | ||
build: | ||
runs-on: self-hosted | ||
steps: | ||
- name: test release | ||
run: | | ||
echo $GITHUB_SHA | ||
echo $GITHUB_REF | ||
echo $GITHUB_REF > /tmp/$GITHUB_SHA | ||
release=$(sed "s/refs\/heads\/release\///g" /tmp/$GITHUB_SHA) | ||
echo $release | ||
rm -rf TarsDocker | ||
git clone https://github.com/TarsCloud/TarsDocker | ||
cd TarsDocker/framework | ||
./test-release.sh $release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,6 +102,8 @@ class QueryImp: public QueryF | |
//数据库操作 | ||
CDbHandle _db; | ||
|
||
bool _openDayLog = false; | ||
|
||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# pull source and build docker auto in docker hub | ||
FROM centos/systemd | ||
|
||
WORKDIR /root/ | ||
|
||
ENV TARS_INSTALL /usr/local/tars/cpp/deploy | ||
|
||
COPY "./TarsFramework" /tmp/Tars/framework | ||
COPY "./TarsWeb" /tmp/Tars/web | ||
|
||
# RUN rpm -ivh https://repo.mysql.com/mysql57-community-release-el7.rpm | ||
RUN yum makecache fast \ | ||
&& yum install -y yum-utils psmisc file which net-tools wget unzip telnet git gcc gcc-c++ make glibc-devel flex bison ncurses-devel protobuf-devel zlib-devel openssl-devel \ | ||
# Install cmake | ||
&& mkdir -p /tmp/cmake/ \ | ||
&& cd /tmp/cmake \ | ||
&& wget https://tars-thirdpart-1300910346.cos.ap-guangzhou.myqcloud.com/src/cmake-3.16.4.tar.gz \ | ||
&& tar xzf cmake-3.16.4.tar.gz \ | ||
&& cd cmake-3.16.4 \ | ||
&& ./configure \ | ||
&& make && make install \ | ||
# Install Tars framework | ||
&& mkdir -p /tmp/Tars \ | ||
&& cd /tmp/Tars \ | ||
&& mkdir -p /data \ | ||
&& chmod u+x /tmp/Tars/framework/build/build.sh \ | ||
&& cd /tmp/Tars/framework/build/ \ | ||
&& ./build.sh all \ | ||
&& ./build.sh install \ | ||
&& cp -rf /tmp/Tars/web /usr/local/tars/cpp/deploy/ \ | ||
&& cd /tmp \ | ||
# Install node environment | ||
&& wget https://github.com/nvm-sh/nvm/archive/v0.35.1.zip \ | ||
&& unzip v0.35.1.zip \ | ||
&& cp -rf /tmp/nvm-0.35.1 /root/.nvm \ | ||
&& echo ". /root/.nvm/nvm.sh" >> /root/.bashrc \ | ||
&& echo ". /root/.nvm/bash_completion" >> /root/.bashrc \ | ||
&& source /root/.bashrc \ | ||
&& nvm install v12.13.0 \ | ||
&& npm install -g npm pm2 \ | ||
&& source $HOME/.bashrc \ | ||
# Clean build dependents | ||
&& rm -rf /tmp/* \ | ||
&& yum remove -y yum-utils unzip git glibc-devel ncurses-devel protobuf-devel zlib-devel openssl-devel \ | ||
&& yum autoremove -y \ | ||
&& yum clean all \ | ||
&& rm -rf /var/cache/yum \ | ||
&& ${TARS_INSTALL}/tar-server.sh | ||
|
||
ENTRYPOINT [ "/usr/local/tars/cpp/deploy/docker-init.sh" ] | ||
|
||
EXPOSE 3000 | ||
EXPOSE 3001 |