Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add conda build branch regrex and change build id according to commit id #584

Merged
merged 1 commit into from
May 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions ci/scripts/conda/cpu/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ export HOME=$PROJECT_ROOT_PATH
cd $PROJECT_ROOT_PATH

# Get latest tag and number of commits since tag
# export GIT_DESCRIBE_TAG=`git describe --abbrev=0 --tags`
# export GIT_DESCRIBE_NUMBER=`git rev-list ${GIT_DESCRIBE_TAG}..HEAD --count`
export GIT_DESCRIBE_TAG=`git describe --abbrev=0 --tags`
export GIT_DESCRIBE_NUMBER=`git rev-list ${GIT_DESCRIBE_TAG}..HEAD --count`
export GIT_COMMIT_ID=`git rev-parse HEAD`

# If nightly build, append current YYMMDD to version
if [[ "$BUILD_MODE" = "nightly" ]] ; then
Expand Down
4 changes: 2 additions & 2 deletions ci/scripts/conda/cpu/upload_anaconda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

set -e

SOURCE_BRANCH=${SOURCE_BRANCH:=master}
BRANCH_REGEX='^(master|(branch\-[0-9]+\.[0-9]+\.(x|[0-9]+)))$'

# Restrict uploads to master branch
if [ "${GIT_BRANCH}" != "${SOURCE_BRANCH}" ]; then
if [[ ! "${GIT_BRANCH}" =~ ${BRANCH_REGEX} ]]; then
echo "Skipping upload"
return 0
fi
Expand Down
5 changes: 3 additions & 2 deletions ci/scripts/conda/gpu/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ export PARALLEL_LEVEL=4
cd $PROJECT_ROOT_PATH

# Get latest tag and number of commits since tag
# export GIT_DESCRIBE_TAG=`git describe --abbrev=0 --tags`
# export GIT_DESCRIBE_NUMBER=`git rev-list ${GIT_DESCRIBE_TAG}..HEAD --count`
export GIT_DESCRIBE_TAG=`git describe --abbrev=0 --tags`
export GIT_DESCRIBE_NUMBER=`git rev-list ${GIT_DESCRIBE_TAG}..HEAD --count`
export GIT_COMMIT_ID=`git rev-parse HEAD`

# If nightly build, append current YYMMDD to version
if [[ "$BUILD_MODE" = "nightly" ]] ; then
Expand Down
4 changes: 2 additions & 2 deletions ci/scripts/conda/gpu/upload_anaconda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

set -e

SOURCE_BRANCH=${SOURCE_BRANCH:=master}
BRANCH_REGEX='^(master|(branch\-[0-9]+\.[0-9]+\.(x|[0-9]+)))$'

# Restrict uploads to master branch
if [ "${GIT_BRANCH}" != "${SOURCE_BRANCH}" ]; then
if [[ ! "${GIT_BRANCH}" =~ ${BRANCH_REGEX} ]]; then
echo "Skipping upload"
return 0
fi
Expand Down
3 changes: 2 additions & 1 deletion conda/recipes/arctern-spark/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
{% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0.dev').lstrip('v') + environ.get('VERSION_SUFFIX', '') %}
# {% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %}
{% set git_revision_count=environ.get('GIT_DESCRIBE_NUMBER', 0) %}
{% set git_commit_id=environ.get('GIT_COMMIT_ID', '') %}
package:
name: arctern-spark
version: {{ version }}
Expand All @@ -14,7 +15,7 @@ source:
# ref: https://docs.conda.io/projects/conda-build/en/latest/resources/define-metadata.html#build-section
build:
number: {{ git_revision_count }}
string: {{ git_revision_count }}
string: {{ git_commit_id }}_{{ git_revision_count }}

requirements:
build:
Expand Down
3 changes: 2 additions & 1 deletion conda/recipes/arctern/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
{% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0.dev').lstrip('v') + environ.get('VERSION_SUFFIX', '') %}
# {% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %}
{% set git_revision_count=environ.get('GIT_DESCRIBE_NUMBER', 0) %}
{% set git_commit_id=environ.get('GIT_COMMIT_ID', '') %}
package:
name: arctern
version: {{ version }}
Expand All @@ -14,7 +15,7 @@ source:
# ref: https://docs.conda.io/projects/conda-build/en/latest/resources/define-metadata.html#build-section
build:
number: {{ git_revision_count }}
string: {{ git_revision_count }}
string: {{ git_commit_id }}_{{ git_revision_count }}

requirements:
build:
Expand Down
3 changes: 2 additions & 1 deletion conda/recipes/libarctern/cpu/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
{% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0.dev').lstrip('v') + environ.get('VERSION_SUFFIX', '') %}
# {% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %}
{% set git_revision_count=environ.get('GIT_DESCRIBE_NUMBER', 0) %}
{% set git_commit_id=environ.get('GIT_COMMIT_ID', '') %}
package:
name: libarctern
version: {{ version }}
Expand All @@ -14,7 +15,7 @@ source:
# ref: https://docs.conda.io/projects/conda-build/en/latest/resources/define-metadata.html#build-section
build:
number: {{ git_revision_count }}
string: {{ git_revision_count }}
string: {{ git_commit_id }}_{{ git_revision_count }}
script_env:
- CC
- CXX
Expand Down
3 changes: 2 additions & 1 deletion conda/recipes/libarctern/gpu/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
{% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0.dev').lstrip('v') + environ.get('VERSION_SUFFIX', '') %}
# {% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %}
{% set git_revision_count=environ.get('GIT_DESCRIBE_NUMBER', 0) %}
{% set git_commit_id=environ.get('GIT_COMMIT_ID', '') %}
{% set cuda_version='.'.join(environ.get('CUDA_VERSION', '10.0').split('.')[:2]) %}

package:
Expand All @@ -16,7 +17,7 @@ source:
# ref: https://docs.conda.io/projects/conda-build/en/latest/resources/define-metadata.html#build-section
build:
number: {{ git_revision_count }}
string: cuda{{ cuda_version }}_{{ git_revision_count }}
string: cuda{{ cuda_version }}_{{ git_commit_id }}_{{ git_revision_count }}
script_env:
- CC
- CXX
Expand Down