swift/docker/rootfs/etc/swift_build/build_remakerings
Thiago da Silva 37e257913c Add Dockerfile to build a SAIO container image
Added Dockerfile and configuration files under the
new `docker` directory to build a Swift All in One container
image.

The primary goal of this container image is to provide
application developers with a Swift/S3 endpoint that can be
tested against during the development cycle.

Added Zuul jobs to build docker container

Change-Id: Ib10975a1862a4fa8c4eeaba139837cf1f22b272a
2019-05-07 15:44:00 -04:00

37 lines
1.5 KiB
Plaintext
Executable File

#!/usr/bin/with-contenv sh
POLICIES="object container account"
for p in $POLICIES; do
echo "swift-ring-builder $p.builder create 10 1 1" > /etc/swift/remakerings.$p;
echo "started /etc/swift/remakerings.$p with 'swift-ring-build create'"
done
for drive in `ls /srv/node/ | grep 'swift-d'`; do
echo "swift-ring-builder object.builder add r1z1-127.0.0.1:6000/$drive 1" >> /etc/swift/remakerings.object
echo "pushed command to add r1z1-127.0.0.1:6000/$drive to /etc/swift/remakerings.object"
echo "swift-ring-builder container.builder add r1z1-127.0.0.1:6001/$drive 1" >> /etc/swift/remakerings.container
echo "pushed command to add r1z1-127.0.0.1:6001/$drive to /etc/swift/remakerings.container"
echo "swift-ring-builder account.builder add r1z1-127.0.0.1:6002/$drive 1" >> /etc/swift/remakerings.account
echo "pushed command to add r1z1-127.0.0.1:6002/$drive to /etc/swift/remakerings.account"
done
for p in $POLICIES; do
echo "swift-ring-builder $p.builder rebalance" >> /etc/swift/remakerings.$p;
echo "pushed command to rebalance ring into /etc/swift/remakerings.$p"
done
echo "rm -f *.builder *.ring.gz backups/*.builder backups/*.ring.gz" > /etc/swift/remakerings
echo "created umbrella /etc/swift/remakerings, with deleting all ring files"
for p in $POLICIES; do
cat /etc/swift/remakerings.$p >> /etc/swift/remakerings;
echo "pushed /etc/swift/remakerings.$p to /etc/swift/remakerings"
rm -f /etc/swift/remakerings.$p;
echo "deleted /etc/swift/remakerings.$p"
done
chmod +x /etc/swift/remakerings
echo "made remaketings executable (+x)"