Skip to content

Commit bf1ec62

Browse files
committed
MAINT Update to CircleCI 2 (#408)
1 parent 0dbacc7 commit bf1ec62

File tree

4 files changed

+57
-58
lines changed

4 files changed

+57
-58
lines changed

.circleci/config.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
version: 2
2+
3+
jobs:
4+
python3:
5+
docker:
6+
- image: circleci/python:3.6.1
7+
environment:
8+
- USERNAME: "scikit-learn-contrib"
9+
- DOC_REPO: "imbalanced-learn"
10+
- DOC_URL: ""
11+
- EMAIL: "[email protected]"
12+
- MINICONDA_PATH: ~/miniconda
13+
- CONDA_ENV_NAME: testenv
14+
- PYTHON_VERSION: 3
15+
steps:
16+
- checkout
17+
- run: ./build_tools/circle/checkout_merge_commit.sh
18+
- run: ./build_tools/circle/build_doc.sh
19+
- store_artifacts:
20+
path: doc/_build/html/stable
21+
destination: doc
22+
- store_artifacts:
23+
path: ~/log.txt
24+
- persist_to_workspace:
25+
root: doc/_build/html
26+
paths: .
27+
- attach_workspace:
28+
at: doc/_build/html
29+
- run: ls -ltrh doc/_build/html/stable
30+
- deploy:
31+
command: |
32+
if [[ "${CIRCLE_BRANCH}" =~ ^master$|^[0-9]+\.[0-9]+\.X$ ]]; then
33+
bash ./build_tools/circle/push_doc.sh doc/_build/html/stable
34+
fi
35+
filters:
36+
branches:
37+
ignore: gh-pages
38+
39+
workflows:
40+
version: 2
41+
build-doc-and-deploy:
42+
jobs:
43+
- python3

build_tools/circle/build_doc.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,8 @@ conda install --yes pip numpy scipy scikit-learn pillow matplotlib sphinx \
9696
pip install -U git+https://github.com/sphinx-gallery/sphinx-gallery.git
9797

9898
# Build and install imbalanced-learn in dev mode
99-
cd "$HOME/$CIRCLE_PROJECT_REPONAME"
10099
ls -l
101-
python setup.py develop
100+
pip install -e .
102101

103102
# The pipefail is requested to propagate exit code
104103
set -o pipefail && cd doc && make $MAKE_TARGET 2>&1 | tee ~/log.txt

build_tools/circle/push_doc.sh

+13-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@
44
# The behavior of the script is controlled by environment variable defined
55
# in the circle.yml in the top level folder of the project.
66

7+
GENERATED_DOC_DIR=$1
8+
9+
if [[ -z "$GENERATED_DOC_DIR" ]]; then
10+
echo "Need to pass directory of the generated doc as argument"
11+
echo "Usage: $0 <generated_doc_dir>"
12+
exit 1
13+
fi
14+
15+
# Absolute path needed because we use cd further down in this script
16+
GENERATED_DOC_DIR=$(readlink -f $GENERATED_DOC_DIR)
17+
718
if [ "$CIRCLE_BRANCH" = "master" ]
819
then
920
dir=dev
@@ -16,15 +27,15 @@ MSG="Pushing the docs to $dir/ for branch: $CIRCLE_BRANCH, commit $CIRCLE_SHA1"
1627

1728
cd $HOME
1829
if [ ! -d $DOC_REPO ];
19-
then git clone --depth 1 --no-checkout "[email protected]:"$ORGANIZATION"/"$DOC_REPO".git";
30+
then git clone --depth 1 --no-checkout -b gh-pages "[email protected]:"$USERNAME"/"$DOC_REPO".git";
2031
fi
2132
cd $DOC_REPO
2233
git config core.sparseCheckout true
2334
echo $dir > .git/info/sparse-checkout
2435
git checkout gh-pages
2536
git reset --hard origin/gh-pages
2637
git rm -rf $dir/ && rm -rf $dir/
27-
cp -R $HOME/imbalanced-learn/doc/_build/html $dir
38+
cp -R $GENERATED_DOC_DIR $dir
2839
touch $dir/.nojekyll
2940
git config --global user.email $EMAIL
3041
git config --global user.name $USERNAME

circle.yml

-54
This file was deleted.

0 commit comments

Comments
 (0)