-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add base image for gitlab runner to speed up tests (#458)
* Add base image for gitlab runner to speed up tests * Only install dependencies --------- Co-authored-by: Jan Makovecki <[email protected]>
- Loading branch information
1 parent
fdb275c
commit fdd8333
Showing
2 changed files
with
26 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,25 @@ | ||
image: python:3.9 | ||
|
||
stages: | ||
- update | ||
- test | ||
|
||
update_base_image: | ||
stage: update | ||
image: docker:latest | ||
rules: | ||
- if: '$UPDATE_BASE_IMAGE == "true"' | ||
script: | ||
- docker login -u gitlab-ci-token -p "$CI_JOB_TOKEN" "$CI_REGISTRY" | ||
- docker build --file=".gitlab/docker/Dockerfile" --tag="$BASE_IMAGE" . | ||
- docker push "$BASE_IMAGE" | ||
|
||
run_sh_integration_tests: | ||
stage: test | ||
when: always | ||
before_script: | ||
- apt-get update | ||
- apt-get install -y build-essential libgdal-dev proj-bin gcc libproj-dev libspatialindex-dev libopenjp2-7 | ||
image: "$BASE_IMAGE" | ||
dependencies: [ ] | ||
needs: [ ] | ||
rules: | ||
- when: always | ||
if: '$UPDATE_BASE_IMAGE != "true"' | ||
script: | ||
- pip install -e .[AWS,DEV] | ||
- pytest -m "sh_integration" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM python:3.9 | ||
|
||
COPY . /sentinelhub-py | ||
RUN cd sentinelhub-py && \ | ||
python -m pip install pip-tools && \ | ||
python -m piptools compile -o requirements.txt pyproject.toml --extra dev --extra aws && \ | ||
python -m pip install -r requirements.txt && \ | ||
python -m pip uninstall pip-tools && \ | ||
rm -r /sentinelhub-py |