Skip to content

Commit 4a557dd

Browse files
committed
Merge branch 'develop' of github.com:FlowCI/flow-platform
2 parents 1653f92 + d1f8d76 commit 4a557dd

File tree

158 files changed

+5026
-1396
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

158 files changed

+5026
-1396
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
velocity.log
12
.idea/
23
*.iml
34
.DS_Store
45
deploy.sh
56
api-doc/
67

8+
velocity.log*
9+
710
node_modules/
811
apidoc/
912
dist/

Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ ENV MVN_CACHE=/root/.m2
1616
ADD ./docker/mysqld.cnf /etc/mysql/conf.d/mysqld.cnf
1717
VOLUME /var/lib/mysql
1818

19+
# mount docker
20+
# docker in docker volume map happens some error
21+
# VOLUME /var/lib/docker
22+
COPY ./docker/daemon.json /etc/docker/daemon.json
23+
1924
# config tomcat
2025
COPY ./docker/tomcat-users.xml $CATALINA_HOME/conf
2126

@@ -33,6 +38,13 @@ RUN cd $FLOW_PLATFORM_SOURCE_CODE \
3338
&& rm -rf $FLOW_PLATFORM_SOURCE_CODE \
3439
&& rm -rf $MVN_CACHE
3540

41+
42+
# add aliyun proxy
43+
ADD ./docker/settings.xml /root/.m2/
44+
45+
# cache mvn package
46+
VOLUME /root/.m2/repository
47+
3648
# setup flow.ci default configuration
3749
COPY ./docker/app-cc.properties $FLOW_PLATFORM_CONFIG_DIR
3850
COPY ./docker/app-api.properties $FLOW_PLATFORM_CONFIG_DIR

config/app-api.properties

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,17 @@ api.zone.default = default
2323
api.user.expire = 86400000
2424

2525
### domain ###
26-
domain.api = http://localhost:8080
27-
domain.web = http://localhost:3000
28-
domain.cc = http://localhost:8080
26+
domain.api = http://api_domain:8080/flow-api
27+
domain.web = http://web_domain:3000
28+
domain.cc = http://api_doamin:8080/flow-control-center
2929

3030
system.email = [email protected]
3131
system.username = admin
3232
system.password = 123456
3333

34+
## flowci started success tip
35+
jfiglet.message = FlowCi Started Success
36+
3437
## plugin repos url
3538
plugins.repository = https://raw.githubusercontent.com/flowci/plugins/master/repository.json
3639

config/app-cc.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ queue.cmd.idle_agent.timeout = 30
3838
queue.cmd.idle_agent.period = 5
3939

4040
### agent config ###
41-
agent.config.ws = ws://localhost:8088
42-
agent.config.cc = http://localhost:8080
41+
agent.config.ws = ws://api_domain:8080/flow-api
42+
agent.config.cc = http://api_domain:8080/flow-control-center
4343

4444
### task toggles ###
4545
task.zone.toggle.keep_idle_agent = false

docker/app-api.properties

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,15 @@ system.email = ${FLOW_SYS_EMAIL}
3131
system.username = ${FLOW_SYS_USERNAME}
3232
system.password = ${FLOW_SYS_PASSWORD}
3333

34+
35+
## flowci started success tip
36+
jfiglet.message = FlowCi Started Success
37+
3438
## plugin repos url
3539
plugins.repository = https://raw.githubusercontent.com/flowci/plugins/master/repository.json
3640

41+
api.run.indocker = true
42+
3743
task.job.toggle.execution_timeout = true
3844
## 6s expire job
3945
task.job.toggle.execution_create_session_duration = 1800

docker/app-cc.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ hibernate.hbm2ddl.auto = validate
1616
cc.workspace = ${HOME}/flow-ci/flow-control-center
1717

1818
### zookeeper config ###
19-
zk.server.embedded = true
20-
zk.host = ${FLOW_API_DOMAIN}:2181
19+
zk.server.embedded = ${FLOW_ZOOKEEPER_EMBEDDED}
20+
zk.host = ${FLOW_ZOOKEEPER_HOST}:${FLOW_ZOOKEEPER_PORT}
2121
zk.timeout = 30
2222
zk.node.root = flow-agents
2323

docker/daemon.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"registry-mirrors": ["https://registry.docker-cn.com"],
3+
"storage-driver": "vfs"
4+
}

docker/flow-platform-base-dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,9 @@ RUN curl -fsSL http://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binar
2525
&& mv /usr/share/apache-maven-$MAVEN_VERSION /usr/share/maven \
2626
&& ln -s /usr/share/maven/bin/mvn /usr/bin/mvn
2727

28+
# install docker and start docker
29+
RUN curl -fsSL get.docker.com -o get-docker.sh \
30+
&& sh get-docker.sh
31+
2832
# install mysql
2933
RUN apt-get install -y mysql-server

docker/flow.ci.backend.cmd.sh

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,29 @@ fi
1111

1212
# set mysql host, default 127.0.0.1
1313
if [[ ! -n $MYSQL_HOST ]]; then
14-
export $MYSQL_HOST=127.0.0.1
14+
export MYSQL_HOST=127.0.0.1
1515
fi
1616

17+
# set default port, default is 2181
18+
if [[ ! -n $FLOW_ZOOKEEPER_PORT ]]; then
19+
export FLOW_ZOOKEEPER_PORT=2181
20+
fi
21+
22+
# set zookeeper is embedded or not, default is true
23+
if [[ ! -n $FLOW_ZOOKEEPER_EMBEDDED ]]; then
24+
export FLOW_ZOOKEEPER_EMBEDDED=true
25+
fi
26+
27+
if [[ $FLOW_ZOOKEEPER_EMBEDDED = "true" ]]; then
28+
export FLOW_ZOOKEEPER_HOST=$FLOW_API_DOMAIN
29+
else
30+
if [[ ! -n $FLOW_ZOOKEEPER_HOST ]]; then
31+
echo "Because you select auto define zookeeper, Please set FLOW_ZOOKEEPER_HOST"
32+
exit 1;
33+
fi
34+
fi
35+
36+
1737
# set default port, default is 8080
1838
if [[ ! -n $PORT ]]; then
1939
export PORT=8080
@@ -80,6 +100,8 @@ echo "running migration"
80100
/flyway/flyway -user=$MYSQL_USER -password=$MYSQL_PASSWORD -ignoreMissingMigrations=true -baselineOnMigrate=true -baselineVersion=1.0 -locations=filesystem:$MIGRATION_PATH/cc -url=jdbc:mysql://$MYSQL_HOST:3306/flow_cc_db migrate
81101
echo "finish migration"
82102

103+
# start docker
104+
service docker start
83105

84106
# Four: everything ready, to run tomcat
85107
exec $cmd
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#
2+
# Plguin Base Dockerfile
3+
# Image Name: flowci/plugin-environment
4+
#
5+
# https://github.com/FlowCI/flow-platform
6+
#
7+
FROM maven:3.5-jdk-8
8+
9+
ADD settings.xml /root/.m2/
10+
11+
# cache mvn package
12+
VOLUME /root/.m2/repository
13+

0 commit comments

Comments
 (0)