forked from kubernetes/autoscaler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
47 lines (41 loc) · 1.85 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
include:
- project: 'crusoeenergy/tools'
file: '/templates/go.gitlab-ci.yml'
variables:
CI_IMAGE: registry.gitlab.com/crusoeenergy/tools/go-ci-1.22
SUBPROJECT: cluster-autoscaler
SUBPROJECT_PATH: cluster-autoscaler/
SUBPROJECT_REL_PATH: ./cluster-autoscaler
REPOSITORY: registry.gitlab.com/crusoeenergy/island/external/k8s-autoscaler
test_and_lint:
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH !~ /^crusoe-cluster-autoscaler-/'
changes: !reference [.code-changes, changes]
- if: '$CI_MERGE_REQUEST_ID'
changes: !reference [.code-changes, changes]
# don't run CI for semver tags, do run it for custom tags
- if: '$CI_COMMIT_TAG && $CI_COMMIT_TAG !~ /^crusoe-cluster-autoscaler-release-[0-9]+\.[0-9]+\.[0-9]+.+/'
build_and_push:
script:
- |-
if [ "${BUILD_IN_SUBPATH:-true}" == "true" ]; then
cd ${SUBPROJECT_REL_PATH}
fi
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com
# Build an image based on the commit ref, this will be available
# internally for testing feature branches and testing pre-release versions
#- docker build --no-cache --pull -f "${DOCKERFILE:-./Dockerfile}" --build-arg CI_SERVER_HOST="$CI_SERVER_HOST" --build-arg CI_JOB_TOKEN="$CI_JOB_TOKEN" --build-arg CRUSOE_CLOUD_CONTROLLER_MANAGER_NAME="$CRUSOE_CLOUD_CONTROLLER_MANAGER_NAME" --build-arg CRUSOE_CLOUD_CONTROLLER_MANAGER_VERSION="$CI_COMMIT_REF_NAME" -t $RELEASE_IMAGE:"${CI_COMMIT_REF_NAME##*/}" .
#- docker push $RELEASE_IMAGE:"${CI_COMMIT_REF_NAME##*/}"
- yes | make dev-release
# Remove the tag_semver and pages jobs from merges into main.
# The tag_semver job will be run using a GitHub action instead
# and new versions will be pushed then.
tag_semver:
rules:
- when: never
code_intelligence:
rules:
- when: never
pages:
rules:
- when: never