From 61fa59e95bbcfc0585d93788af379ff2eae8594e Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sun, 30 Dec 2018 21:13:24 +0000 Subject: [PATCH] Remove Travis CI specific code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We’re no longer using this for our CI so this is no longer necessary. Also, migrate `brew tap-new` to use Azure pipelines. --- Library/Homebrew/dev-cmd/tap-new.rb | 39 ++++++++------------ Library/Homebrew/extend/os/mac/diagnostic.rb | 4 +- Library/Homebrew/formula_installer.rb | 4 -- Library/Homebrew/test/spec_helper.rb | 2 +- Library/Homebrew/utils/curl.rb | 2 +- bin/brew | 2 +- 6 files changed, 21 insertions(+), 32 deletions(-) diff --git a/Library/Homebrew/dev-cmd/tap-new.rb b/Library/Homebrew/dev-cmd/tap-new.rb index e227fee242..7c5b0ad4e2 100644 --- a/Library/Homebrew/dev-cmd/tap-new.rb +++ b/Library/Homebrew/dev-cmd/tap-new.rb @@ -51,30 +51,23 @@ module Homebrew MARKDOWN write_path(tap, "README.md", readme) - travis = <<~YAML - language: c - os: osx - compiler: clang - osx_image: xcode9.2 - cache: - directories: - - #{Homebrew::DEFAULT_PREFIX}/Homebrew/Library/Homebrew/vendor/bundle - branches: - only: - - master - - before_install: - - sudo chown -R "$USER" "$(brew --repo)" - - travis_retry brew update - - HOMEBREW_TAP_DIR="$(brew --repo "$TRAVIS_REPO_SLUG")" - - mkdir -p "$HOMEBREW_TAP_DIR" - - rm -rf "$HOMEBREW_TAP_DIR" - - ln -s "$PWD" "$HOMEBREW_TAP_DIR" - - script: - - brew test-bot + azure = <<~YAML + jobs: + - job: macOS + pool: + vmImage: xcode9-macos10.13 + steps: + - bash: | + sudo xcode-select --switch /Applications/Xcode_10.app/Contents/Developer + brew update + HOMEBREW_TAP_DIR="/usr/local/Homebrew/Library/Taps/#{tap}" + mkdir -p "$HOMEBREW_TAP_DIR" + rm -rf "$HOMEBREW_TAP_DIR" + ln -s "$PWD" "$HOMEBREW_TAP_DIR" + brew test-bot + displayName: Run brew test-bot YAML - write_path(tap, ".travis.yml", travis) + write_path(tap, "azure-pipelines.yml", azure) end def write_path(tap, filename, content) diff --git a/Library/Homebrew/extend/os/mac/diagnostic.rb b/Library/Homebrew/extend/os/mac/diagnostic.rb index 245357e6e6..0af10f9698 100644 --- a/Library/Homebrew/extend/os/mac/diagnostic.rb +++ b/Library/Homebrew/extend/os/mac/diagnostic.rb @@ -74,7 +74,7 @@ module Homebrew # `brew test-bot` runs `brew doctor` in the CI for the Homebrew/brew # repository. This only needs to support whatever CI providers # Homebrew/brew is currently using. - return if ENV["HOMEBREW_TRAVIS_CI"] || ENV["HOMEBREW_AZURE_PIPELINES"] + return if ENV["HOMEBREW_AZURE_PIPELINES"] message = <<~EOS Your Xcode (#{MacOS::Xcode.version}) is outdated. @@ -101,7 +101,7 @@ module Homebrew # `brew test-bot` runs `brew doctor` in the CI for the Homebrew/brew # repository. This only needs to support whatever CI providers # Homebrew/brew is currently using. - return if ENV["HOMEBREW_TRAVIS_CI"] || ENV["HOMEBREW_AZURE_PIPELINES"] + return if ENV["HOMEBREW_AZURE_PIPELINES"] <<~EOS A newer Command Line Tools release is available. diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 912a06989a..a1d5a6aac7 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -741,10 +741,6 @@ class FormulaInstaller ].concat(build_argv) Utils.safe_fork do - # Invalidate the current sudo timestamp in case a build script calls sudo. - # Travis CI's Linux sudoless workers have a weird sudo that fails here. - system "/usr/bin/sudo", "-k" if ENV["HOMEBREW_TRAVIS_SUDO"] != "false" - if Sandbox.formula?(formula) sandbox = Sandbox.new formula.logs.mkpath diff --git a/Library/Homebrew/test/spec_helper.rb b/Library/Homebrew/test/spec_helper.rb index 7a96b20c9a..802e2c4f22 100644 --- a/Library/Homebrew/test/spec_helper.rb +++ b/Library/Homebrew/test/spec_helper.rb @@ -2,7 +2,7 @@ if ENV["HOMEBREW_TESTS_COVERAGE"] require "simplecov" formatters = [SimpleCov::Formatter::HTMLFormatter] - if ENV["HOMEBREW_COVERALLS_REPO_TOKEN"] || ENV["HOMEBREW_TRAVIS_CI"] + if ENV["HOMEBREW_COVERALLS_REPO_TOKEN"] require "coveralls" if !ENV["HOMEBREW_COLOR"] && (ENV["HOMEBREW_NO_COLOR"] || !$stdout.tty?) diff --git a/Library/Homebrew/utils/curl.rb b/Library/Homebrew/utils/curl.rb index 7bb77a3951..8c68a4ac38 100644 --- a/Library/Homebrew/utils/curl.rb +++ b/Library/Homebrew/utils/curl.rb @@ -32,7 +32,7 @@ def curl_args(*extra_args, show_output: false, user_agent: :default) args << "--fail" args << "--progress-bar" unless ARGV.verbose? args << "--verbose" if ENV["HOMEBREW_CURL_VERBOSE"] - args << "--silent" if !$stdout.tty? || ENV["HOMEBREW_TRAVIS_CI"] + args << "--silent" unless $stdout.tty? end args + extra_args diff --git a/bin/brew b/bin/brew index d554640776..0c0b2f61c0 100755 --- a/bin/brew +++ b/bin/brew @@ -72,7 +72,7 @@ then FILTERED_ENV=() # Filter all but the specific variables. - for VAR in HOME SHELL PATH TERM TERMINFO COLUMNS LOGNAME USER CI TRAVIS SSH_AUTH_SOCK SUDO_ASKPASS \ + for VAR in HOME SHELL PATH TERM TERMINFO COLUMNS LOGNAME USER CI SSH_AUTH_SOCK SUDO_ASKPASS \ http_proxy https_proxy ftp_proxy no_proxy all_proxy HTTPS_PROXY FTP_PROXY ALL_PROXY \ "${!HOMEBREW_@}" "${!TRAVIS_@}" do