Skip to content

Commit 3ddda2e

Browse files
phap7daniel-jones-dev
authored andcommitted
refactor: move parts of .gitlab-ci.yml to private repository
1 parent 248bce5 commit 3ddda2e

File tree

1 file changed

+15
-25
lines changed

1 file changed

+15
-25
lines changed

.gitlab-ci.yml

+15-25
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
# Note: This GitLab CI configuration is used for internal testing, users can ignore it.
2-
2+
include:
3+
- project: '${CI_PROJECT_NAMESPACE}/ci-libs-for-client-libraries'
4+
file:
5+
- '/${CI_PROJECT_NAME}/.gitlab-ci.yml'
6+
37
# Global --------------------------
48

59
image: python:3.10
610

711
variables:
812
PIP_CACHE_DIR: "${CI_PROJECT_DIR}/.cache/pip"
9-
13+
XDG_CACHE_HOME: "${CI_PROJECT_DIR}/.cache"
14+
POETRY_VIRTUALENVS_IN_PROJECT: "true"
15+
REQUESTS_CA_BUNDLE: "/etc/ssl/certs/ca-certificates.crt"
16+
1017
cache:
1118
key:
1219
prefix: ${CI_JOB_IMAGE}
@@ -24,9 +31,11 @@ stages:
2431
- publish
2532

2633
before_script:
34+
- python3 -m venv .venv
35+
- source .venv/bin/activate
36+
- pip install --upgrade pip
2737
- pip install poetry
2838
- poetry --version
29-
- poetry config virtualenvs.in-project true
3039
- poetry install -vv
3140

3241
# stage: check ----------------------
@@ -51,21 +60,9 @@ package:
5160

5261
# stage: test -------------------------
5362

54-
.use-test-server-template: &use_test_server_template
55-
secrets:
56-
DEEPL_AUTH_KEY:
57-
vault: jenkins/client_libraries/test_auth_key@backend
58-
file: false
59-
DEEPL_SERVER_URL:
60-
vault: jenkins/client_libraries/test_server_url@backend
61-
file: false
62-
6363
test:
64-
<<: *use_test_server_template
6564
stage: test
66-
services:
67-
- name: $DOCKER_REGISTRY/deepl/deepl-mock
68-
alias: deepl-mock
65+
extends: .test
6966
parallel:
7067
matrix:
7168
- DOCKER_IMAGE: "python:3.10"
@@ -119,18 +116,11 @@ test:
119116
# stage: publish -------------------------
120117

121118
pypi upload:
119+
extends: .publish
122120
stage: publish
123121
dependencies:
124122
- package
125123
rules:
126124
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/'
127125
script:
128-
- poetry publish --verbose --no-interaction --username $PYPI_USERNAME --password $PYPI_PASSWORD
129-
secrets:
130-
PYPI_USERNAME:
131-
vault: jenkins/client_libraries/pypi_username@backend
132-
file: false
133-
PYPI_PASSWORD:
134-
vault: jenkins/client_libraries/pypi_password@backend
135-
file: false
136-
126+
- poetry publish --verbose --no-interaction

0 commit comments

Comments
 (0)