Skip to content

Commit

Permalink
purge stale files, fix docker login
Browse files Browse the repository at this point in the history
  • Loading branch information
blockloop committed Dec 12, 2018
1 parent 5f530a2 commit e71dfb5
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ function verify_gpg_key() {
function deploy_spaces() {
pull_spaces

purge_stale_packages

anounce "Moving built deb packages"
for file in $(target_files | grep -P '\.deb$'); do
cp -Luv "$file" repos/apt/pool/beta/main/d/do-agent/
Expand All @@ -172,6 +174,15 @@ function deploy_spaces() {
push_spaces
}

# remove packages of the same version with a previous release
# find any files in the beta channels that are VERSION but be
# careful not to delete 1.0.11 when searching for 1.0.1
function purge_stale_packages() {
anounce "purging stale packages"
find repos/apt/pool/beta/ -type f -iname "do-agent_${VERSION/v}[^\d]*.deb" -exec rm -rfv {} \;
find repos/yum-beta/ -type f -iname "do-agent.${VERSION/v}[^\d]*.rpm" -exec rm -rfv {} \;
}

function rebuild_apt_packages() {
verify_gpg_key
anounce "Rebuilding apt package indexes"
Expand Down Expand Up @@ -357,7 +368,8 @@ function create_github_release() {
}

function docker_login() {
docker login -u "$DOCKER_USER" --password-stdin <<<"$DOCKER_PASSWORD"
# gocd has an old version of docker that does not have --pasword-stdin
docker login -u "$DOCKER_USER" -p "$DOCKER_PASSWORD"
}

# build and push the RC docker hub image. This image is considered unstable
Expand Down

0 comments on commit e71dfb5

Please sign in to comment.