
Hola a todos.
El artículo está escrito en un estilo simple "DevOps para amas de casa" de las mismas amas de casa. Describirá las sorpresas que puede encontrar al configurar un proyecto en TeamCity. También daré recomendaciones sobre cómo se pueden eludir estos problemas.
Lo siguiente se basa en mis dos años de experiencia configurando compilaciones de TeamCity, leyendo informes de errores e intercambiando opiniones con colegas en el taller. No pretendo ser la verdad última, ya que el enfoque SDD (Stackoverflow Driven Development) se utilizó principalmente en el trabajo.
Un poco de ayuda:
- TeamCity — CI (Continous Integration) . "" Gitlab CI, Github Actions .
- (Project) — , . TeamCity ->-> .
- (Build) — . " ", " ", " ". .
- (Build step) — " " "runner type". Bash , Docker .
TeamCity :
- ~30 , Bash, Ansible Python.
- Android , Web , Docker, k8s . , , .
- , Kotlin DSL ( ).
, . "".
1
( ). : , git , cron . .
: . 2008 .
, : . . 1 , 1 . , . .
, build chain ( ). , .
2 Build chain or not —
( + ) build chain. , . , ?
: ( ). . , ( ). , .
, ? , . — . , , , . , "" , ( , ), .
, "" , , : . . : , .
3
3*N , . , , . "", . N , . , , . , , .
, , YAML Developer'.
4
Kotlin DSL ( , ). , : , ?
: " ". : ( ).
- , . — Kotlin DSL.
: / , . , - ID , .
5 TeamCity API
"" 4 DevOps. TeamCity , ("Deployment Frequency" "Lead Time for Changes").
API , . , - , , . , "Assign investigation", . .
, API — build chain - "" . . Python . .
6 Bash
, :
./command_1.sh # always fail
ls # always success
. :
./command_1.sh # always fail
if [ $? -ne 0 ]; then
echo "##teamcity[buildProblem description='Build failed']"
fi
ls # always success
7
TeamCity -, API . , *
. : . echo
— . :
cat > constants.json <<- EOM
{
"key": "%value%"
}
EOM
, , . Python , , JSON. ? , : JSON, , TeamCity. , : JSON. JSON TeamCity . JSON , .
8
. ( Kotlin DSL + TeamCity API), . . ( Firefox Network).
-
- load: 9.87 s
- DOMContentLoaded: 4.92 s
- Finish: 34.39 s
- Size/transferred size of all requests: 10.69 MB / 2.42 MB
- Requests: 345
-
- load: 4.59 s
- DOMContentLoaded: 1.27 s
- Finish: 27.42 s
- Size/transferred size of all requests: 11.53 MB / 2.23 MB
- Requests: 120
Finish — . . , ?
9
. Overview. . 99% . ( -) — ", stderr
", ", stderr
". Ansible - "WARNING: Deprecation setting...". TeamCity. .
10
, (Build agents). TeamCity master , , . (), TeamCity .
— . - , , . , - JAVA_HOME
. . . - , . ( TeamCity "").
— , . , "". , . . " !" — . : build chain? , , , . , "Run build on the same agent". , ?
— . (, root
, ). - , . 90% — print("Hello, World!")
.
( ). , . " — ".