-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
49 lines (40 loc) · 1.4 KB
/
.gitlab-ci.yml
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
variables:
ENGINE_VERSION: 4.26.0
UE4DOCKER_TAG_NAMESPACE: $CI_REGISTRY/piperift
# UE4DOCKER_USERNAME: Github username with access to ue4. Defined somewhere else
# UE4DOCKER_PASSWORD: Github token. Defined somewhere else.
UE4_MINIMAL_IMAGE: $UE4DOCKER_TAG_NAMESPACE/ue4-minimal
UE4_FULL_IMAGE: $UE4DOCKER_TAG_NAMESPACE/ue4-full
stages:
- build
- push
before_script:
- pip install ue4-docker
- ue4-docker setup
- ue4-docker clean --prune
build:
stage: build
tags: [ue4-image-builder]
only:
- branches
script:
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
- ue4-docker build ${ENGINE_VERSION} --no-engine --pull-prerequisites --exclude templates --monitor
- docker push ${UE4_MINIMAL_IMAGE}:${ENGINE_VERSION}
- docker push ${UE4_FULL_IMAGE}:${ENGINE_VERSION}
push_latest:
stage: push
tags: [ue4-image-builder]
rules:
- if: '$CI_COMMIT_BRANCH == "main"'
when: on_success
script:
- docker pull ${UE4_MINIMAL_IMAGE}:${ENGINE_VERSION}
- docker pull ${UE4_FULL_IMAGE}:${ENGINE_VERSION}
- docker image tag ${UE4_MINIMAL_IMAGE}:${ENGINE_VERSION} ${UE4_MINIMAL_IMAGE}:latest
- docker image tag ${UE4_FULL_IMAGE}:${ENGINE_VERSION} ${UE4_FULL_IMAGE}:latest
- docker push ${UE4_MINIMAL_IMAGE}:latest
- docker push ${UE4_FULL_IMAGE}:latest
after_script:
- docker container prune -f
- ue4-docker clean --prune