Skip to content

Commit

Permalink
Update the installer
Browse files Browse the repository at this point in the history
Update the installer to provide the option of building from
the locally checked out source/build.

Also update to use the new/shortened binary name (cdd).
  • Loading branch information
John Griffith committed Mar 6, 2018
1 parent 5d16fd0 commit 0a72031
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 13 deletions.
24 changes: 19 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,32 @@ with containers.
## Install

### Build From Source
Obviously you'll need to have a golang dev environment setup, one piece of that
includes the golang dep tool. You can find install instructions and usage info
here: https://github.com/golang/dep

For the most part just installing the tool is good enough, the Makefile will
take care of it's usage for you.

```shell
git clone https://github.com/j-griffith/cinder-docker-driver
cd cinder-docker-driver
go build
make clean; make
sudo ./install.sh
```

NOTE the specification of the `source` argument to the install script, this
will result in the install script copying your locally built binary
(```./_bin/cdd```) into the install directory and creating the systemd file.

Omitting the `source` arg (or providing any other argument) will instruct the
installer to pull the latest release from github and installing it instead.

### Just the bits
Use curl to download and run the install script in the package Github repo::

```shell
curl -sSl https://raw.githubusercontent.com/j-griffith/cinder-docker-driver/master/install.sh | sh
curl -sSl https://raw.githubusercontent.com/j-griffith/cinder-docker-driver/master/install.sh | sudo sh
```
## Configuration options
Example config.json file:
Expand All @@ -44,8 +58,8 @@ it in your config file. Here's an example of a V3 config:
"Username": "Fred",
"Password": "FredsPassWord",
"TenantID": "979ddb6183834b9993954ca6de518c5a",
"DomainName": "MyAuthDomain",
"Region": "RegionOne"
"DomainName": "MyAuthDomain",
}
```

Expand Down Expand Up @@ -85,14 +99,14 @@ Example config with additional options:
If you want to just launch the driver daemon as root (or sudo):

```shell
sudo cinder-docker-driver >> /var/log/cdd.out 2>&1 &'
sudo ./_bin/cdd >> /var/log/cdd.out 2>&1 &'
sudo service docker restart
```
## Using systemd
The install script includes creation of a systemd service file.
If you used the install script you can just add your config file
and use ```service cinder-docker-driver start```.
and use ```service cdd start```.
Otherwise, you can inspect the install.sh script and create/setup
your own systemd service file.
Expand Down
6 changes: 3 additions & 3 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"Endpoint": "http://172.16.140.245:5000/v2.0",
"Endpoint": "http://10.117.36.27/identity/v3",
"Username": "admin",
"Password": "solidfire",
"TenantID": "092eb256b5b9402abe57d59f58ae3dbc",
"Password": "nomoresecret",
"TenantID": "f90c6e1559594a198f2a8c9228002bcf",
"Region": "RegionOne"
}
19 changes: 14 additions & 5 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,25 @@ set -e
# or
# 'wget -qO- https://raw.githubusercontent.com/j-griffith/cinder-docker-driver/master/install.sh | sh'

BIN_NAME=cinder-docker-driver
DRIVER_URL="https://github.com/j-griffith/cinder-docker-driver/releases/download/v0.12/cinder-docker-driver"
VERSION=${1:-release}
BIN_NAME=cdd
DRIVER_URL="https://github.com/j-griffith/cinder-docker-driver/releases/download/v0.13/cinder-docker-driver"
SRC_BIN=./_bin/cdd
BIN_DIR="/usr/bin"

do_install() {
mkdir -p /var/lib/cinder/dockerdriver
mkdir -p /var/lib/cinder/mount
rm $BIN_DIR/$BIN_NAME || true
curl -sSL -o $BIN_DIR/$BIN_NAME $DRIVER_URL
chmod +x $BIN_DIR/$BIN_NAME
echo "Version is: ${VERSION}"
if [ "${VERSION}" = 'source' ]; then
cp ./_bin/cdd $BIN_DIR/$BIN_NAME
else
echo "Installing release from github repo..."
curl -sSL -o $BIN_DIR/$BIN_NAME $DRIVER_URL
chmod +x $BIN_DIR/$BIN_NAME
fi

echo "
[Unit]
Description=\"Cinder Docker Plugin daemon\"
Expand All @@ -25,7 +34,7 @@ Requires=cinder-docker-driver.service
[Service]
TimeoutStartSec=0
ExecStart=/usr/bin/cinder-docker-driver &
ExecStart=/usr/bin/cdd &
[Install]
WantedBy=docker.service" >/etc/systemd/system/cinder-docker-driver.service
Expand Down

0 comments on commit 0a72031

Please sign in to comment.