Adjust the script entries and make it work again after import
authorSofian Brabez <sofian.brabez@gonitro.com>
Fri, 30 Nov 2018 14:56:48 +0000 (14:56 +0000)
committerSofian Brabez <sofian.brabez@gonitro.com>
Fri, 30 Nov 2018 14:56:48 +0000 (14:56 +0000)
Dockerfile
release.sh

index 4f47ea11f9ea112f0af45ebc2a0c4c43bac027d7..fd2605a52e25475382e634c8c7630a301eb2f3df 100644 (file)
@@ -8,7 +8,7 @@ ARG VERSION
 ARG AWS_ACCESS_KEY_ID
 ARG AWS_SECRET_ACCESS_KEY
 
-ADD . /tmp
+ADD docker-gc /tmp
 
 WORKDIR /tmp
 ENV DEBIAN_FRONTEND=noninteractive
index 36f01f3eab779d4428989e3bbb36a01915771e1c..89a98a368a198841d5aa90a41e5d7c5668d7ac6f 100755 (executable)
@@ -2,8 +2,6 @@
 
 set -e
 
-DRY_RUN=' '
-
 [ ! -f `which gpg` ] && {
     echo 2>&1 "You need to install gnupg: brew install gnupg"
     exit 2
@@ -14,13 +12,15 @@ DRY_RUN=' '
     exit 2
 }
 
-COMMIT=`git rev-parse --short HEAD`
-VERSION="2:`cat version.txt`~${COMMIT}"
+COMMIT=`(cd docker-gc && git rev-parse --short HEAD)`
+VERSION="2:`cat ${PWD}/docker-gc/version.txt`~${COMMIT}"
 TAG="gonitro/docker-gc-build:${COMMIT}"
 AWS_REGION=us-west-2
 BUCKET=nitro-apt-repo
 NITRO_GPG_KEY=C5075270
 
+printf  "[+] Using GPG %s for package signature\n" ${NITRO_GPG_KEY}
+
 $DRY_RUN docker build \
     -t ${TAG} \
     --build-arg VERSION=${VERSION} \
@@ -30,8 +30,8 @@ $DRY_RUN docker build \
 
 $DRY_RUN docker run -v /tmp/:/tmp ${TAG} /bin/bash -c 'cp /docker-gc*.deb /tmp'
 
-package=`ls /tmp/*.deb`
-echo Debian Package generated into ${package}
+package=`ls /tmp/*.deb || :`
+printf "[+] Debian Package generated into '%s'\n" ${package}
 
 $DRY_RUN deb-s3 upload \
     --access-key-id=${AWS_ACCESS_KEY_ID} \
@@ -39,6 +39,6 @@ $DRY_RUN deb-s3 upload \
     --s3-region=${AWS_REGION} \
     --bucket=${BUCKET} \
     --sign=${NITRO_GPG_KEY} ${package} || exit 1
-echo Successfully uploaded package into ${BUCKET}
+printf "[+] Successfully uploaded package into %s\n" ${BUCKET}
 
 exit 0