fernandohackbart / bikeride-lagom

Sample Bike Ride application backend to learn Lagom
Other
4 stars 2 forks source link

Jenkins job to build bikeride images #163

Closed fernandohackbart closed 7 years ago

fernandohackbart commented 7 years ago
export bundleVersion=0.0.1-SNAPSHOT

rm -rf Docker/authentication-lagom-impl/files
rm -rf Docker/biker-lagom-impl/files
rm -rf Docker/track-lagom-impl/files
rm -rf Docker/ride-lagom-impl/files

mkdir -p Docker/authentication-lagom-impl/files
mkdir -p Docker/biker-lagom-impl/files
mkdir -p Docker/track-lagom-impl/files
mkdir -p Docker/ride-lagom-impl/files

unzip -q authentication-lagom-impl/target/universal/authentication-lagom-impl-${bundleVersion}.zip -d Docker/authentication-lagom-impl/files
mv Docker/authentication-lagom-impl/files/authentication-lagom-impl-${bundleVersion} Docker/authentication-lagom-impl/files/authentication-lagom-impl

unzip -q biker-lagom-impl/target/universal/biker-lagom-impl-${bundleVersion}.zip -d Docker/biker-lagom-impl/files
mv Docker/biker-lagom-impl/files/biker-lagom-impl-${bundleVersion} Docker/biker-lagom-impl/files/biker-lagom-impl

unzip -q track-lagom-impl/target/universal/track-lagom-impl-${bundleVersion}.zip -d Docker/track-lagom-impl/files
mv Docker/track-lagom-impl/files/track-lagom-impl-${bundleVersion} Docker/track-lagom-impl/files/track-lagom-impl

unzip -q ride-lagom-impl/target/universal/ride-lagom-impl-${bundleVersion}.zip -d Docker/ride-lagom-impl/files
mv Docker/ride-lagom-impl/files/ride-lagom-impl-${bundleVersion} Docker/ride-lagom-impl/files/ride-lagom-impl

IMAGE_COUNT=`docker images |grep bikeride|grep impl |wc -l`
if [ ${IMAGE_COUNT} -gt 0 ]
then
  docker rmi `docker images |grep bikeride|grep impl |awk '{print $3 " "}' |tr -d '\n'`
fi

docker build -f Docker/authentication-lagom-impl/Dockerfile  -t  bikeride/authentication-lagom-impl:${bundleVersion} Docker/authentication-lagom-impl
docker build -f Docker/biker-lagom-impl/Dockerfile  -t  bikeride/biker-lagom-impl:${bundleVersion} Docker/biker-lagom-impl
docker build -f Docker/track-lagom-impl/Dockerfile  -t  bikeride/track-lagom-impl:${bundleVersion} Docker/track-lagom-impl
docker build -f Docker/ride-lagom-impl/Dockerfile  -t  bikeride/ride-lagom-impl:${bundleVersion} Docker/ride-lagom-impl

#docker login
docker push bikeride/bikeride-backend:base
docker push bikeride/authentication-lagom-impl:${bundleVersion}
docker push bikeride/biker-lagom-impl:${bundleVersion}
docker push bikeride/track-lagom-impl:${bundleVersion}
docker push bikeride/ride-lagom-impl:${bundleVersion}
fernandohackbart commented 7 years ago

Using the pipeline into the project