forked from skwp/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
129 lines (124 loc) · 2.99 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
129 lines (124 loc) · 2.99 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
---
.defaults:
rules: &defaultRules
- if: $CI_PIPELINE_SOURCE =~ /(api|web*|schedule|trigger|pipeline)/
- if: $CI_MERGE_REQUEST_IID
- if: $CI_COMMIT_TAG
workflow:
rules:
- if: $CI_COMMIT_BRANCH &&
$CI_OPEN_MERGE_REQUESTS &&
$CI_PIPELINE_SOURCE == "push"
when: never
- *defaultRules
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_BRANCH =~ /mine/
default:
interruptible: true
timeout: 10m
cache: &defaultCache
key: $CI_COMMIT_REF_SLUG
fallback_keys:
- $CI_DEFAULT_BRANCH
#when: on_failure
paths:
- "root/bin/chezmoi"
variables:
DEBIAN_FRONTEND:
value: "noninteractive"
description: "Run apt and chezmoi non interactive"
MY_CHEZMOI_BIN: "./root/bin/chezmoi"
MY_CHEZMOI_ROOT: "root"
CHEZMOI_GITHUB_ACCESS_TOKEN:
value: "$gh_chezmoi"
description: "Raise Github Rate Limit"
install-script:
stage: test
parallel:
matrix:
- UBUNTU_TAG:
- ":26.04"
- ":24.04"
- ":22.04"
image: "ubuntu$UBUNTU_TAG"
variables:
LANGUAGE: en_US.UTF-8
LANG: en_US.UTF-8
rules:
- &encryptedRule
if: $CI_PIPELINE_SOURCE == "push"
when: never
changes:
paths:
- "$MY_CHEZMOI_ROOT/**/*encrypted_*"
- *defaultRules
- if: $CI_PIPELINE_SOURCE == "push"
changes:
paths:
- .chezmoiroot
- .chezmoiversion
- .gitlab-ci.yml
- install.sh
- "$MY_CHEZMOI_ROOT/**/.*"
- "$MY_CHEZMOI_ROOT/**/*"
before_script:
- apt-get update -qq
- apt-get install -qqy
locales
lsb-release
software-properties-common
- (
localedef -i ${LANGUAGE%\.*} -f ${LANGUAGE#*\.} $LANGUAGE
&&
/usr/sbin/update-locale LANG=$LANG
)
- apt-get install -qqy
curl
git
sudo
script:
- ./install.sh
- $MY_CHEZMOI_BIN data
- $MY_CHEZMOI_BIN ignored
- $MY_CHEZMOI_BIN managed -i all
- (
[ ! -d "${HOME}/.local/share/fonts" ]
||
ls -lha ~/.local/share/fonts/**/*/
)
docker-test:
stage: test
# Use the official docker image.
image: docker:latest
services:
- docker:dind
cache:
[]
variables:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: "/certs"
allow_failure: true
when: manual
rules:
- *defaultRules
- if: $CI_PIPELINE_SOURCE == "push"
when: on_success
changes:
paths:
- .dockerignore
- Dockerfile
- compose.yaml
- install.sh
- if: $CI_PIPELINE_SOURCE == "push"
before_script:
- |
if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then
tag=""
echo "Running on default branch '$CI_DEFAULT_BRANCH': tag = 'latest'"
else
tag=":$CI_COMMIT_REF_SLUG"
echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag"
fi
script:
- docker build --pull -t "$CI_REGISTRY_IMAGE${tag}" .
# - docker push "$CI_REGISTRY_IMAGE${tag}"