This repository has been archived by the owner on Jul 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Bill Wang
committed
Aug 25, 2019
1 parent
140a31e
commit 27f8a09
Showing
5 changed files
with
77 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
report |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
sudo: required | ||
|
||
services: | ||
- docker | ||
|
||
script: | ||
- bash ./build.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
FROM alpine | ||
FROM alpine:edge | ||
|
||
RUN apk --no-cache add socat | ||
ARG VERSION=1.7.3.2 | ||
|
||
RUN apk --no-cache add socat=${VERSION} | ||
|
||
ENTRYPOINT ["socat"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Prerequisite | ||
# Make sure you set secret enviroment variables in Travis CI | ||
# DOCKER_USERNAME | ||
# DOCKER_PASSWORD | ||
|
||
set -ex | ||
|
||
Usage() { | ||
echo "$0 [rebuild]" | ||
} | ||
|
||
image="alpine/socat" | ||
|
||
#curl -s https://pkgs.alpinelinux.org/package/edge/main/x86/socat |tee output | ||
#docker run -i --rm -v output:/apps/output alpine/html2text -nobs < output > report | ||
|
||
curl -s https://pkgs.alpinelinux.org/package/edge/main/x86/socat | docker run -i --rm -v output:/apps/output alpine/html2text -nobs > report | ||
|
||
latest=$(awk '/^Version/ {print $2}' report) | ||
|
||
sum=0 | ||
echo "Lastest release is: ${latest}" | ||
|
||
tags=`curl -s https://hub.docker.com/v2/repositories/${image}/tags/ |jq -r .results[].name` | ||
|
||
for tag in ${tags} | ||
do | ||
if [ ${tag} == ${latest} ];then | ||
sum=$((sum+1)) | ||
fi | ||
done | ||
|
||
if [[ ( $sum -ne 1 ) || ( $1 == "rebuild" ) ]];then | ||
docker build --build-arg VERSION=${latest} --no-cache -t ${image}:${latest} . | ||
docker tag ${image}:${latest} ${image}:latest | ||
|
||
if [[ "$TRAVIS_BRANCH" == "master" ]]; then | ||
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD | ||
docker push ${image}:${latest} | ||
docker push ${image}:latest | ||
fi | ||
|
||
fi |