From 4f46f7f6d7774fd4cabfc9e7fc14a387880ab95b Mon Sep 17 00:00:00 2001 From: Randy Fay Date: Mon, 27 Jan 2020 19:24:56 -0700 Subject: [PATCH] Simplify CircleCI build, less configuration, remove macOS build (#2051) * Simplify CircleCI build, less configuration, remove macOS build * Automatically build release when tag is pushed * Build image tarballs when not prerelease * Try to do less homebrew and make all commands quieter * Add the org_global restricted context to release buld * Update docs and remove trigger_release.sh --- .circleci/README.md | 28 +-- .circleci/config.yml | 275 ++++++++++++--------------- .circleci/generate_artifacts.sh | 8 +- .circleci/linux_circle_vm_setup.sh | 9 +- .circleci/macos_circle_vm_setup.sh | 15 +- .circleci/trigger_job.sh | 15 -- .circleci/trigger_release.sh | 106 ----------- docs/developers/release-checklist.md | 33 ++-- 8 files changed, 156 insertions(+), 333 deletions(-) delete mode 100755 .circleci/trigger_job.sh delete mode 100755 .circleci/trigger_release.sh diff --git a/.circleci/README.md b/.circleci/README.md index 1ebb7175e0f..3982fce7314 100644 --- a/.circleci/README.md +++ b/.circleci/README.md @@ -1,31 +1,5 @@ # CircleCI Script Usage -## Tags build automatically +## Tags/Releases build automatically If you just push a tag, circleci will build that tag and make its artifacts available both on CircleCI and by creating a GitHub release draft containing the artifacts. This is a result of the tag_build *workflow*, which calls the job. - -## Push a release with trigger_release.sh - -`.circleci/trigger_release.sh --release-tag=v1.7.1 --circleci-token=circleToken900908b3443ea58316baf928b --github-token=githubPersonalToken853ae6f72c40525cd21036f742904a --windows-signing-password=windowscodepassword | jq -r 'del(.circle_yml)' | jq -r 'del(.circle_yml)'` - -## trigger_job.sh options - -trigger_job.sh can be used to trigger *jobs* but not workflows. As our Circleci strategy is mostly built around workflows, this is less useful than it used to be. - -.circleci/trigger_job.sh tag_build drud/ddev | jq -r - -trigger_job.sh can trigger a nightly or a normal build. It triggers *jobs* not workflows. - -It always requires a circle token for the second argument, and by default will run the main build workflow: - -* trigger normal build: -`.circleci/trigger_job.sh 0123456773884887377aabvb ` - -* trigger nightly build in drud/ddev (default): -`.circleci/trigger_job.sh 0123456773884887377aabvb nightly_build` - -* trigger nightly using rfay/ddev master branch (testing must be enabled on rfay/ddev): -`.circleci/trigger_job.sh 0123456773884887377aabvb nightly_build rfay/ddev` - -* trigger nightly on rfay/ddev on branch 20170803_workflows_contexts: -`.circleci/trigger_job.sh 0123456773884887377aabvb nightly_build rfay/ddev 20170803_workflows_contexts` diff --git a/.circleci/config.yml b/.circleci/config.yml index 119a879d096..d5a3f88aea5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,25 +11,33 @@ jobs: - run: sudo mkdir /home/linuxbrew && sudo chown $(id -u) /home/linuxbrew - restore_cache: keys: - - homebrew-linux-v10 + - linux-v11 - run: command: ./.circleci/linux_circle_vm_setup.sh name: NORMAL Circle VM setup - tools, docker, golang - - save_cache: - key: homebrew-linux-v10 - paths: - - /home/linuxbrew - - ~/.ddev/testcache - - # Now build using the regular ddev-only technique - this results in a fully clean set of executables. + - run: + command: source ~/.bashrc && nvm use 10 && make staticrequired EXTRA_PATH=/home/linuxbrew/.linuxbrew/bin + name: staticrequired - run: command: | make -s clean linux darwin windows_install EXTRA_PATH=/home/linuxbrew/.linuxbrew/bin name: Build the ddev executables + - run: + command: ./.circleci/generate_artifacts.sh ~/artifacts ${BUILD_IMAGE_TARBALLS:false} + name: tar/zip up artifacts and make hashes + no_output_timeout: "40m" + - store_artifacts: + path: ~/artifacts + name: Store artifacts - persist_to_workspace: root: ~/ paths: ddev + - save_cache: + key: linux-v11 + paths: + - /home/linuxbrew + - ~/.ddev/testcache lx_nginx_fpm_test: machine: @@ -44,16 +52,11 @@ jobs: - run: sudo mkdir /home/linuxbrew && sudo chown $(id -u) /home/linuxbrew - restore_cache: keys: - - homebrew-linux-v10 + - linux-v11 # Run the built-in ddev tests with the executables just built. - run: command: ./.circleci/linux_circle_vm_setup.sh name: Circle VM setup - tools, docker, golang - - save_cache: - key: homebrew-linux-v10 - paths: - - /home/linuxbrew - - ~/.ddev/testcache # Now build using the regular ddev-only technique - this results in a fully clean set of executables. - run: @@ -62,10 +65,15 @@ jobs: no_output_timeout: "40m" - store_test_results: path: /tmp/testresults + - save_cache: + key: linux-v11 + paths: + - /home/linuxbrew + - ~/.ddev/testcache mac_nginx_fpm_test: macos: - xcode: "11.0.0" + xcode: "11.3.1" working_directory: ~/ddev environment: DDEV_TEST_WEBSERVER_TYPE: nginx-fpm @@ -76,29 +84,26 @@ jobs: at: ~/ - restore_cache: keys: - - homebrew-macos-v15 + - macos-v16 # Run the built-in ddev tests with the executables just built. - run: command: ./.circleci/macos_circle_vm_setup.sh name: macOS Circle VM setup - tools, docker, golang # Now build using the regular ddev-only technique - this results in a fully clean set of executables. - - save_cache: - key: homebrew-macos-v15 - paths: - - /usr/local/Homebrew - - /usr/local/Cellar - - ~/Library/Caches/Homebrew - - ~/.ddev/testcache - run: command: make -s test name: ddev tests no_output_timeout: "40m" + - save_cache: + key: macos-v16 + paths: + - ~/.ddev/testcache - store_test_results: path: /tmp/testresults mac_apache_fpm_test: macos: - xcode: "11.0.0" + xcode: "11.3.1" working_directory: ~/ddev environment: DDEV_TEST_WEBSERVER_TYPE: apache-fpm @@ -109,7 +114,7 @@ jobs: at: ~/ - restore_cache: keys: - - homebrew-macos-v15 + - macos-v16 # Run the built-in ddev tests with the executables just built. - run: command: ./.circleci/macos_circle_vm_setup.sh @@ -122,16 +127,13 @@ jobs: - store_test_results: path: /tmp/testresults - save_cache: - key: homebrew-macos-v15 + key: macos-v16 paths: - - /usr/local/Homebrew - - /usr/local/Cellar - - ~/Library/Caches/Homebrew - ~/.ddev/testcache mac_nfsmount_test: macos: - xcode: "11.3.0" + xcode: "11.3.1" working_directory: ~/ddev environment: DDEV_TEST_USE_NFSMOUNT: "true" @@ -142,24 +144,21 @@ jobs: at: ~/ - restore_cache: keys: - - homebrew-macos-v15 + - macos-v16 # Run the built-in ddev tests with the executables just built. - run: command: ./.circleci/macos_circle_vm_setup.sh name: macOS Circle VM setup - tools, docker, golang - - save_cache: - key: homebrew-macos-v15 - paths: - - /usr/local/Homebrew - - /usr/local/Cellar - - ~/Library/Caches/Homebrew - - ~/.ddev/testcache - run: command: make -s test name: ddev tests no_output_timeout: "40m" - store_test_results: path: /tmp/testresults + - save_cache: + key: macos-v16 + paths: + - ~/.ddev/testcache lx_apache_fpm_test: machine: @@ -174,18 +173,12 @@ jobs: - run: sudo mkdir /home/linuxbrew && sudo chown $(id -u) /home/linuxbrew - restore_cache: keys: - - homebrew-linux-v10 + - linux-v11 - attach_workspace: at: ~/ - run: command: ./.circleci/linux_circle_vm_setup.sh name: Circle VM setup - tools, docker, golang - - save_cache: - key: homebrew-linux-v10 - paths: - - /home/linuxbrew - - ~/.ddev/testcache - # Now build using the regular ddev-only technique - this results in a fully clean set of executables. # Run the built-in ddev tests with the executables just built. - run: @@ -194,6 +187,11 @@ jobs: no_output_timeout: "120m" - store_test_results: path: /tmp/testresults + - save_cache: + key: linux-v11 + paths: + - /home/linuxbrew + - ~/.ddev/testcache lx_apache_cgi_test: machine: @@ -208,24 +206,23 @@ jobs: - run: sudo mkdir /home/linuxbrew && sudo chown $(id -u) /home/linuxbrew - restore_cache: keys: - - homebrew-linux-v10 + - linux-v11 - attach_workspace: at: ~/ - run: command: ./.circleci/linux_circle_vm_setup.sh name: Circle VM setup - tools, docker, golang - - save_cache: - key: homebrew-linux-v10 - paths: - - /home/linuxbrew - - ~/.ddev/testcache - - run: command: make -s test EXTRA_PATH=/home/linuxbrew/.linuxbrew/bin name: ddev tests no_output_timeout: "120m" - store_test_results: path: /tmp/testresults + - save_cache: + key: linux-v11 + paths: + - /home/linuxbrew + - ~/.ddev/testcache lx_nfsmount_test: machine: @@ -240,17 +237,12 @@ jobs: - run: sudo mkdir /home/linuxbrew && sudo chown $(id -u) /home/linuxbrew - restore_cache: keys: - - homebrew-linux-v10 + - linux-v11 - attach_workspace: at: ~/ - run: command: ./.circleci/linux_circle_vm_setup.sh name: Circle VM setup - tools, docker, golang - - save_cache: - key: homebrew-linux-v10 - paths: - - /home/linuxbrew - - ~/.ddev/testcache # Now build using the regular ddev-only technique - this results in a fully clean set of executables. # Run the built-in ddev tests with the executables just built. @@ -260,6 +252,11 @@ jobs: no_output_timeout: "120m" - store_test_results: path: /tmp/testresults + - save_cache: + key: linux-v11 + paths: + - /home/linuxbrew + - ~/.ddev/testcache staticrequired: machine: @@ -271,16 +268,10 @@ jobs: - run: sudo mkdir /home/linuxbrew && sudo chown $(id -u) /home/linuxbrew - restore_cache: keys: - - homebrew-linux-v10 + - linux-v11 - run: command: ./.circleci/linux_circle_vm_setup.sh name: Circle VM setup - tools, docker, golang - - save_cache: - key: homebrew-linux-v10 - paths: - - /home/linuxbrew - - ~/.ddev/testcache - - run: command: source ~/.bashrc && nvm use 10 && make staticrequired EXTRA_PATH=/home/linuxbrew/.linuxbrew/bin name: staticrequired @@ -289,20 +280,17 @@ jobs: machine: image: ubuntu-1604:201903-01 working_directory: ~/ddev + environment: + GOTEST_SHORT: true steps: - checkout - run: sudo mkdir /home/linuxbrew && sudo chown $(id -u) /home/linuxbrew - restore_cache: keys: - - homebrew-linux-v10 + - linux-v11 - run: command: ./.circleci/linux_circle_vm_setup.sh name: Circle VM setup - tools, docker, golang - - save_cache: - key: homebrew-linux-v10 - paths: - - /home/linuxbrew - - ~/.ddev/testcache - run: command: | @@ -316,26 +304,21 @@ jobs: popd done name: linux container test + - save_cache: + key: linux-v11 + paths: + - /home/linuxbrew + - ~/.ddev/testcache mac_container_test: macos: - xcode: "11.3.0" + xcode: "11.3.1" working_directory: ~/ddev steps: - checkout - - restore_cache: - keys: - - homebrew-macos-v15 - run: command: ./.circleci/macos_circle_vm_setup.sh name: macOS Circle VM setup - tools, docker, golang - - save_cache: - key: homebrew-macos-v15 - paths: - - /usr/local/Homebrew - - /usr/local/Cellar - - ~/Library/Caches/Homebrew - - ~/.ddev/testcache - run: command: | @@ -357,7 +340,7 @@ jobs: - run: sudo mkdir /home/linuxbrew && sudo chown $(id -u) /home/linuxbrew - restore_cache: keys: - - homebrew-linux-v10 + - linux-v11 - attach_workspace: at: ~/ - run: @@ -365,7 +348,7 @@ jobs: name: tar/zip up artifacts and make hashes no_output_timeout: "40m" - save_cache: - key: homebrew-linux-v10 + key: linux-v11 paths: - /home/linuxbrew - ~/.ddev/testcache @@ -375,65 +358,55 @@ jobs: name: Artifact storage # 'tag_build' automatically builds a tag . - tag_build: - machine: - image: ubuntu-1604:201903-01 - working_directory: ~/ddev - environment: - DDEV_DEBUG: "true" - steps: - - checkout - - run: sudo mkdir /home/linuxbrew && sudo chown $(id -u) /home/linuxbrew - - restore_cache: - keys: - - homebrew-linux-v10 - - run: - command: ./.circleci/linux_circle_vm_setup.sh - name: TAG BUILD Circle VM setup - tools, docker, golang - - save_cache: - key: homebrew-linux-v10 - paths: - - /home/linuxbrew - - ~/.ddev/testcache - - # 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 - name: Build the ddev executables - - # We only build the xz version of the docker images on tag build. - - run: - # Do not build the docker tarballs at simple tag build time - command: ./.circleci/generate_artifacts.sh ~/artifacts false false - name: tar/zip up artifacts and make hashes - no_output_timeout: "40m" - - - store_artifacts: - path: ~/artifacts - name: Artifact storage - - # 'release_build' is used to push a full release; it's triggered by api call +# tag_build: +# machine: +# image: ubuntu-1604:201903-01 +# working_directory: ~/ddev +# environment: +# DDEV_DEBUG: "true" +# steps: +# - checkout +# - run: sudo mkdir /home/linuxbrew && sudo chown $(id -u) /home/linuxbrew +# - restore_cache: +# keys: +# - linux-v11 +# - run: +# command: ./.circleci/linux_circle_vm_setup.sh +# name: TAG BUILD Circle VM setup - tools, docker, golang +# - save_cache: +# key: linux-v11 +# paths: +# - /home/linuxbrew +# - ~/.ddev/testcache +# +# # 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 +# name: Build the ddev executables +# +# # We only build the xz version of the docker images on tag build. +# - run: +# # Do not build the docker tarballs at simple tag build time +# command: ./.circleci/generate_artifacts.sh ~/artifacts false false +# name: tar/zip up artifacts and make hashes +# no_output_timeout: "40m" +# +# - store_artifacts: +# path: ~/artifacts +# name: Artifact storage + + # 'tag_build' is used to push a full release release_build: macos: - xcode: "11.3.0" + xcode: "11.3.1" working_directory: ~/ddev environment: DDEV_DEBUG: "true" steps: - checkout - - restore_cache: - keys: - - homebrew-macos-v15 - run: command: ./.circleci/macos_circle_vm_setup.sh - name: RELEASE BUILD (macOS) Circle VM setup - - save_cache: - key: homebrew-macos-v15 - paths: - - /usr/local/Homebrew - - /usr/local/Cellar - - ~/Library/Caches/Homebrew - - ~/.ddev/testcache + name: TAG BUILD (macOS) Circle VM setup - run: command: make -s clean linux windows_install chocolatey @@ -450,19 +423,19 @@ jobs: - run: command: | - if [ ! -z "${GITHUB_TOKEN}" ]; then + if [ ! -z "${DDEV_GITHUB_TOKEN}" ]; then version=$(make version) version="${version#*:}" # Remove the VERSION: in front of make version - echo "GITHUB_TOKEN provided, pushing release $RELEASE_TAG" + echo "DDEV_GITHUB_TOKEN provided, pushing release ${version}" ghr \ -prerelease \ -r $CIRCLE_PROJECT_REPONAME \ -u $CIRCLE_PROJECT_USERNAME \ -b "$(cat ./.github/RELEASE_NOTES_TEMPLATE.md)" \ - -t $GITHUB_TOKEN \ + -t $DDEV_GITHUB_TOKEN \ "${version}" ~/artifacts else - echo "GITHUB_TOKEN not provided, not pushing release $CIRCLE_TAG" + echo "DDEV_GITHUB_TOKEN not provided, not pushing release $CIRCLE_TAG" fi name: Upload artifacts to GitHub release page - store_artifacts: @@ -490,16 +463,13 @@ workflows: - build # - mac_container_test - lx_container_test - - staticrequired - - artifacts: - requires: - - build +# - staticrequired - lx_nginx_fpm_test: requires: - build - - mac_nginx_fpm_test: - requires: - - build +# - mac_nginx_fpm_test: +# requires: +# - build # - mac_apache_fpm_test: # requires: # - build @@ -515,10 +485,9 @@ workflows: - lx_nfsmount_test: requires: - build - - staticrequired - - artifacts: - requires: - - build +# - artifacts: +# requires: +# - build nightly_build: triggers: @@ -535,13 +504,11 @@ workflows: - lx_nginx_fpm_test: requires: - build - - artifacts: - requires: - - build - tag_build: + release_build: jobs: - - tag_build: + - release_build: + context: org-global filters: tags: only: diff --git a/.circleci/generate_artifacts.sh b/.circleci/generate_artifacts.sh index 8665ff5e2ee..30148f540bf 100755 --- a/.circleci/generate_artifacts.sh +++ b/.circleci/generate_artifacts.sh @@ -8,14 +8,20 @@ set -o pipefail set -o nounset MKCERT_VERSION=v1.4.0 +BUILD_IMAGE_TARBALLS=false ARTIFACTS=${1:-/artifacts} -BUILD_IMAGE_TARBALLS=${2:-false} BASE_DIR=$PWD sudo mkdir -p $ARTIFACTS && sudo chmod 777 $ARTIFACTS export VERSION=$(git describe --tags --always --dirty) +# If the version does not have a dash in it, it's not prerelease, +# so build image tarballs +if [ -z ${VERSION##-*} ]; then + BUILD_IMAGE_TARBALLS=true +fi + case "${OSTYPE}" in darwin*) BUILTPATH=.gotmp/bin/darwin_amd64 diff --git a/.circleci/linux_circle_vm_setup.sh b/.circleci/linux_circle_vm_setup.sh index 461e90cbbc1..8b966913e16 100755 --- a/.circleci/linux_circle_vm_setup.sh +++ b/.circleci/linux_circle_vm_setup.sh @@ -18,9 +18,12 @@ echo "export PATH=/home/linuxbrew/.linuxbrew/bin:$PATH" >>~/.bashrc . ~/.bashrc -brew update && brew tap drud/ddev +export HOMEBREW_NO_AUTO_UPDATE=1 +export HOMEBREW_NO_INSTALL_CLEANUP=1 + +brew tap drud/ddev >/dev/null for item in osslsigncode golang mkcert ddev makensis; do - brew install $item || /home/linuxbrew/.linuxbrew/bin/brew upgrade $item + brew install $item >/dev/null || /home/linuxbrew/.linuxbrew/bin/brew upgrade $item >/dev/null done # nvm on CircleCI has a few things. 10 is compatible with markdownlint-cli @@ -28,7 +31,7 @@ nvm use 10 npm install --global markdownlint-cli markdownlint --version # readthedocs has ancient version of mkdocs in it. -pip3 install yq mkdocs==0.17.5 +pip3 install -q yq mkdocs==0.17.5 # Get the Stubs and Plugins for makensis; the linux makensis build doesn't do this. wget https://sourceforge.net/projects/nsis/files/NSIS%203/3.04/nsis-3.04.zip/download && sudo unzip -o -d /usr/local/share download && sudo mv /usr/local/share/nsis-3.04 /usr/local/share/nsis diff --git a/.circleci/macos_circle_vm_setup.sh b/.circleci/macos_circle_vm_setup.sh index f34c6fa7c93..807fa16d31c 100755 --- a/.circleci/macos_circle_vm_setup.sh +++ b/.circleci/macos_circle_vm_setup.sh @@ -12,18 +12,17 @@ export HOMEBREW_NO_AUTO_UPDATE=1 export HOMEBREW_NO_INSTALL_CLEANUP=1 # Get docker in first so we can install it and work on other things -brew cask install ngrok - sudo /Applications/Docker.app/Contents/MacOS/Docker --quit-after-install --unattended nohup /Applications/Docker.app/Contents/MacOS/Docker --unattended & -brew tap drud/ddev -brew unlink python@2 || true +brew cask install ngrok >/dev/null +brew tap drud/ddev >/dev/null +brew unlink python@2 >/dev/null || true -brew install mysql-client zip makensis jq expect coreutils golang ddev mkcert osslsigncode ghr gnu-getopt libgsf glib pcre || true -brew link mysql-client zip makensis jq expect coreutils golang ddev mkcert osslsigncode ghr gnu-getopt libgsf glib pcre +brew install mysql-client zip makensis jq expect coreutils golang ddev mkcert osslsigncode ghr gnu-getopt libgsf glib pcre >/dev/null || true +brew link mysql-client zip makensis jq expect coreutils golang ddev mkcert osslsigncode ghr gnu-getopt libgsf glib pcre >/dev/null -brew link --force mysql-client +brew link --force mysql-client >/dev/null # Get the Plugins for NSIS curl -fsSL -o /tmp/EnVar-Plugin.zip https://github.com/GsNSIS/EnVar/releases/latest/download/EnVar-Plugin.zip && sudo unzip -o -d /usr/local/share/nsis /tmp/EnVar-Plugin.zip @@ -34,7 +33,7 @@ mkdir -p /usr/local/etc/my.cnf.d mkcert -install -pip3 install yq +pip3 install -q yq curl -fsSL -o /tmp/gotestsum.tgz https://github.com/gotestyourself/gotestsum/releases/download/v0.3.2/gotestsum_0.3.2_darwin_amd64.tar.gz && tar -C /usr/local/bin -zxf /tmp/gotestsum.tgz gotestsum diff --git a/.circleci/trigger_job.sh b/.circleci/trigger_job.sh deleted file mode 100755 index b9cd8b0a7b2..00000000000 --- a/.circleci/trigger_job.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# from https://circleci.com/docs/1.0/nightly-builds/ -# See also https://circleci.com/docs/2.0/defining-multiple-jobs/ - -# trigger_job.sh $circle_token $project_optional $branch_optional - -CIRCLE_TOKEN=$1 -JOB=${2:-nightly_build} -PROJECT=${3:-drud/ddev} -BRANCH=${4:-master} - -trigger_build_url=https://circleci.com/api/v1.1/project/github/$PROJECT/tree/$BRANCH?circle-token=$CIRCLE_TOKEN - -curl --data "build_parameters[CIRCLE_JOB]=$JOB" $trigger_build_url diff --git a/.circleci/trigger_release.sh b/.circleci/trigger_release.sh deleted file mode 100755 index 92cae4c3985..00000000000 --- a/.circleci/trigger_release.sh +++ /dev/null @@ -1,106 +0,0 @@ -#!/bin/bash - -# .circleci/trigger_release.sh x --release-tag="v1.12.0-20" --circleci-token=circletoken --build-image-tarballs=false --windows-signing-password=winsignpasswd --macos-signing-password=macsigningpwd --macos-app-password="macapppwd" - -# .circleci/trigger_release.sh --release-tag=v1.11.1 --circleci-token=circletoken --github-token=githubtoken --build-image-tarballs=true --windows-signing-password=winsignpwd —macos-signing-password=macsignpwd —macos_app_password=macapppwd | jq -r 'del(.circle_yml)' - -# api docs: https://circleci.com/docs/api -# Trigger a new job: https://circleci.com/docs/api/v1-reference/#new-build - -set -o errexit -o pipefail -o noclobber -o nounset - -GITHUB_PROJECT=drud/ddev -BUILD_IMAGE_TARBALLS=true -GITHUB_ORG=drud - -# Long option parsing example: https://stackoverflow.com/a/29754866/215713 -# On macOS this requires `brew install gnu-getopt` -OS=$(uname -s) -if [ ${OS} = "Darwin" ]; then PATH="/usr/local/opt/gnu-getopt/bin:$PATH"; fi -if [ ${OS} = "Darwin" ] && [ ! -f "/usr/local/opt/gnu-getopt/bin/getopt" ]; then - echo "This script requires `brew install gnu-getopt`" && exit 1 -fi - -! getopt --test > /dev/null -if [[ ${PIPESTATUS[0]} -ne 4 ]]; then - echo '`getopt --test` failed in this environment.' - exit 1 -fi - -LONGOPTS=circleci-token:,github-token:,release-tag:,github-project:,windows-signing-password:,macos-signing-password:,build-image-tarballs:,chocolatey-api-key:,github-org:,macos-app-password: - -! PARSED=$(getopt --longoptions=$LONGOPTS --name "$0" -- "$@") -if [[ ${PIPESTATUS[0]} -ne 0 ]]; then - # e.g. return value is 1 - # then getopt has complained about wrong arguments to stdout - printf "\n\nFailed parsing options:\n" - getopt --longoptions=$LONGOPTS --name "$0" -- "$@" - exit 2 -fi - -eval set -- "$PARSED" - -while true; do - case "$1" in - --circleci-token) - CIRCLE_TOKEN=$2 - shift 2 - ;; - --github-token) - GITHUB_TOKEN=$2 - shift 2 - ;; - --release-tag) - RELEASE_TAG=$2 - shift 2 - ;; - --github-project) - GITHUB_PROJECT=$2 - shift 2 - ;; - --windows-signing-password) - DDEV_WINDOWS_SIGNING_PASSWORD=$2 - shift 2 - ;; - --chocolatey-api-key) - CHOCOLATEY_API_KEY=$2 - shift 2 - ;; - --macos-signing-password) - DDEV_MACOS_SIGNING_PASSWORD=$2 - shift 2 - ;; - --macos-app-password) - DDEV_MACOS_APP_PASSWORD=$2 - shift 2 - ;; - # For debugging we can set BUILD_IMAGE_TARBALLS=false to avoid waiting for that. - --build-image-tarballs) - BUILD_IMAGE_TARBALLS=$2 - shift 2 - ;; - # For debugging we can set GITHUB_ORG=rfay so chocolatey will look there for the binaries. - -o|--github-org) - GITHUB_ORG=$2 - shift 2 - ;; - --) - break; - esac -done - -trigger_build_url=https://circleci.com/api/v1.1/project/github/$GITHUB_PROJECT?circle-token=${CIRCLE_TOKEN} - -set -x -BUILD_PARAMS="\"CIRCLE_JOB\": \"release_build\", \"job_name\": \"release_build\", \"GITHUB_TOKEN\":\"${GITHUB_TOKEN:-}\", \"RELEASE_TAG\": \"${RELEASE_TAG}\",\"DDEV_WINDOWS_SIGNING_PASSWORD\":\"${DDEV_WINDOWS_SIGNING_PASSWORD:-}\",\"DDEV_MACOS_SIGNING_PASSWORD\":\"${DDEV_MACOS_SIGNING_PASSWORD:-}\",\"DDEV_MACOS_APP_PASSWORD\":\"${DDEV_MACOS_APP_PASSWORD:-}\",\"CHOCOLATEY_API_KEY\":\"${CHOCOLATEY_API_KEY:-}\",\"BUILD_IMAGE_TARBALLS\":\"${BUILD_IMAGE_TARBALLS:-true}\",\"GITHUB_ORG\":\"${GITHUB_ORG}\"" -if [ "${RELEASE_TAG:-}" != "" ]; then - DATA="\"tag\": \"$RELEASE_TAG\"," -fi - -DATA="${DATA} \"build_parameters\": { ${BUILD_PARAMS} } " - -curl -X POST -sS \ - --header "Content-Type: application/json" \ - --data "{ ${DATA} }" \ - $trigger_build_url - diff --git a/docs/developers/release-checklist.md b/docs/developers/release-checklist.md index 5033a5e4753..bd141bd761b 100644 --- a/docs/developers/release-checklist.md +++ b/docs/developers/release-checklist.md @@ -5,25 +5,20 @@ 2. Update the default container versions in `pkg/version/version.go` and create a pull request 3. Ensure all updates have been merged into the master branch 4. Create a tag for the new version according to the instructions below, initiating a tag build -5. Build and push artifacts with the .circleci/trigger_release.sh tool: `.circleci/trigger_release.sh --release-tag=v1.10.0 --circleci-token=circleToken900908b3443ea58316baf928b --github-token=githubPersonalToken853ae6f72c40525cd21036f742904a --windows-signing-password=windowscodepassword --macos-signing-password=macossigningpassword | jq -r 'del(.circle_yml)' | jq -r 'del(.circle_yml)'` -6. Add the commit list (`git log vXXX..vYYY --oneline --decorate=no`) to the release page -7. Update the `ddev` homebrew formulas (ddev-edge and ddev) as necessary, and with the source .tar.gz and SHA checksum of the tarball and the bottle builds and tarballs. The bottles and checksums for macOS (sierra) and x86_64_linux are built and pushed to the release page automatically by the CircleCI release build process. -8. Test `brew upgrade ddev` both on macOS and Linux and make sure ddev is the right version and behaves well -9. Test the Windows installer and confirm it's signed correctly -10. Update the release page with specifics about the current release -11. Publish the release (unmark it as "prerelease") -12. Download the ddev_chocolatey tarball and extract it. cd into the extraction directory and push it to chocolatey with `docker run --rm -v $PWD:/tmp/chocolatey -w /tmp/chocolatey linuturk/mono-choco push -s https://push.chocolatey.org/ --api-key=choco-apikey-a720-7890909913f7` (Although this ought to be done by the release build process on CircleCI it's not successful as of v1.7.1.) -13. On [ReadTheDocs](https://readthedocs.org/projects/ddev/builds) click the button to "build version" "latest". Then on [versions](https://readthedocs.org/projects/ddev/versions/) page make sure that "stable" reflects the hash of the new version. - -## Creating a Tag - -1. Fetch all changes locally: `git fetch upstream` -2. Merge updates into local master branch: `git merge upstream/master` -3. Confirm the state of the master branch: `git log --oneline` -4. Create a tag pointing to the current revision: `git tag vXXX` where `vXXX` is the version being released -5. Push the tag to the remote: `git push upstream vXXX` - -## Signing with Windows installer +5. Add the commit list (`git log vXXX..vYYY --oneline --decorate=no`) to the release page +6. Update the `ddev` homebrew formulas (ddev-edge and ddev) as necessary, and with the source .tar.gz and SHA checksum of the tarball and the bottle builds and tarballs. The bottles and checksums for macOS (sierra) and x86_64_linux are built and pushed to the release page automatically by the CircleCI release build process. +7. Test `brew upgrade ddev` both on macOS and Linux and make sure ddev is the right version and behaves well +8. Test the Windows installer and confirm it's signed correctly +9. Update the release page with specifics about the current release +10. Publish the release (unmark it as "prerelease") +11. Download the ddev_chocolatey tarball and extract it. cd into the extraction directory and push it to chocolatey with `docker run --rm -v $PWD:/tmp/chocolatey -w /tmp/chocolatey linuturk/mono-choco push -s https://push.chocolatey.org/ --api-key=choco-apikey-a720-7890909913f7` (Although this ought to be done by the release build process on CircleCI it's not successful as of v1.7.1.) +12. On [ReadTheDocs](https://readthedocs.org/projects/ddev/builds) click the button to "build version" "latest". Then on [versions](https://readthedocs.org/projects/ddev/versions/) page make sure that "stable" reflects the hash of the new version. + +## Creating a Release + +Just use the github UI to create a release on the releases page. Add notes as needed, then the CircleCI build process will overwrite the release info on the build. + +## Manually Signing with Windows installer (This is done by the release process, but manual process documented here.)