forked from mikeferguson/buildbot-ros
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart.sh
55 lines (49 loc) · 1.8 KB
/
start.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash#
# add arg
#source $PWD/docker/env.sh
# check OathToken exists
OathToken="./buildbot-ros/secret/OathToken"
if [ -f "$OathToken" ]
then
echo "OathToken exists."
else
mkdir $PWD/buildbot-ros/secret/
touch $PWD/buildbot-ros/secret/OathToken
read -r -p "Please enter your OathToken: " response
if [ -z "$response" ]
then
read -r -p "Please enter your OathToken: " response
else
cat > $OathToken << EOF
$response
EOF
fi
fi
# check gpg key in folder ros-repository-docker
gpgkey_pub="./ros-repository-docker/public.key"
gpgkey_sign="./ros-repository-docker/signing.key"
if [ -f "$gpgkey_pub" ] && [ -f "$gpgkey_sign" ]
then
echo "gpg signing key and public key exists."
else
echo "You missed public key or signing key. Please create your gpg key"
exit 1
fi
#add Signing key to docker-compouse-deb,test,doc,sys
read -r -p "Please enter your Signing Key(gpg): " Signing_key
echo $PWD
python edit-compose.py $PWD/buildbot-ros/docker_components/docker-compose-deb.yaml $Signing_key
#python edit-compose.py ./buildbot-ros/docker-compose/docker-compouse-doc $Signing_key
python edit-compose.py $PWD/buildbot-ros/docker_components/docker-compose-test.yaml $Signing_key
python edit-compose.py $PWD/buildbot-ros/docker_components/docker-compose-sys.yaml $Signing_key
# crate docker image for buildbot master
docker build -f docker/Dockerfile_bb_master -t buildbot-ros:latest --build-arg SSH_KEY="$(cat $HOME/.ssh/id_rsa)" .
# crate docker image for buildbot worker
docker build -f docker/Dockerfile_bb_worker -t buildbot-worker:latest --build-arg SSH_KEY="$(cat $HOME/.ssh/id_rsa)" .
# add arg
source $PWD/docker/env.sh
source $PWD/ros-repository-docker/env.sh
# create local repository image
docker-compose -f ros-repository-docker/docker-compose.yaml build
# start all
docker-compose -f docker/docker-compose.yaml up