Skip to content

Commit

Permalink
patch: finalize auto-build
Browse files Browse the repository at this point in the history
  • Loading branch information
mmta committed Nov 9, 2018
1 parent 6a52310 commit 42ddfde
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,19 +125,19 @@ jobs:
# get downloader for private asset
wget https://github.com/gruntwork-io/fetch/releases/download/v0.3.2/fetch_linux_amd64 -O /tmp/fetch
chmod +x /tmp/fetch
# wait until the release is approved, exit after waiting for >= 10 minutes
minutewait=10
# wait until the release is approved, exit after waiting for >= 30 minutes
minutewait=30
# fetch requires this
export GITHUB_OAUTH_TOKEN=$GITHUB_TOKEN
while ! /tmp/fetch --repo="https://github.com/defenxor/dsiem" --tag=$tag --release-asset="dsiem-server-linux-amd64.zip" /tmp 2>/dev/null; do
while ! /tmp/fetch --repo="https://github.com/defenxor/dsiem" --tag=$tag --release-asset="dsiem-server_linux_amd64.zip" /tmp 2>/dev/null; do
[ "$minutewait" == "0" ] && echo "Timeout waiting for release asset, skipping docker build." && exit 0
echo "release $tag doesnt exist yet, sleeping for 60 seconds before retrying .. retry left: $minutewait"
minutewait=$(( minutewait - 1 ))
sleep 60
done
echo "building docker for release $tag .."
cd deployments/docker/build
docker build -f Dockerfile -t defenxor/dsiem:$tag -t defenxor/dsiem:latest . --build-arg ver=$tag --build-arg token=GITHUB_TOKEN
docker build -f Dockerfile -t defenxor/dsiem:$tag -t defenxor/dsiem:latest . --build-arg ver=$tag --build-arg token=$GITHUB_TOKEN
docker login -u $DOCKER_USER -p $DOCKER_PASSWD
docker push defenxor/dsiem:$tag
else
Expand Down
4 changes: 2 additions & 2 deletions deployments/docker/build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ RUN apk -U upgrade && \
ARG token
ENV GITHUB_OAUTH_TOKEN=$token
RUN wget https://github.com/gruntwork-io/fetch/releases/download/v0.3.2/fetch_linux_amd64 -O /tmp/fetch && chmod +x /tmp/fetch && \
/tmp/fetch --repo="https://github.com/defenxor/dsiem" --tag=$DSIEM_VER --release-asset="dsiem-server-linux-amd64.zip" /tmp && \
unzip /tmp/dsiem-server-linux-amd64.zip -d /dsiem && rm -rf /tmp/dsiem-server-linux-amd64.zip /tmp/fetch
/tmp/fetch --repo="https://github.com/defenxor/dsiem" --tag=$DSIEM_VER --release-asset="dsiem-server_linux_amd64.zip" /tmp && \
unzip /tmp/dsiem-server_linux_amd64.zip -d /dsiem && rm -rf /tmp/dsiem-server_linux_amd64.zip /tmp/fetch

# To be used later, replacing the above
# RUN wget https://github.com/defenxor/dsiem/releases/download/$DSIEM_VER/dsiem-server-linux-amd64.zip -O /tmp/dsiem.zip && \
Expand Down

0 comments on commit 42ddfde

Please sign in to comment.