Skip to content

Commit

Permalink
fix deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
blockloop committed Dec 12, 2018
1 parent cf668b3 commit 173ec60
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -155,21 +155,21 @@ function deploy_spaces() {

anounce "Moving built deb packages"
for file in $(target_files | grep -P '\.deb$'); do
cp "$file" repos/apt/pool/beta/main/d/do-agent/
cp -Luv "$file" repos/apt/pool/beta/main/d/do-agent/
done

anounce "Moving yum packages"
for file in $(target_files | grep -P '\.rpm$'); do
dest=repos/yum-beta/x86_64/
[[ "$file" =~ "i386" ]] && \
dest=repos/yum-beta/i386/
cp "$file" "$dest"
cp -Luv "$file" "$dest"
done

rebuild_apt_packages

rebuild_yum_packages

push_spaces
}

function rebuild_apt_packages() {
Expand Down Expand Up @@ -260,11 +260,11 @@ function promote_spaces() {
pull_spaces

anounce "Copying deb packages to main channel"
cp "$PROJECT_ROOT/repos/apt/pool/beta/main/d/do-agent/do-agent_${PKG_VERSION}_.deb" "$PROJECT_ROOT/repos/apt/pool/main/main/d/do-agent/"
cp -Luv "$PROJECT_ROOT/repos/apt/pool/beta/main/d/do-agent/do-agent_${PKG_VERSION}_.deb" "$PROJECT_ROOT/repos/apt/pool/main/main/d/do-agent/"

anounce "Copying yum packages to main channel"
cp "$PROJECT_ROOT/repos/yum-beta/i386/do-agent.${PKG_VERSION}.i386.rpm" "$PROJECT_ROOT/repos/yum/i386/"
cp "$PROJECT_ROOT/repos/yum-beta/x86_64/do-agent.${PKG_VERSION}.amd64.rpm" "$PROJECT_ROOT/repos/yum/x86_64/"
cp -Luv "$PROJECT_ROOT/repos/yum-beta/i386/do-agent.${PKG_VERSION}.i386.rpm" "$PROJECT_ROOT/repos/yum/i386/"
cp -Luv "$PROJECT_ROOT/repos/yum-beta/x86_64/do-agent.${PKG_VERSION}.amd64.rpm" "$PROJECT_ROOT/repos/yum/x86_64/"

rebuild_apt_packages
rebuild_yum_packages
Expand Down Expand Up @@ -381,12 +381,11 @@ function deploy_docker() {

# list the artifacts within the target/ directory
function target_files() {
find target/pkg -type f -iname "*${PKG_VERSION}*" || \
abort "No packages for $PKG_VERSION were found in target/. Did you forget to run make?"
find target/pkg -type f -iname "*${PKG_VERSION}*" | grep .
}

function check_target_files() {
target_files
target_files || abort "No packages for $PKG_VERSION were found in target/. Did you forget to run make?"
}

# call CURL with github authentication
Expand Down Expand Up @@ -419,12 +418,6 @@ function anounce() {
}


function cp() {
src=${1:-}
dest=${2:-}
cp -Luv "$src" "$dest" || exit 1
}

# send a slack notification or fallback to STDERR
# Usage: notify_slack <success> <msg> [link]
#
Expand Down

0 comments on commit 173ec60

Please sign in to comment.