File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -41,15 +41,22 @@ jobs:
41
41
docker push localhost:5000/ubuntu
42
42
fi
43
43
- checkout
44
+ - run :
45
+ name : Prepare a Python environment
46
+ command : |
47
+ pyenv local 3.7.0
48
+ python3 -m pip install "setuptools ~= 42.0" "setuptools_scm[toml] >= 3.4" "pip>=10.0.1"
44
49
- run :
45
50
name : Build Docker image & push to registry
46
51
no_output_timeout : 60m
47
52
command : |
53
+ pyenv local 3.7.0
48
54
e=1 && for i in {1..5}; do
49
55
docker build --rm --cache-from=nitransforms:latest \
50
56
-t nitransforms:latest \
51
57
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
52
- --build-arg VCS_REF=`git rev-parse --short HEAD` . \
58
+ --build-arg VCS_REF=`git rev-parse --short HEAD` \
59
+ --build-arg VERSION=$( python3 setup.py --version ) . \
53
60
&& e=0 && break || sleep 15
54
61
done && [ "$e" -eq "0" ]
55
62
docker tag nitransforms:latest localhost:5000/nitransforms
67
74
name : Check version packaged in Docker image
68
75
command : |
69
76
pyenv local 3.7.0
70
- python3 -m pip install "setuptools ~= 42.0" "setuptools_scm[toml] >= 3.4" "pip>=10.0.1"
71
77
THISVERSION=${CIRCLE_TAG:-$(python3 setup.py --version)}
72
78
INSTALLED_VERSION=$(\
73
79
docker run -it --rm --entrypoint=python nitransforms \
Original file line number Diff line number Diff line change @@ -131,12 +131,10 @@ WORKDIR /home/neuro
131
131
ENV HOME="/home/neuro"
132
132
133
133
# Install package
134
+ # CRITICAL: Make sure python setup.py --version has been run at least once
135
+ # outside the container, with access to the git history.
134
136
COPY . /src/nitransforms
135
- ARG VERSION
136
- # Force static versioning within container
137
- RUN echo "${VERSION}" > /src/nitransforms/nitransforms/VERSION && \
138
- echo "include nitransforms/VERSION" >> /src/nitransforms/MANIFEST.in && \
139
- pip install --no-cache-dir "/src/nitransforms[all]"
137
+ RUN pip install --no-cache-dir "/src/nitransforms[all]"
140
138
141
139
RUN find $HOME -type d -exec chmod go=u {} + && \
142
140
find $HOME -type f -exec chmod go=u {} +
You can’t perform that action at this time.
0 commit comments