Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
pulsar
提交
0ee1fade
pulsar
项目概览
apache
/
pulsar
通知
129
Star
40
Fork
3
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Wiki
1
Wiki
分析
仓库
DevOps
项目成员
Pages
pulsar
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Pages
分析
分析
仓库分析
DevOps
Wiki
1
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
提交
体验新版 GitCode,发现更多精彩内容 >>
提交
0ee1fade
编写于
7月 18, 2017
作者:
M
Matteo Merli
提交者:
GitHub
7月 18, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Build and publish docker images (#575)
上级
9dae2070
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
123 addition
and
11 deletion
+123
-11
.travis.yml
.travis.yml
+15
-1
docker/build.sh
docker/build.sh
+6
-10
docker/get-version.sh
docker/get-version.sh
+30
-0
docker/publish.sh
docker/publish.sh
+72
-0
未找到文件。
.travis.yml
浏览文件 @
0ee1fade
...
...
@@ -21,6 +21,11 @@ language: java C++ ruby
jdk
:
-
oraclejdk8
sudo
:
required
services
:
-
docker
cache
:
directories
:
-
$HOME/.m2
...
...
@@ -44,7 +49,10 @@ install:
script
:
# Build Java and C++
-
mvn license:check test && sudo bash -x $TRAVIS_BUILD_DIR/pulsar-client-cpp/travis-build.sh $HOME/pulsar-dep $TRAVIS_BUILD_DIR compile
-
mvn license:check test package && sudo bash -x $TRAVIS_BUILD_DIR/pulsar-client-cpp/travis-build.sh $HOME/pulsar-dep $TRAVIS_BUILD_DIR compile
# Build docker images
-
docker/build.sh
# Generate website
-
(cd site && make travis_build)
deploy
:
...
...
@@ -81,3 +89,9 @@ deploy:
on
:
repo
:
apache/incubator-pulsar
branch
:
master
-
provider
:
script
skip_cleanup
:
true
script
:
docker/publish.sh
on
:
tags
:
true
docker/build.sh
浏览文件 @
0ee1fade
...
...
@@ -18,14 +18,10 @@
# under the License.
#
# Get the project version from Maven
pushd
..
>
/dev/null
MVN_VERSION
=
$(
mvn
-q
\
-Dexec
.executable
=
"echo"
\
-Dexec
.args
=
'${project.version}'
\
--non-recursive
\
org.codehaus.mojo:exec-maven-plugin:1.3.1:exec
)
popd
>
/dev/null
ROOT_DIR
=
$(
git rev-parse
--show-toplevel
)
cd
$ROOT_DIR
/docker
MVN_VERSION
=
`
./get-version.sh
`
echo
"Pulsar version:
${
MVN_VERSION
}
"
...
...
@@ -54,14 +50,14 @@ rm pulsar-${MVN_VERSION}-bin.tar.gz
# Build pulsar-grafana image
docker build
-t
pulsar-grafana grafana
docker build
-t
pulsar-grafana
:latest
grafana
if
[
$?
!=
0
]
;
then
echo
"Error: Failed to create Docker image for pulsar-grafana"
exit
1
fi
# Build dashboard docker image
docker build
-t
pulsar-dashboard ../dashboard
docker build
-t
pulsar-dashboard
:latest
../dashboard
if
[
$?
!=
0
]
;
then
echo
"Error: Failed to create Docker image for pulsar-dashboard"
exit
1
...
...
docker/get-version.sh
0 → 100755
浏览文件 @
0ee1fade
#!/bin/bash
#
# 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.
#
ROOT_DIR
=
$(
git rev-parse
--show-toplevel
)
pushd
$ROOT_DIR
>
/dev/null
# Get the project version from the Maven pom.xml
cat
pom.xml | xmllint
--format
-
\
|
sed
"s/xmlns=
\"
.*
\"
//g"
| xmllint
--stream
--pattern
/project/version
--debug
-
\
|
grep
-A
2
"matches pattern"
|
grep
text |
sed
"s/.* [0-9] //g"
popd
>
/dev/null
docker/publish.sh
0 → 100755
浏览文件 @
0ee1fade
#!/bin/bash
#
# 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.
#
ROOT_DIR
=
$(
git rev-parse
--show-toplevel
)
cd
$ROOT_DIR
/docker
# We should only publish images that are made from official and approved releases
# and thus ignore all the release candidates that are just tagged during the release
# process
if
[[
${
TRAVIS_TAG
}
==
*
"candidate"
*
||
${
TRAVIS_TAG
}
==
*
"rc"
*
]]
;
then
echo
"Skipping non-final release tag
${
TRAVIS_TAG
}
"
exit
0
fi
if
[
-z
"
$DOCKER_USER
"
]
;
then
echo
"Docker user in variable
\$
DOCKER_USER was not set. Skipping image publishing"
exit
1
fi
if
[
-z
"
$DOCKER_PASSWORD
"
]
;
then
echo
"Docker password in variable
\$
DOCKER_PASSWORD was not set. Skipping image publishing"
exit
1
fi
DOCKER_ORG
=
"
${
DOCKER_ORG
:-
apachepulsar
}
"
docker login
-u
=
"
$DOCKER_USER
"
-p
=
"
$DOCKER_PASSWORD
"
if
[
$?
-ne
0
]
;
then
echo
"Failed to loging to Docker Hub"
exit
1
fi
MVN_VERSION
=
`
./get-version.sh
`
echo
"Pulsar version:
${
MVN_VERSION
}
"
set
-x
# Fail if any of the subsequent commands fail
set
-e
docker tag pulsar:latest
$DOCKER_ORG
/pulsar:latest
docker tag pulsar-grafana:latest
$DOCKER_ORG
/pulsar-grafana:latest
docker tag pulsar-dashboard:latest
$DOCKER_ORG
/pulsar-dashboard:latest
docker tag pulsar:latest
$DOCKER_ORG
/pulsar:
$MVN_VERSION
docker tag pulsar-grafana:latest
$DOCKER_ORG
/pulsar-grafana:
$MVN_VERSION
docker tag pulsar-dashboard:latest
$DOCKER_ORG
/pulsar-dashboard:
$MVN_VERSION
# Push all images and tags
docker push
$DOCKER_ORG
/pulsar:latest
docker push
$DOCKER_ORG
/pulsar-grafana:latest
docker push
$DOCKER_ORG
/pulsar-dashboard:latest
docker push
$DOCKER_ORG
/pulsar:
$MVN_VERSION
docker push
$DOCKER_ORG
/pulsar-grafana:
$MVN_VERSION
docker push
$DOCKER_ORG
/pulsar-dashboard:
$MVN_VERSION
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录