Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
feat(cd): docker images now push to github during merge and tag
Browse files Browse the repository at this point in the history
  • Loading branch information
hanhxiao committed Sep 25, 2019
1 parent b6f2cda commit 8bef90d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .drone-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ steps:
from_secret: BADGE_WEBHOOK
BOT_URL:
from_secret: BOT_URL
GITHUB_USER:
from_secret: GITHUB_USER
GITHUB_PWD:
from_secret: GITHUB_PWD
commands:
- ./docker-build.sh
- docker system prune -a -f
Expand Down Expand Up @@ -114,6 +118,10 @@ steps:
from_secret: BADGE_WEBHOOK
BOT_URL:
from_secret: BOT_URL
GITHUB_USER:
from_secret: GITHUB_USER
GITHUB_PWD:
from_secret: GITHUB_PWD
commands:
- ./docker-build.sh

Expand Down
12 changes: 12 additions & 0 deletions docker-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ do
login_push ${HUB_USER} ${HUB_PWD} " " gnes
fi

if [[ -z "${GITHUB_USER}" ]]; then
printf "\$GITHUB_USER not set, pass\n"
else
login_push ${GITHUB_USER} ${GITHUB_PWD} docker.pkg.github.com docker.pkg.github.com/gnes-ai/gnes
fi

if [[ -z "${TCLOUD_USER}" ]]; then
printf "\$TCLOUD_USER not set, pass\n"
else
Expand All @@ -76,6 +82,12 @@ else
docker tag ${ALPINE_TAG} ccr.ccs.tencentyun.com/gnes/${DEFAULT_TAG} && docker push ccr.ccs.tencentyun.com/gnes/${DEFAULT_TAG}
fi

if [[ -z "${GITHUB_USER}" ]]; then
printf "\$GITHUB_USER not set, pass\n"
else
docker tag ${ALPINE_TAG} docker.pkg.github.com/gnes-ai/gnes/${DEFAULT_TAG} && docker push docker.pkg.github.com/gnes-ai/gnes/${DEFAULT_TAG}
fi

if [[ -z "${BADGE_WEBHOOK}" ]]; then
printf "\$BADGE_WEBHOOK not set, pass\n"
else
Expand Down

0 comments on commit 8bef90d

Please sign in to comment.