Skip to content

Commit 09ca713

Browse files
authored
Merge pull request #319 from rspec/fix-clone-issue-and-update-bundler
Fix clone issue and update bundler
2 parents 1845ba0 + 309414f commit 09ca713

File tree

6 files changed

+25
-44
lines changed

6 files changed

+25
-44
lines changed

Rakefile

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,10 @@ task :run, :command do |_t, args|
213213
run_command args[:command]
214214
end
215215

216-
desc "Updates the rspec.github.io docs"
217-
task :update_docs, [:version, :website_path] do |_t, args|
218-
abort "You must have ag installed to generate docs" if `which ag` == ""
219-
args.with_defaults(:website_path => "../rspec.github.io")
216+
desc 'Updates the rspec.github.io docs'
217+
task :update_docs, [:version, :website_path, :branch] do |_t, args|
218+
abort 'You must have ag installed to generate docs' if `which ag` == ''
219+
args.with_defaults(:website_path => '../rspec.github.io')
220220

221221
output_directory = File.expand_path(args[:website_path])
222222

@@ -225,9 +225,9 @@ task :update_docs, [:version, :website_path] do |_t, args|
225225
projects = {}
226226
skipped = []
227227

228-
$stdout.write "Checking versions..."
228+
$stdout.write 'Checking versions...'
229229

230-
each_project :silent => true, :except => (UnDocumentedProjects) do |project|
230+
each_project :silent => true, :except => UnDocumentedProjects do |project|
231231
$stdout.write "\rChecking versions... #{project}"
232232
latest_release =
233233
if args[:version] =~ /maintenance$/
@@ -236,10 +236,12 @@ task :update_docs, [:version, :website_path] do |_t, args|
236236
`git fetch --tags && git tag -l "v#{args[:version]}*" | grep v#{args[:version]} | tail -1`
237237
end
238238

239-
if latest_release.empty?
239+
if args[:branch].empty? && latest_release.empty?
240240
skipped << project
241-
else
241+
elsif args[:branch].empty?
242242
projects[project] = latest_release
243+
else
244+
projects[project] = args[:branch]
243245
end
244246
$stdout.write "\rChecking versions... #{' ' * MAX_PROJECT_NAME_LENGTH}"
245247
end
@@ -526,12 +528,10 @@ namespace :ci do
526528
end
527529

528530
def around_update_ci_build
529-
run_if_exists './script/before_update_travis_build.sh'
530531
run_if_exists './script/before_update_build.sh'
531532
yield if block_given?
532533
ensure
533534
run_if_exists './script/after_update_build.sh'
534-
run_if_exists './script/after_update_travis_build.sh'
535535
end
536536

537537
desc "Update build files"

ci/.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ concurrency:
1616
env:
1717
RSPEC_CI: true
1818
# This tells rspec-rails what branch to run in ci
19-
RSPEC_VERSION: '= 3.13.0.pre'
19+
RSPEC_VERSION: '= 3.14.0.pre'
2020
jobs:
2121
rubocop:
2222
name: Rubocop

ci/script/ci_functions.sh

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -27,41 +27,17 @@ nano_cmd="$(type -p gdate date | head -1)"
2727
nano_format="+%s%N"
2828
[ "$(uname -s)" != "Darwin" ] || nano_format="${nano_format/%N/000000000}"
2929

30-
travis_time_start() {
31-
travis_timer_id=$(printf %08x $(( RANDOM * RANDOM )))
32-
travis_start_time=$($nano_cmd -u "$nano_format")
33-
printf "travis_time:start:%s\r\e[0m" $travis_timer_id
34-
}
35-
36-
travis_time_finish() {
37-
local travis_end_time=$($nano_cmd -u "$nano_format")
38-
local duration=$(($travis_end_time-$travis_start_time))
39-
printf "travis_time:end:%s:start=%s,finish=%s,duration=%s\r\e[0m" \
40-
$travis_timer_id $travis_start_time $travis_end_time $duration
41-
}
42-
4330
fold() {
4431
local name="$1"
4532
local status=0
4633
shift 1
47-
if [ -n "$TRAVIS" ]; then
48-
printf "travis_fold:start:%s\r\e[0m" "$name"
49-
travis_time_start
50-
else
51-
echo "============= Starting $name ==============="
52-
fi
34+
echo "============= Starting $name ==============="
5335

5436
"$@"
5537
status=$?
5638

57-
[ -z "$TRAVIS" ] || travis_time_finish
58-
5939
if [ "$status" -eq 0 ]; then
60-
if [ -n "$TRAVIS" ]; then
61-
printf "travis_fold:end:%s\r\e[0m" "$name"
62-
else
63-
echo "============= Ending $name ==============="
64-
fi
40+
echo "============= Ending $name ==============="
6541
else
6642
STATUS="$status"
6743
fi

ci/script/clone_all_rspec_repos

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ source script/functions.sh
55
if is_mri; then
66
pushd ..
77

8-
clone_repo "rspec"
8+
clone_repo "rspec-metagem" "rspec"
99
clone_repo "rspec-core"
1010
clone_repo "rspec-expectations"
1111
clone_repo "rspec-mocks"

ci/script/functions.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ source $SCRIPT_DIR/ci_functions.sh
33
source $SCRIPT_DIR/predicate_functions.sh
44

55
# If JRUBY_OPTS isn't set, use these.
6-
# see https://docs.travis-ci.com/user/ci-environment/
76
export JRUBY_OPTS=${JRUBY_OPTS:-"--server -Xcompile.invokedynamic=false"}
87
SPECS_HAVE_RUN_FILE=specs.out
98
MAINTENANCE_BRANCH=`cat maintenance-branch`
@@ -17,12 +16,18 @@ fi
1716
function clone_repo {
1817
if [ ! -d $1 ]; then # don't clone if the dir is already there
1918
if [ -z "$2" ]; then
19+
DIR_TARGET="$1"
20+
else
21+
DIR_TARGET="$2"
22+
fi
23+
24+
if [ -z "$3" ]; then
2025
BRANCH_TO_CLONE="${MAINTENANCE_BRANCH?}";
2126
else
22-
BRANCH_TO_CLONE="$2";
27+
BRANCH_TO_CLONE="$3";
2328
fi;
2429

25-
ci_retry eval "git clone https://github.com/rspec/$1 --depth 1 --branch ${BRANCH_TO_CLONE?}"
30+
ci_retry eval "git clone https://github.com/rspec/$1 --depth 1 --branch ${BRANCH_TO_CLONE?} ${DIR_TARGET?}"
2631
fi;
2732
}
2833

ci/script/update_rubygems_and_install_bundler

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ set -e
33
source script/functions.sh
44

55
if is_ruby_31_plus; then
6-
echo "Installing rubygems 3.3.6 / bundler 2.3.6"
7-
yes | gem update --system '3.3.6'
8-
yes | gem install bundler -v '2.3.6'
6+
echo "Installing most recent rubygems / bundler"
7+
yes | gem update --no-document --system
8+
yes | gem install --no-document bundler
99
elif is_ruby_23_plus; then
1010
echo "Installing rubygems 3.2.22 / bundler 2.2.22"
1111
yes | gem update --system '3.2.22'

0 commit comments

Comments
 (0)