|
| 1 | +variables: |
| 2 | + GIT_SSL_NO_VERIFY: "1" |
| 3 | + |
1 | 4 | stages:
|
2 |
| -- build |
3 |
| -- test |
4 |
| -- deploy |
| 5 | +# - sync |
| 6 | + - build |
| 7 | + - test |
| 8 | + - deploy |
| 9 | + |
| 10 | +# github:push: |
| 11 | +# stage: sync |
| 12 | +# image: condaforge/mambaforge |
| 13 | +# tags: |
| 14 | +# - linux |
| 15 | +# before_script: |
| 16 | +# - git submodule update --init --recursive --remote |
| 17 | +# script: |
| 18 | +# - git switch -c ${CI_COMMIT_REF_NAME} |
| 19 | +# - git push --force https://${GITHUB_TOKEN}@github.com/fluorescence-tools/imp.bff |
| 20 | + |
5 | 21 |
|
| 22 | +# general definitions |
6 | 23 | .build: &build
|
7 | 24 | stage: build
|
8 | 25 | artifacts:
|
9 | 26 | paths:
|
10 | 27 | - bld-dir/
|
11 |
| -.build_posix: &build_posix |
12 |
| - <<: *build |
| 28 | +.conda:build:posix: &conda_build_posix |
| 29 | + <<: *build |
13 | 30 | script:
|
14 | 31 | - ./tools/build.sh
|
15 |
| -.build:lnx: &build_lnx |
16 |
| - <<: *build_posix |
| 32 | +.conda:build:lnx: &conda_build_lnx |
| 33 | + <<: *conda_build_posix |
17 | 34 | before_script:
|
18 | 35 | - source "/opt/conda/etc/profile.d/conda.sh"
|
19 | 36 | - conda activate /opt/conda/
|
| 37 | + - git config --global safe.directory '*' |
20 | 38 | - git submodule update --init --recursive --remote
|
21 |
| -build:lnx_x86: |
22 |
| - <<: *build_lnx |
| 39 | + |
| 40 | +# linux conda builds |
| 41 | +conda:build:lnx:x86: |
| 42 | + <<: *conda_build_lnx |
23 | 43 | image:
|
24 |
| - name: condaforge/linux-anvil-cos7-x86_64 |
25 | 44 | entrypoint: [ "/bin/bash", "-i", "-c" ]
|
| 45 | + name: condaforge/linux-anvil-cos7-x86_64 |
26 | 46 | tags:
|
| 47 | + - linux |
27 | 48 | - x86_64
|
28 |
| -build:lnx_ppc64le: |
29 |
| - <<: *build_lnx |
| 49 | +conda:build:lnx:ppc64le: |
| 50 | + <<: *conda_build_lnx |
30 | 51 | image:
|
31 |
| - name: condaforge/linux-anvil-ppc64le |
32 | 52 | entrypoint: [ "/bin/bash", "-i", "-c" ]
|
| 53 | + name: condaforge/linux-anvil-ppc64le |
33 | 54 | tags:
|
| 55 | + - linux |
34 | 56 | - ppc64le
|
35 |
| -build:lnx_aarch64: |
36 |
| - <<: *build_lnx |
| 57 | +conda:build:lnx:aarch64: |
| 58 | + <<: *conda_build_lnx |
37 | 59 | image:
|
38 |
| - name: condaforge/linux-anvil-aarch64 |
39 | 60 | entrypoint: [ "/bin/bash", "-i", "-c" ]
|
| 61 | + name: condaforge/linux-anvil-aarch64 |
40 | 62 | tags:
|
| 63 | + - linux |
41 | 64 | - aarch64
|
42 |
| -build:osx: |
43 |
| - <<: *build |
44 |
| - <<: *build_posix |
| 65 | + |
| 66 | +conda:build:osx: |
| 67 | + <<: *conda_build_posix |
45 | 68 | tags:
|
46 | 69 | - osx
|
47 | 70 | before_script:
|
48 | 71 | - git submodule update --init --recursive --remote
|
49 |
| -build:windows: |
| 72 | + |
| 73 | +conda:build:windows: |
50 | 74 | <<: *build
|
51 |
| - image: mambaforge:vs16 |
52 | 75 | tags:
|
53 | 76 | - win
|
54 | 77 | script:
|
55 |
| - - cmd.exe |
56 | 78 | - conda activate base
|
57 |
| - - cd tools && git pull --force && cd.. |
58 | 79 | - .\tools\build.bat
|
59 | 80 |
|
60 |
| -test:linux: |
| 81 | +conda:test:linux: |
61 | 82 | stage: test
|
62 | 83 | tags:
|
63 |
| - - local |
| 84 | + - local # go for a server marked as local |
64 | 85 | - linux
|
65 | 86 | image: condaforge/mambaforge
|
66 |
| - needs: ["build:lnx_x86"] |
| 87 | + needs: ["conda:build:lnx:x86"] |
67 | 88 | before_script:
|
68 | 89 | - |
|
69 | 90 | export DEBIAN_FRONTEND=interactive
|
70 | 91 | export TZ=Europe/Berlin
|
71 | 92 | apt-get update -qy && apt-get install -qy git nfs-common # sshfs
|
72 | 93 | script:
|
73 | 94 | - |
|
74 |
| - # requires runner in privileged mode see (https://gitlab.com/gitlab-org/gitlab-runner/-/issues/4122) |
75 | 95 | source activate base
|
76 | 96 | conda config --add channels "file://`pwd`/bld-dir"
|
77 |
| - git clone --depth 1 https://gitlab.peulen.xyz/skf/tttrlib && cd tttrlib && git fetch && git switch $CI_COMMIT_REF_NAME |
| 97 | + git clone https://gitlab.peulen.xyz/skf/tttrlib && cd tttrlib && git fetch && git switch $CI_COMMIT_REF_NAME |
78 | 98 | mamba install python tttrlib nose scipy
|
79 |
| - mount.nfs -o nolock 192.168.124.254:tank/www /srv |
| 99 | + # requires runner in privileged mode see |
| 100 | + mount.nfs -o nolock 192.168.124.254:/mnt/user/www /srv |
80 | 101 | # sshfs -o password_stdin -oStrictHostKeyChecking=no -o Ciphers=aes128-ctr -o Compression=yes -p 2222 $FTP_USERNAME@peulen.xyz:/www www <<< $FTP_PASSWORD
|
81 | 102 | ln -s /srv/tttr-data tttr-data
|
82 | 103 | nosetests test
|
83 | 104 |
|
84 |
| -deploy:conda: |
| 105 | +conda:deploy: |
85 | 106 | stage: deploy
|
86 | 107 | image: condaforge/mambaforge
|
87 | 108 | tags:
|
88 |
| - - x86_64 |
89 | 109 | - linux
|
90 | 110 | before_script:
|
91 | 111 | - git submodule update --init --recursive --remote
|
92 | 112 | script:
|
93 | 113 | - ./tools/deploy.sh
|
94 | 114 |
|
95 | 115 | deploy:doc:
|
96 |
| -# requires runner in privileged mode (setup in config.toml) |
| 116 | + # requires runner in privileged mode (setup in config.toml) |
97 | 117 | stage: deploy
|
98 | 118 | image: condaforge/mambaforge
|
99 | 119 | tags:
|
100 | 120 | - local
|
101 | 121 | - linux
|
102 |
| - needs: ["build:lnx_x86"] |
| 122 | + needs: ["conda:build:lnx:x86"] |
103 | 123 | before_script:
|
104 | 124 | - |
|
105 | 125 | export DEBIAN_FRONTEND=interactive
|
106 | 126 | export TZ=Europe/Berlin
|
107 | 127 | apt-get update -qy && apt-get install -qy git nfs-common make
|
108 | 128 | script:
|
109 |
| - - | |
110 |
| - source activate base |
111 |
| - git clone --depth 1 https://gitlab.peulen.xyz/skf/tttrlib && cd tttrlib && git fetch && git switch $CI_COMMIT_REF_NAME |
112 |
| - mount.nfs -o nolock 192.168.124.254:tank/www /srv && ln -s /srv/tttr-data tttr-data |
113 |
| - cd doc && mamba env update --file environment.yml && conda activate doc |
114 |
| - make html |
115 |
| - if [[ "$CI_COMMIT_REF_NAME" == "master" ]]; then rm -rf /srv/docs.peulen.xyz/tttrlib && mv -v _build/html/stable /srv/docs.peulen.xyz/tttrlib; fi |
| 129 | + - conda config --add channels "file://`pwd`/bld-dir" |
| 130 | + - mount.nfs -o nolock 192.168.124.254:/mnt/user/www /srv |
| 131 | + - ln -s /srv/tttr-data tttr-data |
| 132 | + - cd doc |
| 133 | + - source activate base |
| 134 | + - mamba env create -f environment.yml |
| 135 | + - conda activate doc-tttrlib |
| 136 | + - mamba install tttrlib --use-local |
| 137 | + - make html |
| 138 | + - rm -rf /srv/docs.peulen.xyz/project/$CI_PROJECT_TITLE/$CI_COMMIT_REF_NAME |
| 139 | + - mv -v _build/html/stable /srv/docs.peulen.xyz/project/$CI_PROJECT_TITLE/$CI_COMMIT_REF_NAME |
| 140 | + |
| 141 | +wheel:linux: |
| 142 | + stage: build |
| 143 | + tags: |
| 144 | + - linux |
| 145 | + image: python:3.8 |
| 146 | + # make a docker daemon available for cibuildwheel to use |
| 147 | + services: |
| 148 | + - name: docker:dind |
| 149 | + entrypoint: ["env", "-u", "DOCKER_HOST"] |
| 150 | + command: ["dockerd-entrypoint.sh"] |
| 151 | + variables: |
| 152 | + DOCKER_HOST: tcp://docker:2375/ |
| 153 | + DOCKER_DRIVER: overlay2 |
| 154 | + # See https://github.com/docker-library/docker/pull/166 |
| 155 | + DOCKER_TLS_CERTDIR: "" |
| 156 | + script: |
| 157 | + - curl -sSL https://get.docker.com/ | sh |
| 158 | + - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes |
| 159 | + - python -m pip install cibuildwheel==2.12.1 |
| 160 | + - git submodule update --init --recursive --remote |
| 161 | + - cibuildwheel --output-dir bld-dir --platform linux |
| 162 | + - python -m pip install --upgrade pip |
| 163 | + - pip install twine |
| 164 | + - export TWINE_PASSWORD="$PYPI_TOKEN" |
| 165 | + - if [ "$CI_COMMIT_REF_NAME" != "master" ]; then export TWINE_REPOSITORY=testpypi; export TWINE_PASSWORD="$PYPI_TEST_TOKEN"; fi |
| 166 | + - twine upload --skip-existing bld-dir/*.whl |
| 167 | + artifacts: |
| 168 | + paths: |
| 169 | + - bld-dir/ |
| 170 | + |
| 171 | +wheel:osx: |
| 172 | + stage: build |
| 173 | + tags: |
| 174 | + - osx |
| 175 | + script: |
| 176 | + - conda deactivate |
| 177 | + - python3 -m pip install cibuildwheel==2.12.1 |
| 178 | + - git submodule update --init --recursive --remote |
| 179 | + - cibuildwheel --output-dir bld-dir --platform macos |
| 180 | + - python3 -m pip install --upgrade pip |
| 181 | + - python3 -m pip install twine |
| 182 | + - export TWINE_PASSWORD="$PYPI_TOKEN" |
| 183 | + - if [ "$CI_COMMIT_REF_NAME" != "master" ]; then export TWINE_REPOSITORY=testpypi; export TWINE_PASSWORD="$PYPI_TEST_TOKEN"; fi |
| 184 | + - python3 -m twine upload --skip-existing bld-dir/*.whl |
| 185 | + artifacts: |
| 186 | + paths: |
| 187 | + - bld-dir/ |
| 188 | + |
| 189 | +wheel:windows: |
| 190 | + <<: *build |
| 191 | + image: wheel:win |
| 192 | + script: |
| 193 | + - | |
| 194 | + conda deactivate |
| 195 | + set-content $env:public\inline.cmd -Value @' |
| 196 | + call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" |
| 197 | + py -m cibuildwheel --output-dir bld-dir --platform windows |
| 198 | + set TWINE_PASSWORD=%PYPI_TOKEN% |
| 199 | + if %CI_COMMIT_REF_NAME% NEQ master set TWINE_REPOSITORY=testpypi |
| 200 | + if %CI_COMMIT_REF_NAME% NEQ master set TWINE_PASSWORD=%PYPI_TEST_TOKEN% |
| 201 | + twine upload --skip-existing bld-dir/*.whl |
| 202 | + '@ |
| 203 | + CMD.EXE /C $env:public\inline.cmd |
| 204 | + tags: |
| 205 | + - win |
0 commit comments