Skip to content

Commit

Permalink
Chocolatey artifacts didn't get uploaded during artifacts build (#1757)
Browse files Browse the repository at this point in the history
* Make sure chocolatey tarball gets added to artifacts
* Removes the zipball from mac and linux to have less stuff out there.
* Stop building and saving images.tar.gz, we only use .xz
  • Loading branch information
rfay committed Aug 4, 2019
1 parent 915a9d0 commit 72b055b
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 30 deletions.
32 changes: 17 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
# Now build using the regular ddev-only technique - this results in a fully clean set of executables.
- run:
command: |
make -s clean linux darwin windows_install EXTRA_PATH=/home/linuxbrew/.linuxbrew/bin
make -s clean linux darwin windows_install chocolatey EXTRA_PATH=/home/linuxbrew/.linuxbrew/bin
name: Build the ddev executables
- persist_to_workspace:
root: ~/
Expand Down Expand Up @@ -347,7 +347,7 @@ jobs:
- attach_workspace:
at: ~/
- run:
command: ./.circleci/generate_artifacts.sh $ARTIFACTS
command: ./.circleci/generate_artifacts.sh $ARTIFACTS ${BUILD_IMAGE_TARBALLS:false}
name: tar/zip up artifacts and make hashes
no_output_timeout: "40m"
- save_cache:
Expand Down Expand Up @@ -382,7 +382,7 @@ jobs:

# Now build using the regular ddev-only technique - this results in a fully clean set of executables.
- run:
command: make -s clean linux darwin windows_install EXTRA_PATH=/home/linuxbrew/.linuxbrew/bin
command: make -s clean linux darwin windows_install chocolatey EXTRA_PATH=/home/linuxbrew/.linuxbrew/bin
name: Build the ddev executables

# We only build the xz version of the docker images on tag build.
Expand Down Expand Up @@ -425,7 +425,7 @@ jobs:

# We only build the xz version of the docker images on tag build.
- run:
command: ./.circleci/generate_artifacts.sh $ARTIFACTS TRUE ${BUILD_IMAGE_TARBALLS:true}
command: ./.circleci/generate_artifacts.sh $ARTIFACTS ${BUILD_IMAGE_TARBALLS:true}
name: tar/zip up artifacts and make hashes
no_output_timeout: "40m"

Expand All @@ -446,20 +446,22 @@ jobs:
echo "GITHUB_TOKEN not provided, not pushing release $CIRCLE_TAG"
fi
name: Upload artifacts to GitHub release page
- run:
name: Upload chocolatey windows release
command: |
if [ ! -z "${CHOCOLATEY_API_KEY:-}" ]; then
echo "Pushing release to chocolatey..."
pushd .gotmp/bin/windows_amd64/chocolatey
docker run --rm -v $PWD:/tmp/chocolatey -w /tmp/chocolatey linuturk/mono-choco push -s https://push.chocolatey.org/ --api-key "${CHOCOLATEY_API_KEY}"
popd
else
echo "NOT pushing release to chocolatey because no CHOCOLATEY_API_KEY was provided"
fi
- store_artifacts:
path: /artifacts
name: Artifact storage
# When fixed, this will have to be done after push to github, so it can use
# the real github release artifact.
# - run:
# name: Upload chocolatey windows release
# command: |
# if [ ! -z "${CHOCOLATEY_API_KEY:-}" ]; then
# echo "Pushing release to chocolatey..."
# pushd .gotmp/bin/windows_amd64/chocolatey
# docker run --rm -v $PWD:/tmp/chocolatey -w /tmp/chocolatey linuturk/mono-choco push -s https://push.chocolatey.org/ --api-key "${CHOCOLATEY_API_KEY}"
# popd
# else
# echo "NOT pushing release to chocolatey because no CHOCOLATEY_API_KEY was provided"
# fi


workflows:
Expand Down
20 changes: 6 additions & 14 deletions .circleci/generate_artifacts.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
#!/bin/bash
# This script builds ddev artifacts and their sha256 hashes.
# First arg is the artifact directory
# Optional second arg is whether to build xz version of ddev_docker_images.tar
# Optional second arg is whether to build ddev_docker_images.tar

set -o errexit
set -o pipefail
set -o nounset

ARTIFACTS=${1:-/artifacts}
# We only build the xz artifacts if $2 ($BUILD_XZ) is not empty.
BUILD_XZ=${2:-}
BUILD_IMAGE_TARBALLS=${3:-true}
BUILD_IMAGE_TARBALLS=${2:-true}
BASE_DIR=$PWD

sudo mkdir -p $ARTIFACTS && sudo chmod 777 $ARTIFACTS
Expand All @@ -29,19 +27,15 @@ windows*)
esac

if [ "${BUILD_IMAGE_TARBALLS}" = "true" ]; then

# Make sure we have all our docker images, and save them in a tarball
$BUILTPATH/ddev version | awk '/drud\// {print $2;}' >/tmp/images.txt
for item in $(cat /tmp/images.txt); do
docker pull $item
done
echo "Generating ddev_docker_images.$VERSION.tar.gz"
echo "Generating ddev_docker_images.$VERSION.tar"
docker save -o $ARTIFACTS/ddev_docker_images.$VERSION.tar $(cat /tmp/images.txt)
gzip --keep $ARTIFACTS/ddev_docker_images.$VERSION.tar
if [ ! -z "$BUILD_XZ" ] ; then
echo "Generating ddev_docker_images.$VERSION.tar.xz"
xz $ARTIFACTS/ddev_docker_images.$VERSION.tar
fi
echo "Generating ddev_docker_images.$VERSION.tar.xz"
xz $ARTIFACTS/ddev_docker_images.$VERSION.tar
fi

# Generate and place extra items like autocomplete
Expand All @@ -54,18 +48,16 @@ done
# Generate macOS tarball/zipball
cd $BASE_DIR/.gotmp/bin/darwin_amd64
tar -czf $ARTIFACTS/ddev_macos.$VERSION.tar.gz ddev ddev_bash_completion.sh
zip $ARTIFACTS/ddev_macos.$VERSION.zip ddev ddev_bash_completion.sh

# Generate linux tarball/zipball
cd $BASE_DIR/.gotmp/bin
tar -czf $ARTIFACTS/ddev_linux.$VERSION.tar.gz ddev ddev_bash_completion.sh
zip $ARTIFACTS/ddev_linux.$VERSION.zip ddev ddev_bash_completion.sh

# generate windows tarball/zipball
cd $BASE_DIR/.gotmp/bin/windows_amd64
tar -czf $ARTIFACTS/ddev_windows.$VERSION.tar.gz ddev.exe ddev_bash_completion.sh
zip $ARTIFACTS/ddev_windows.$VERSION.zip ddev.exe ddev_bash_completion.sh
if [ -f chocolatey ]; then
if [ -d chocolatey ]; then
tar -czf $ARTIFACTS/ddev_chocolatey.$VERSION.tar.gz chocolatey
fi

Expand Down
4 changes: 4 additions & 0 deletions .circleci/trigger_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ while true; do
DDEV_WINDOWS_SIGNING_PASSWORD=$2
shift 2
;;
-h|--chocolatey-api-key)
CHOCOLATEY_API_KEY=$2
shift 2
;;
-m|--macos-signing-password)
DDEV_MACOS_SIGNING_PASSWORD=$2
shift 2
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ VERSION := $(shell git describe --tags --always --dirty)
# Some things insist on having the version without the leading 'v', so provide a
# $(NO_V_VERSION) without it.
# no_v_version removes the front v, keeps the special to 20 chars, simplifies complex version strings
NO_V_VERSION=$(shell echo $(VERSION) | awk -F- '{ sub(/^./, "", $$1); base=$$1; second=$$2$$3$$4$$5; gsub(/\./,"",second); $$1=""; printf(base); if (second != "") printf("-%.20s",second); } ')
NO_V_VERSION=$(shell echo $(VERSION) | awk -F- '{ sub(/^./, "", $$1); base=$$1; hash=$$3; gsub(/\./,"",second); $$1=""; printf(base); if (hash != "") printf("-%.20s",hash); } ')

GITHUB_ORG := drud

#
Expand Down

0 comments on commit 72b055b

Please sign in to comment.