-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
53 lines (48 loc) · 2.06 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
53 lines (48 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# GitLab CI mirror of .github/workflows/ci.yml. This repository's source of truth is GitLab; GitHub is a
# downstream mirror. Keep this file and the GitHub Actions workflow in sync (same Java runtime and verification).
stages:
- test
- live
default:
image: maven:3.9.16-eclipse-temurin-25-noble@sha256:d67198007bb4441b07d45587320f83154de80ece3608f80408ef14c6ea847753
cache:
key: "$CI_COMMIT_REF_SLUG"
paths:
- .m2/repository
variables:
# Cache Maven downloads inside the project so GitLab can cache them between runs.
MAVEN_OPTS: "-Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository"
MAVEN_CLI_OPTS: "--batch-mode --no-transfer-progress"
# Compile and verify on the current Java LTS bytecode baseline.
test:jdk25:
stage: test
script:
- mvn $MAVEN_CLI_OPTS verify
- mvn $MAVEN_CLI_OPTS -DskipTests -Prelease package
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH
- if: $CI_COMMIT_TAG
sandbox:live:
stage: live
timeout: 45m
resource_group: assinafy-sandbox-live
environment:
name: sandbox
action: verify
variables:
ASSINAFY_BASE_URL: "https://sandbox.assinafy.com.br/v1"
ASSINAFY_LIVE_EMAILS: "false"
script:
- |
test -n "${ASSINAFY_API_KEY:-}" || { echo "ASSINAFY_API_KEY CI/CD variable is required"; exit 1; }
test -n "${ASSINAFY_ACCOUNT_ID:-}" || { echo "ASSINAFY_ACCOUNT_ID CI/CD variable is required"; exit 1; }
test -n "${ASSINAFY_TEST_EMAIL:-}" || { echo "ASSINAFY_TEST_EMAIL CI/CD variable is required"; exit 1; }
test -n "${ASSINAFY_SECOND_TEST_EMAIL:-}" || { echo "ASSINAFY_SECOND_TEST_EMAIL CI/CD variable is required"; exit 1; }
case "$ASSINAFY_LIVE_EMAILS" in true|false) ;; *) echo "ASSINAFY_LIVE_EMAILS must be true or false"; exit 1 ;; esac
mvn $MAVEN_CLI_OPTS -Dtest=LiveSmokeTest test
rules:
- if: '$CI_PIPELINE_SOURCE == "web" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: manual
allow_failure: false
manual_confirmation: "Run the sandbox live tests? Enable ASSINAFY_LIVE_EMAILS only to send real email."