11version : 2.1
22
33executors :
4- python-executor :
5- working_directory : ~/phovea
6- docker :
7- - image : circleci/python:3.7-buster-node-browsers # for node version see Dockerfile on https://hub.docker.com/r/circleci/python
84 node-executor :
95 working_directory : ~/phovea
106 docker :
117 - image : circleci/node:12.13-buster-browsers
128
139jobs :
14- python-build :
15- executor : python-executor
16- steps :
17- - checkout
18- - run :
19- name : Show Node.js and npm version
20- command : |
21- node -v
22- npm -v
23- - run :
24- name : Show Python and pip version
25- command : |
26- python --version
27- pip --version
28- - run :
29- name : Install Docker packages from docker_packages.txt
30- command : |
31- (!(test -f docker_packages.txt) || (cat docker_packages.txt | xargs sudo apt-get install -y))
32- - restore_cache :
33- key : deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements_dev.txt" }}
34- - run :
35- name : Install pip requirements
36- command : |
37- virtualenv ~/venv
38- . ~/venv/bin/activate
39- pip install -r requirements_dev.txt
40- pip install -r requirements.txt
41- - save_cache :
42- key : deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements_dev.txt" }}
43- paths :
44- - ~/venv
45- - run :
46- name : Force an update of pip dependencies from git repositories # not sure if this is working ?
47- command : |
48- . ~/venv/bin/activate
49- pip install --upgrade --upgrade-strategy=only-if-needed -r requirements.txt
50- - run :
51- name : Show installed pip packages
52- command : pip list || true
53- - run :
54- name : Build
55- command : |
56- . ~/venv/bin/activate
57- npm run dist
58- - store_artifacts :
59- path : dist
60- destination : dist
61- - persist_to_workspace :
62- root : ~/phovea
63- paths : .
64- python-publish :
65- executor : python-executor
66- steps :
67- - attach_workspace :
68- at : ~/phovea
69- - run :
70- name : Install twine
71- command : |
72- . ~/venv/bin/activate \
73- pip install twine \
74- - run :
75- name : Authentication
76- command : |
77- echo -e "[pypi]" >> ~/.pypirc
78- echo -e "repository = $PYPI_REPOSITORY" >> ~/.pypirc
79- echo -e "username = $PYPI_USERNAME" >> ~/.pypirc
80- echo -e "password = $PYPI_PASSWORD" >> ~/.pypirc
81- - run :
82- name : Publish package
83- command : |
84- . venv/bin/activate
85- twine upload dist/*
86- web-build :
10+ build :
8711 executor : node-executor
8812 steps :
8913 - checkout
@@ -118,14 +42,14 @@ jobs:
11842 - persist_to_workspace :
11943 root : ~/phovea
12044 paths : .
121- web- publish :
45+ publish :
12246 executor : node-executor
12347 steps :
12448 - attach_workspace :
12549 at : ~/phovea
12650 - run :
12751 name : Authentication
128- command : |
52+ command : |
12953 echo -e "registry=https://$NPM_REPOSITORY" >> ~/phovea/.npmrc
13054 echo -e "//$NPM_REPOSITORY:authToken=$NPM_TOKEN" >> ~/phovea/.npmrc
13155 - run :
@@ -142,51 +66,28 @@ workflows:
14266# only:
14367# - develop
14468# jobs:
145- # - python-build
146- # - web-build
69+ # - build
14770 build-branches-only :
14871 jobs :
149- - python- build :
72+ - build :
15073 filters :
15174 tags :
15275 ignore : /.*/
153- - web-build :
154- filters :
155- tags :
156- ignore : /.*/
15776 build-publish-tag :
15877 jobs :
159- - python- build :
78+ - build :
16079 filters :
16180 branches :
16281 ignore : /.*/
16382 tags :
16483 only : /^v.*/
165- - web-build :
84+ - publish :
85+ context :
86+ - org-public
87+ requires :
88+ - build
16689 filters :
16790 branches :
16891 ignore : /.*/
16992 tags :
17093 only : /^v.*/
171- - python-publish :
172- context :
173- - org-public
174- requires :
175- - python-build
176- - web-build
177- filters :
178- branches :
179- ignore : /.*/
180- tags :
181- only : /^v.*/
182- - web-publish :
183- context :
184- - org-public
185- requires :
186- - python-build
187- - web-build
188- filters :
189- branches :
190- ignore : /.*/
191- tags :
192- only : /^v.*/
0 commit comments