Skip to content

Commit 7427f0b

Browse files
committed
[CI] make.sh updates:
- Renames build to assemble - Adds necessary GIT config variables - Updates instructions - Removes bump task from make.sh since we don't need it - Hardcode output dir
1 parent 945396d commit 7427f0b

File tree

4 files changed

+18
-15
lines changed

4 files changed

+18
-15
lines changed

.ci/Dockerfile

+1-3
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ WORKDIR /usr/src/app
1111
COPY . .
1212

1313
RUN gem update --system
14-
RUN gem uninstall bundler
15-
RUN gem install bundler
16-
RUN bundle install
14+
RUN bundle install --quiet
1715
RUN bundle exec rake bundle:clean
1816
RUN rake bundle:install

.ci/make.sh

+13-11
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,27 @@ CMD=$1
1313
VERSION=$2
1414
set -euo pipefail
1515

16-
TARGET_DIR=${TARGET_DIR-.ci/output}
16+
TARGET_DIR=.ci/output
1717
OUTPUT_DIR="$repo/${TARGET_DIR}"
1818
RUBY_TEST_VERSION=${RUBY_TEST_VERSION-2.7}
19-
GITHUB_TOKEN=${GITHUB_TOKEN-}
20-
RUBYGEMS_API=${RUBYGEMS_API-}
19+
GITHUB_TOKEN=${GITHUB_TOKEN-nil}
20+
RUBYGEMS_API=${RUBYGEMS_API-nil}
2121
GIT_NAME=${GIT_NAME-elastic}
2222
GIT_EMAIL=${GIT_EMAIL-'[email protected]'}
2323

2424
case $CMD in
25-
bump)
26-
TASK=bump["$VERSION"]
27-
;;
28-
build)
25+
assemble)
2926
TASK=build["$TARGET_DIR"]
3027
;;
3128
publish)
3229
TASK=publish
3330
;;
3431
*)
35-
echo -e "\nUsage:\n\t $0 {bump [VERSION] | build [TARGET_DIR]}\n"
32+
echo -e "\nUsage:"
33+
echo -e "\t Build gem files:"
34+
echo -e "\t $0 assemble\n"
35+
echo -e "\t Publish gems:"
36+
echo -e "\t $0 publish\n"
3637
exit 1
3738
esac
3839

@@ -51,10 +52,11 @@ docker run \
5152
--env "RUBY_TEST_VERSION=${RUBY_TEST_VERSION}" \
5253
--env "GITHUB_TOKEN" \
5354
--env "RUBYGEMS_API_KEY" \
55+
--env "GIT_EMAIL" \
56+
--env "GIT_NAME" \
5457
--name test-runner \
58+
--volume $repo:/usr/src/app \
5559
--volume "${OUTPUT_DIR}:/${TARGET_DIR}" \
5660
--rm \
5761
elastic/elasticsearch-ruby \
58-
git config --global user.email ${GIT_EMAIL} && \
59-
git config --global user.name ${GIT_NAME} && \
60-
bundle exec rake bundle:clean bundle:install unified_release:"$TASK"
62+
bundle exec rake unified_release:"$TASK"

Rakefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ namespace :bundle do
101101
task :install do
102102
SUBPROJECTS.each do |project|
103103
puts '-' * 80
104-
sh "cd #{CURRENT_PATH.join(project)} && unset BUNDLE_GEMFILE && bundle install"
104+
sh "cd #{CURRENT_PATH.join(project)} && unset BUNDLE_GEMFILE && bundle install --quiet"
105105
puts
106106
end
107107
end

rake_tasks/unified_release_tasks.rake

+3
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ namespace :unified_release do
5353
raise ArgumentError, 'You need to set the env value for GITHUB_TOKEN' unless ENV['GITHUB_TOKEN']
5454
raise ArgumentError, 'You need to set the env value for RUBYGEMS_API_KEY' unless ENV['RUBYGEMS_API_KEY']
5555

56+
sh 'git config --global user.email ${GIT_EMAIL} && ' \
57+
'git config --global user.name ${GIT_NAME}'
58+
5659
file_name = File.expand_path('~/.gem/credentials')
5760
text = <<~CREDENTIALS
5861
---

0 commit comments

Comments
 (0)