Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit e2b6174

Browse files
committed
[integration-test] update Dockerfile for dev and qa
1 parent 5de2f94 commit e2b6174

File tree

7 files changed

+272
-58
lines changed

7 files changed

+272
-58
lines changed

Dockerfile.centos renamed to Dockerfile.dev

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
FROM centos:7.3.1611
22

3+
#This Dockerfile is used for dev hypercli
34
#REF: integration-cli/README.md
45

56
##########################################################################
@@ -42,7 +43,7 @@ RUN ln -s /go/src/github.com/hyperhq/hypercli /go/src/github.com/docker/docker
4243

4344
WORKDIR /go/src/github.com/hyperhq/hypercli
4445
VOLUME ["/go/src/github.com/hyperhq/hypercli"]
45-
ENTRYPOINT ["hack/generate-hyper-conf.sh"]
46+
ENTRYPOINT ["hack/generate-hyper-conf-dev.sh"]
4647

4748

4849
##########################################################################

Dockerfile.qa

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
FROM centos:7.3.1611
2+
3+
#This Dockerfile is used for autotest hypercli
4+
#REF: integration-cli/README.md
5+
6+
##########################################################################
7+
RUN yum install -y\
8+
automake\
9+
gcc\
10+
wget\
11+
time\
12+
git
13+
14+
15+
## Install Go
16+
ENV GO_VERSION 1.7.4
17+
RUN wget http://golangtc.com/static/go/${GO_VERSION}/go${GO_VERSION}.linux-amd64.tar.gz
18+
#RUN wget http://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz
19+
RUN tar -xzf go${GO_VERSION}.linux-amd64.tar.gz -C /usr/local
20+
21+
## Env
22+
ENV PATH /go/bin:/usr/local/go/bin:$PATH
23+
ENV GOPATH /go:/go/src/github.com/hyperhq/hypercli/integration-cli/vendor:/go/src/github.com/hyperhq/hypercli/vendor
24+
25+
ENV HYPER_CONFIG=/root/.hyper
26+
ENV DOCKER_REMOTE_DAEMON=1
27+
ENV DOCKER_CERT_PATH=fixtures/hyper_ssl
28+
ENV DOCKER_TLS_VERIFY=
29+
30+
ENV DOCKER_HOST="tcp://us-west-1.hyper.sh:443"
31+
ENV BRANCH="master"
32+
33+
ENV ACCESS_KEY=
34+
ENV SECRET_KEY=
35+
36+
RUN mkdir -p /go/src/github.com/hyperhq
37+
WORKDIR /go/src/github.com/hyperhq
38+
39+
ADD hack/generate-hyper-conf-qa.sh /generate-hyper-conf-qa.sh
40+
ENTRYPOINT ["/generate-hyper-conf-qa.sh"]
File renamed without changes.

hack/generate-hyper-conf-qa.sh

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
#!/bin/bash
2+
3+
# set default value of DOCKER_HOST and BRANCH
4+
if [[ "$DOCKER_HOST" == "" ]];then
5+
DOCKER_HOST="tcp://us-west-1.hyper.sh:443"
6+
fi
7+
if [[ "$BRANCH" == "" ]];then
8+
BRANCH="master"
9+
fi
10+
11+
12+
if [[ "$@" != "./build.sh" ]];then
13+
#ensure config for hyper cli
14+
mkdir -p ~/.hyper
15+
cat > ~/.hyper/config.json <<EOF
16+
{
17+
"clouds": {
18+
"${DOCKER_HOST}": {
19+
"accesskey": "${ACCESS_KEY}",
20+
"secretkey": "${SECRET_KEY}"
21+
}
22+
}
23+
}
24+
EOF
25+
26+
env
27+
28+
echo "========== config git proxy =========="
29+
if [ "${http_proxy}" != "" ];then
30+
git config --global http.proxy ${http_proxy}
31+
fi
32+
if [ "${https_proxy}" != "" ];then
33+
git config --global https.proxy ${https_proxy}
34+
fi
35+
git config --list | grep proxy
36+
37+
echo "========== Clone hypercli repo =========="
38+
mkdir -p /go/src/github.com/{hyperhq,docker}
39+
cd /go/src/github.com/hyperhq
40+
git clone https://github.com/hyperhq/hypercli.git
41+
42+
echo "========== Build hypercli =========="
43+
cd /go/src/github.com/hyperhq/hypercli
44+
git checkout $BRANCH
45+
if [[ $? -ne 0 ]];then
46+
echo "Branch $BRANCH not exist!"
47+
exit 1
48+
fi
49+
./build.sh
50+
ln -s /go/src/github.com/hyperhq/hypercli /go/src/github.com/docker/docker
51+
ln -s /go/src/github.com/hyperhq/hypercli/hyper/hyper /usr/bin/hyper
52+
echo alias hypercli=\"hyper -H \${DOCKER_HOST}\" >> /root/.bashrc
53+
source /root/.bashrc
54+
55+
echo "##############################################################################################"
56+
echo "## Welcome to integration test env ##"
57+
echo "##############################################################################################"
58+
#show config for hyper cli
59+
echo "Current hyper config: ~/.hyper/config.json"
60+
echo "----------------------------------------------------------------------------------------------"
61+
cat ~/.hyper/config.json \
62+
| sed 's/"secretkey":.*/"secretkey": "******************************"/g' \
63+
| sed 's/"auth":.*/"auth": "******************************"/g'
64+
echo "----------------------------------------------------------------------------------------------"
65+
66+
fi
67+
68+
#execute command
69+
if [[ $# -ne 0 ]];then
70+
cd /go/src/github.com/hyperhq/hypercli/integration-cli && eval $@
71+
if [[ "$@" == "./build.sh" ]];then
72+
#show make result
73+
if [[ $? -eq 0 ]];then
74+
echo "OK:)"
75+
else
76+
echo "Failed:("
77+
fi
78+
fi
79+
fi

integration-cli/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.log
2+
*.bak
3+

0 commit comments

Comments
 (0)