diff --git a/.travis.yml b/.travis.yml index a52daa8417..b1d4f7fd25 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,12 +9,10 @@ go: install: - make bootstrap script: - - make test bin - - ls -la bin/ + - make all - ./buildscripts/test-cov.sh after_success: - bash <(curl -s https://codecov.io/bash) - - make image notifications: email: recipients: @@ -24,12 +22,14 @@ deploy: api_key: secure: na/NPsgDHGGRaWxRSCo5gH3TPrEutNvhEK3q2k99bbW2INe0FZ+FIPeuL9rqV8eCQi8SWJGHNFjFyMRR798RRSn8bdiK0pxJXzYvphUEH2Azzoqr65TaJHpHNTkv1WTK9OtgahT71MbmIx777U6Vd6ylyJyWja+LPhY/z66XOYQmuXR2ds7FRBlAcWg8C0KIFTLYlms5C9RKwLS2jP5C8tlJBQXMDEk7ejR1mKn3R6KQyyHICGKPGhNE+d7iMs0qhhuGIhcDwXl1olChAAITOGyWEmjc2GeUbFALo8OXdQx9qBO7saw75IzyYV/itBjE0RpuM90jKuFzKGiotSyw7Fs0KgrjHC7keuaNMqBWgKl6qoAj2a5VVEBtx8k941hRLs/VpjQ+K8wJJpjlSR8vh906b8e+HL8BKJEifF09fKBTLd0AWy9I3x6TolmRqiamvIHEkup1fZqblhhe2ZLvwuuyfl3t1FTkkon5BASgSqFdBAhR3eAD/LOtrghjaRX7wCZCzKDEaS9QLeu9UbC+bmnaOo60Gaeyp/DN5FLc4cV/vZozroesu+UEtQIrC6VDlFNYfY0V1ETKpfEQ4I8yByDHx/KjMWDyUGd8e5tm0qsD1lW1yVekh5CjQRHpzShkmKvFieeVfqVy/aGB4GrTeWSxcKiN8W0ekcgCRYut6y0= file_glob: true - file: bin/maya-linux_*.zip + file: + - bin/maya/maya-linux_*.zip + - bin/apiserver/maya-apiserver-linux_*.zip skip_cleanup: true - overwrite: true + overwrite: true on: repo: openebs/maya tags: true branches: except: - - /^*-v[0-9]/ + - /^*-v[0-9]/ diff --git a/GNUmakefile b/GNUmakefile index 6caaff7db2..17346aaf64 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -23,16 +23,16 @@ APISERVER=maya-apiserver # Specify the date o build BUILD_DATE = $(shell date +'%Y%m%d%H%M%S') -all: test +all: test mayactl apiserver dev: format - @MAYACTL=${MAYACTL} MAYA_DEV=1 sh -c "'$(PWD)/buildscripts/build.sh'" + @MAYACTL=${MAYACTL} MAYA_DEV=1 sh -c "'$(PWD)/buildscripts/mayactl/build.sh'" -bin: +mayactl: @echo "----------------------------" @echo "--> maya " @echo "----------------------------" - @MAYACTL=${MAYACTL} sh -c "'$(PWD)/buildscripts/build.sh'" + @MAYACTL=${MAYACTL} sh -c "'$(PWD)/buildscripts/mayactl/build.sh'" initialize: bootstrap @@ -86,15 +86,15 @@ bootstrap: go get $$tool; \ done -image: - @cp bin/${MAYACTL} buildscripts/docker/ - @cd buildscripts/docker && sudo docker build -t openebs/maya:ci --build-arg BUILD_DATE=${BUILD_DATE} . - @rm buildscripts/docker/${MAYACTL} - @sh buildscripts/push +maya-image: + @cp bin/maya/${MAYACTL} buildscripts/mayactl/ + @cd buildscripts/mayactl && sudo docker build -t openebs/maya:ci --build-arg BUILD_DATE=${BUILD_DATE} . + @rm buildscripts/mayactl/${MAYACTL} + @sh buildscripts/mayactl/push # You might need to use sudo -install: bin/${MAYACTL} - install -o root -g root -m 0755 ./bin/${MAYACTL} /usr/local/bin/${MAYACTL} +install: bin/maya/${MAYACTL} + install -o root -g root -m 0755 ./bin/maya/${MAYACTL} /usr/local/bin/${MAYACTL} # Use this to build only the maya-agent. maya-agent: @@ -109,15 +109,15 @@ apiserver: # Currently both mayactl & apiserver binaries are pushed into # m-apiserver image. This is going to be decoupled soon. -apiserver-image: bin apiserver +apiserver-image: mayactl apiserver @echo "----------------------------" @echo "--> apiserver image " @echo "----------------------------" @cp bin/apiserver/${APISERVER} buildscripts/apiserver/ - @cp bin/${MAYACTL} buildscripts/apiserver/ + @cp bin/maya/${MAYACTL} buildscripts/apiserver/ @cd buildscripts/apiserver && sudo docker build -t openebs/m-apiserver:ci --build-arg BUILD_DATE=${BUILD_DATE} . @rm buildscripts/apiserver/${APISERVER} @rm buildscripts/apiserver/${MAYACTL} @sh buildscripts/apiserver/push -.PHONY: all bin cov integ test vet maya-agent test-nodep apiserver apiserver-image +.PHONY: all bin cov integ test vet maya-agent test-nodep apiserver apiserver-image maya-image diff --git a/buildscripts/apiserver/build.sh b/buildscripts/apiserver/build.sh index 9da07b7814..4b38503591 100755 --- a/buildscripts/apiserver/build.sh +++ b/buildscripts/apiserver/build.sh @@ -59,7 +59,6 @@ do if [ $GOOS = "windows" ]; then output_name+='.exe' fi - echo $GOARCH env GOOS=$GOOS GOARCH=$GOARCH go build -ldflags \ "-X main.GitCommit='${GIT_COMMIT}${GIT_DIRTY}' \ -X main.CtlName='${CTLNAME}' \ diff --git a/buildscripts/docker/Dockerfile b/buildscripts/mayactl/Dockerfile similarity index 100% rename from buildscripts/docker/Dockerfile rename to buildscripts/mayactl/Dockerfile diff --git a/buildscripts/build.sh b/buildscripts/mayactl/build.sh similarity index 85% rename from buildscripts/build.sh rename to buildscripts/mayactl/build.sh index 6bf661e64f..c772a49823 100755 --- a/buildscripts/build.sh +++ b/buildscripts/mayactl/build.sh @@ -6,7 +6,7 @@ set -e # Get the parent directory of where this script is. SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done -DIR="$( cd -P "$( dirname "$SOURCE" )/.." && pwd )" +DIR="$( cd -P "$( dirname "$SOURCE" )/../.." && pwd )" # Change into that directory cd "$DIR" @@ -28,15 +28,15 @@ XC_OSS=(${XC_OS// / }) # Delete the old dir echo "==> Removing old directory..." -rm -rf bin/* -mkdir -p bin/ +rm -rf bin/maya/* +mkdir -p bin/maya/ -if [ -z "${GIT_TAG}" ]; +if [ -z "${GIT_TAG}" ]; then GIT_TAG="0.0.1" fi -if [ -z "${MAYACTL}" ]; +if [ -z "${MAYACTL}" ]; then MAYACTL="mayactl" fi @@ -54,12 +54,11 @@ for GOOS in "${XC_OSS[@]}" do for GOARCH in "${XC_ARCHS[@]}" do - output_name="bin/"$GOOS"_"$GOARCH"/"$MAYACTL + output_name="bin/maya/"$GOOS"_"$GOARCH"/"$MAYACTL if [ $GOOS = "windows" ]; then output_name+='.exe' fi - echo $GOARCH env GOOS=$GOOS GOARCH=$GOARCH go build -ldflags \ "-X main.GitCommit='${GIT_COMMIT}${GIT_DIRTY}' \ -X main.CtlName='${CTLNAME}' \ @@ -84,16 +83,16 @@ IFS=: MAIN_GOPATH=($GOPATH) IFS=$OLDIFS # Copy our OS/Arch to the bin/ directory -DEV_PLATFORM="./bin/$(go env GOOS)_$(go env GOARCH)" +DEV_PLATFORM="./bin/maya/$(go env GOOS)_$(go env GOARCH)" for F in $(find ${DEV_PLATFORM} -mindepth 1 -maxdepth 1 -type f); do - cp ${F} bin/ + cp ${F} bin/maya cp ${F} ${MAIN_GOPATH}/bin/ done if [[ "x${MAYA_DEV}" == "x" ]]; then # Zip and copy to the dist dir echo "==> Packaging..." - for PLATFORM in $(find ./bin -mindepth 1 -maxdepth 1 -type d); do + for PLATFORM in $(find ./bin/maya -mindepth 1 -maxdepth 1 -type d); do OSARCH=$(basename ${PLATFORM}) echo "--> ${OSARCH}" @@ -106,4 +105,4 @@ fi # Done! echo echo "==> Results:" -ls -hl bin/ +ls -hl bin/maya diff --git a/buildscripts/push b/buildscripts/mayactl/push similarity index 100% rename from buildscripts/push rename to buildscripts/mayactl/push