ΠΠ°Π½Π½Π°Ρ ΡΡΠ°ΡΡΡ ΡΠ°ΡΡΡΠΈΡΠ°Π½Π° Π½Π° java ΡΠ°Π·ΡΠ°Π±ΠΎΡΡΠΈΠΊΠΎΠ², Ρ ΠΊΠΎΡΠΎΡΡΡ Π²ΠΎΠ·Π½ΠΈΠΊΠ»Π° ΠΏΠΎΡΡΠ΅Π±Π½ΠΎΡΡΡ Π±ΡΡΡΡΠΎ ΠΏΡΠ±Π»ΠΈΠΊΠΎΠ²Π°ΡΡ ΡΠ²ΠΎΠΈ ΠΏΡΠΎΠ΄ΡΠΊΡΡ Π² ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΡΡ sonatype ΠΈ/ΠΈΠ»ΠΈ maven central Ρ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΠ΅ΠΌ GitLab. Π Π΄Π°Π½Π½ΠΎΠΉ ΡΡΠ°ΡΡΠ΅ Ρ ΡΠ°ΡΡΠΊΠ°ΠΆΡ ΠΏΡΠΎ Π½Π°ΡΡΡΠΎΠΉΠΊΡ gitlab-runner, gitlab-ci ΠΈ maven-plugin Π΄Π»Ρ ΡΠ΅ΡΠ΅Π½ΠΈΡ Π΄Π°Π½Π½ΠΎΠΉ Π·Π°Π΄Π°ΡΠΈ.
ΠΡΠ΅Π΄ΠΏΠΎΡΡΠ»ΠΊΠΈ:
- ΠΠ΅Π·ΠΎΠΏΠ°ΡΠ½ΠΎΠ΅ Ρ ΡΠ°Π½Π΅Π½ΠΈΠ΅ mvn ΠΈ GPG ΠΊΠ»ΡΡΠ΅ΠΉ.
- ΠΠ΅Π·ΠΎΠΏΠ°ΡΠ½ΠΎΠ΅ Π²ΡΠΏΠΎΠ»Π½Π΅Π½ΠΈΠ΅ ΠΏΡΠ±Π»ΠΈΡΠ½ΡΡ CI Π·Π°Π΄Π°Ρ.
- ΠΠ°Π³ΡΡΠ·ΠΊΠ° Π°ΡΡΠ΅ΡΠ°ΠΊΡΠΎΠ² (release/snapshot) Π² ΠΏΡΠ±Π»ΠΈΡΠ½ΡΠ΅ ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠΈ.
- ΠΠ²ΡΠΎΠΌΠ°ΡΠΈΡΠ΅ΡΠΊΠ°Ρ ΠΏΡΠΎΠ²Π΅ΡΠΊΠ° release-Π²Π΅ΡΡΠΈΠΉ Π΄Π»Ρ ΠΏΡΠ±Π»ΠΈΠΊΠ°ΡΠΈΠΈ Π² maven central.
- ΠΠ±ΡΠ΅Π΅ ΡΠ΅ΡΠ΅Π½ΠΈΠ΅ ΠΏΠΎ Π·Π°Π³ΡΡΠ·ΠΊΠ΅ Π°ΡΡΠ΅ΡΠ°ΠΊΡΠΎΠ² Π² ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠΉ Π΄Π»Ρ Π½Π΅ΡΠΊΠΎΠ»ΡΠΊΠΈΡ ΠΏΡΠΎΠ΅ΠΊΡΠΎΠ².
- ΠΡΠΎΡΡΠΎΡΠ° ΠΈ ΡΠ΄ΠΎΠ±ΡΡΠ²ΠΎ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΡ.
Π‘ΠΎΠ΄Π΅ΡΠΆΠ°Π½ΠΈΠ΅
ΠΠ±ΡΠ°Ρ ΠΈΠ½ΡΠΎΡΠΌΠ°ΡΠΈΡ ΠΠ°ΡΡΡΠΎΠΉΠΊΠ° deploy ΡΠΎΠ΅ΠΊΡΠ° Π² GitLab GitLab Runner GitLab CI ΠΠΎΠ½ΡΠΈΠ³ΡΡΠ°ΡΠΈΡ pom.xml Π Π΅Π·ΡΠ»ΡΡΠ°Ρ ΠΠ°ΠΊΠ»ΡΡΠ΅Π½ΠΈΠ΅
ΠΠ±ΡΠ°Ρ ΠΈΠ½ΡΠΎΡΠΌΠ°ΡΠΈΡ
- ΠΠΎΠ΄ΡΠΎΠ±Π½ΠΎΠ΅ ΠΎΠΏΠΈΡΠ°Π½ΠΈΠ΅ ΠΌΠ΅Ρ
Π°Π½ΠΈΠ·ΠΌΠ° ΠΏΡΠ±Π»ΠΈΠΊΠ°ΡΠΈΠΈ Π°ΡΡΠ΅ΡΠ°ΠΊΡΠΎΠ² Π² Maven Central ΡΠ΅ΡΠ΅Π· Sonatype OSS Repository Hosting Service ΡΠΆΠ΅ ΠΎΠΏΠΈΡΠ°Π½ΠΎ Π²
Π΄Π°Π½Π½ΠΎΠΉ ΡΡΠ°ΡΡΠ΅ ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»Π΅ΠΌGoogolplex , ΠΏΠΎΡΡΠΎΠΌΡ Π² Π½ΡΠΆΠ½ΡΡ ΠΌΠ΅ΡΡΠ°Ρ Π±ΡΠ΄Ρ ΡΡΡΠ»Π°ΡΡΡΡ Π½Π° Π΄Π°Π½Π½ΡΡ ΡΡΠ°ΡΡΡ. - ΠΡΠ΅Π΄Π²Π°ΡΠΈΡΠ΅Π»ΡΠ½ΠΎ ΡΠ΅Π³ΠΈΡΡΡΠΈΡΡΠ΅ΠΌΡΡ Π²
Sonatype JIRA ΠΈ Π·Π°Π²ΠΎΠ΄ΠΈΠΌ ΡΠΈΠΊΠ΅Ρ Π½Π° ΠΎΡΠΊΡΡΡΠΈΠ΅ ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΡ (Π±ΠΎΠ»Π΅Π΅ ΠΏΠΎΠ΄ΡΠΎΠ±Π½ΠΎ ΡΠΈΡΠ°ΡΡ ΡΠ°Π·Π΄Π΅Π»Π‘ΠΎΠ·Π΄Π°ΡΠΌ ΡΠΈΠΊΠ΅Ρ Π½Π° Sonatype JIRA ). ΠΠΎΡΠ»Π΅ ΠΎΡΠΊΡΡΡΠΈΡ ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΡ ΠΏΠ°ΡΠ° Π»ΠΎΠ³ΠΈΠ½/ΠΏΠ°ΡΠΎΠ»Ρ ΠΎΡ JIRA (Π΄Π°Π»Π΅Π΅ ΡΡΠ΅ΡΠ½Π°Ρ Π·Π°ΠΏΠΈΡΡ Sonatype) Π±ΡΠ΄Π΅Ρ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΡΡΡ Π΄Π»Ρ Π·Π°Π³ΡΡΠ·ΠΊΠΈ Π°ΡΡΠ΅ΡΠ°ΠΊΡΠΎΠ² Π² Sonatype nexus. - ΠΠ°Π»Π΅Π΅ ΠΏΡΠΎΡΠ΅ΡΡ Π³Π΅Π½Π΅ΡΠ°ΡΠΈΠΈ GPG ΠΊΠ»ΡΡΠ° ΠΎΠΏΠΈΡΠ°Π½ Π²Π΅ΡΡΠΌΠ° ΡΡΡ
ΠΎ. ΠΠΎΠ»Π΅Π΅ ΠΏΠΎΠ΄ΡΠΎΠ±Π½ΠΎ ΡΠΌΠΎΡΡΠ΅ΡΡ ΡΠ°Π·Π΄Π΅Π»
ΠΠ°ΡΡΡΠΎΠΉΠΊΠ° GnuPG Π΄Π»Ρ ΠΏΠΎΠ΄ΠΏΠΈΡΠΈ Π°ΡΡΠ΅ΡΠ°ΠΊΡΠΎΠ² - ΠΡΠ»ΠΈ Π²Ρ ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΠ΅ΡΠ΅ Linux ΠΊΠΎΠ½ΡΠΎΠ»Ρ Π΄Π»Ρ Π³Π΅Π½Π΅ΡΠ°ΡΠΈΠΈ GPG ΠΊΠ»ΡΡΠ° (gnupg/gnupg2), ΡΠΎ Π½Π΅ΠΎΠ±Ρ
ΠΎΠ΄ΠΈΠΌΠΎ ΡΡΡΠ°Π½ΠΎΠ²ΠΈΡΡ
rng-tools Π΄Π»Ρ Π³Π΅Π½Π΅ΡΠ°ΡΠΈΠΈ ΡΠ½ΡΡΠΎΠΏΠΈΠΈ. Π ΠΏΡΠΎΡΠΈΠ²Π½ΠΎΠΌ ΡΠ»ΡΡΠ°Π΅ Π³Π΅Π½Π΅ΡΠ°ΡΠΈΡ ΠΊΠ»ΡΡΠ° ΠΌΠΎΠΆΠ΅Ρ ΠΏΡΠΎΡ ΠΎΠ΄ΠΈΡΡ ΠΎΡΠ΅Π½Ρ Π΄ΠΎΠ»Π³ΠΎ. - Π‘Π΅ΡΠ²ΠΈΡΡ Ρ
ΡΠ°Π½Π΅Π½ΠΈΡ ΠΏΡΠ±Π»ΠΈΡΠ½ΡΡ
GPG ΠΊΠ»ΡΡΠ΅ΠΉ
http://keys.gnupg.net http://pool.sks-keyservers.net http://keyserver.ubuntu.com
ΠΠ°ΡΡΡΠΎΠΉΠΊΠ° deploy-ΠΏΡΠΎΠ΅ΠΊΡΠ° Π² GitLab
- Π ΠΏΠ΅ΡΠ²ΡΡ ΠΎΡΠ΅ΡΠ΅Π΄Ρ Π½Π΅ΠΎΠ±Ρ
ΠΎΠ΄ΠΈΠΌΠΎ ΡΠΎΠ·Π΄Π°ΡΡ ΠΈ Π½Π°ΡΡΡΠΎΠΈΡΡ ΠΏΡΠΎΠ΅ΠΊΡ, Π² ΠΊΠΎΡΠΎΡΠΎΠΌ Π±ΡΠ΄Π΅Ρ Ρ
ΡΠ°Π½ΠΈΡΡΡΡ pipeline, Π΄Π»Ρ Π΄Π΅ΠΏΠ»ΠΎΡ Π°ΡΡΠ΅ΡΠ°ΠΊΡΠΎΠ². Π‘Π²ΠΎΠΉ ΠΏΡΠΎΠ΅ΠΊΡ Ρ Π½Π°Π·Π²Π°Π» ΠΏΡΠΎΡΡΠΎ ΠΈ Π½Π΅Π·Π°ΠΌΡΡΠ»ΠΎΠ²Π°ΡΠΎ β
deploy - ΠΠΎΡΠ»Π΅ ΡΠΎΠ·Π΄Π°Π½ΠΈΡ ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΡ, Π½Π΅ΠΎΠ±Ρ
ΠΎΠ΄ΠΈΠΌΠΎ ΠΎΠ³ΡΠ°Π½ΠΈΡΠΈΡΡ Π΄ΠΎΡΡΡΠΏ Π½Π° ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΠ΅ ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΡ.
ΠΠ΅ΡΠ΅Ρ ΠΎΠ΄ΠΈΠΌ Π² ΠΏΡΠΎΠ΅ΠΊΡ -> Settings -> Repository -> Protected Branches. Π£Π΄Π°Π»ΡΠ΅ΠΌ Π²ΡΠ΅ ΠΏΡΠ°Π²ΠΈΠ»Π° ΠΈ Π΄ΠΎΠ±Π°Π²Π»ΡΠ΅ΠΌ Π΅Π΄ΠΈΠ½ΡΡΠ²Π΅Π½Π½ΠΎΠ΅ ΠΏΡΠ°Π²ΠΈΠ»ΠΎ Ρ Wildcard * Ρ ΠΏΡΠ°Π²ΠΎΠΌ Π½Π° push ΠΈ merge ΡΠΎΠ»ΡΠΊΠΎ Π΄Π»Ρ ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»Π΅ΠΉ Ρ ΡΠΎΠ»ΡΡ Maintainers. ΠΠ°Π½Π½ΠΎΠ΅ ΠΏΡΠ°Π²ΠΈΠ»ΠΎ Π±ΡΠ΄Π΅Ρ ΡΠ°Π±ΠΎΡΠ°ΡΡ Π΄Π»Ρ Π²ΡΠ΅Ρ ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»Π΅ΠΉ ΠΊΠ°ΠΊ Π΄Π°Π½Π½ΠΎΠ³ΠΎ ΠΏΡΠΎΠ΅ΠΊΡΠ°, ΡΠ°ΠΊ ΠΈ Π³ΡΡΠΏΠΏΡ Π² ΠΊΠΎΡΠΎΡΡΡ Π΄Π°Π½Π½ΡΠΉ ΠΏΡΠΎΠ΅ΠΊΡ Π²Ρ ΠΎΠ΄ΠΈΡ.
- ΠΡΠ»ΠΈ ΠΌΠ΅ΠΉΠ½ΡΠ΅ΠΉΠ½Π΅ΡΠΎΠ² Π½Π΅ΡΠΊΠΎΠ»ΡΠΊΠΎ, ΡΠΎ Π»ΡΡΡΠΈΠΌ ΡΠ΅ΡΠ΅Π½ΠΈΠ΅ΠΌ Π±ΡΠ΄Π΅Ρ ΠΎΠ³ΡΠ°Π½ΠΈΡΠΈΡΡ Π΄ΠΎΡΡΡΠΏ ΠΊ ΠΏΡΠΎΠ΅ΠΊΡΡ Π² ΠΏΡΠΈΠ½ΡΠΈΠΏΠ΅.
ΠΠ΅ΡΠ΅Ρ ΠΎΠ΄ΠΈΠΌ Π² ΠΏΡΠΎΠ΅ΠΊΡ -> Settings -> General -> Visibility, project features, permissions ΠΈ Π²ΡΡΡΠ°Π²Π»ΡΠ΅ΠΌ Project visibility Π² Π·Π½Π°ΡΠ΅Π½ΠΈΠ΅ Private.
Π£ ΠΌΠ΅Π½Ρ ΠΏΡΠΎΠ΅ΠΊΡ Π² ΠΏΡΠ±Π»ΠΈΡΠ½ΠΎΠΌ Π΄ΠΎΡΡΡΠΏΠ΅, ΡΠ°ΠΊ ΠΊΠ°ΠΊ Ρ ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΡ ΡΠΎΠ±ΡΡΠ²Π΅Π½Π½ΡΠΉ GitLab Runner ΠΈ Π΄ΠΎΡΡΡΠΏ Π½Π° ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΠ΅ ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΡ Π΅ΡΡΡ ΡΠΎΠ»ΡΠΊΠΎ Ρ ΠΌΠ΅Π½Ρ. ΠΡ ΠΈ ΡΠΎΠ±ΡΡΠ²Π΅Π½Π½ΠΎ Π½Π΅ Π² ΠΌΠΎΠΈΡ ΠΈΠ½ΡΠ΅ΡΠ΅ΡΠ°Ρ ΡΠ²Π΅ΡΠΈΡΡ ΠΏΡΠΈΠ²Π°ΡΠ½ΡΡ ΠΈΠ½ΡΠΎΡΠΌΠ°ΡΠΈΡ Π² ΠΏΡΠ±Π»ΠΈΡΠ½ΡΡ pipeline-Π»ΠΎΠ³Π°Ρ . - Π£ΠΆΠ΅ΡΡΠΎΡΠ΅Π½ΠΈΠ΅ ΠΏΡΠ°Π²ΠΈΠ» Π½Π° ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΠ΅ ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΡ
ΠΠ΅ΡΠ΅Ρ ΠΎΠ΄ΠΈΠΌ Π² ΠΏΡΠΎΠ΅ΠΊΡ -> Settings -> Repository -> Push Rules ΠΈ ΡΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°Π΅ΠΌ ΡΠ»Π°Π³ΠΈ Committer restriction, Check whether author is a GitLab user. Π’Π°ΠΊ ΠΆΠ΅ ΡΠ΅ΠΊΠΎΠΌΠ΅Π½Π΄ΡΡ Π½Π°ΡΡΡΠΎΠΈΡΡΠΏΠΎΠ΄ΠΏΠΈΡΡ ΠΊΠΎΠΌΠΌΠΈΡΠΎΠ² , ΠΈ ΡΡΡΠ°Π½ΠΎΠ²ΠΈΡΡ ΡΠ»Π°Π³ Reject unsigned commits. - ΠΠ°Π»Π΅Π΅ ΡΡΠ΅Π±ΡΠ΅ΡΡΡ Π½Π°ΡΡΡΠΎΠΈΡΡ ΡΡΠΈΠ³Π³Π΅Ρ Π΄Π»Ρ Π·Π°ΠΏΡΡΠΊΠ° Π·Π°Π΄Π°Ρ
ΠΠ΅ΡΠ΅Ρ ΠΎΠ΄ΠΈΠΌ Π² ΠΏΡΠΎΠ΅ΠΊΡ -> Settings -> CI / CD -> Pipeline triggers ΠΈ ΡΠΎΠ·Π΄Π°Π΅ΠΌ Π½ΠΎΠ²ΡΠΉ trigger-token
ΠΠ°Π½Π½ΡΠΉ ΡΠΎΠΊΠ΅Π½ ΠΌΠΎΠΆΠ½ΠΎ ΡΡΠ°Π·Ρ Π΄ΠΎΠ±Π°Π²ΠΈΡΡ Π² ΠΎΠ±ΡΡΡ ΠΊΠΎΠ½ΡΠΈΠ³ΡΡΠ°ΡΠΈΡ ΠΏΠ΅ΡΠ΅ΠΌΠ΅Π½Π½ΡΡ Π΄Π»Ρ Π³ΡΡΠΏΠΏΡ ΠΏΡΠΎΠ΅ΠΊΡΠΎΠ².
ΠΠ΅ΡΠ΅Ρ ΠΎΠ΄ΠΈΠΌ Π² Π³ΡΡΠΏΠΏΡ -> Settings -> CI / CD -> Variables ΠΈ Π΄ΠΎΠ±Π°Π²Π»ΡΠ΅ΠΌ ΠΏΠ΅ΡΠ΅ΠΌΠ΅Π½Π½ΡΡDEPLOY_TOKEN
Ρ trigger-token Π² Π·Π½Π°ΡΠ΅Π½ΠΈΠΈ.
GitLab Runner
Π Π΄Π°Π½Π½ΠΎΠΌ ΡΠ°Π·Π΄Π΅Π»Π΅ ΠΎΠΏΠΈΡΠ°Π½Π° ΠΊΠΎΠ½ΡΠΈΠ³ΡΡΠ°ΡΠΈΡ Π΄Π»Ρ Π·Π°ΠΏΡΡΠΊΠ° Π·Π°Π΄Π°Ρ Π½Π° deploy Ρ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΠ΅ΠΌ ΡΠΎΠ±ΡΡΠ²Π΅Π½Π½ΠΎΠ³ΠΎ (Specific) ΠΈ ΠΏΡΠ±Π»ΠΈΡΠ½ΠΎΠ³ΠΎ (Shared) ΡΠ°Π½Π½Π΅ΡΠ°.
Specific Runner
Π― ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΡ ΡΠΎΠ±ΡΡΠ²Π΅Π½Π½ΡΠ΅ ΡΠ°Π½Π½Π΅ΡΡ, ΡΠ°ΠΊ ΠΊΠ°ΠΊ Π² ΠΏΠ΅ΡΠ²ΡΡ ΠΎΡΠ΅ΡΠ΅Π΄Ρ ΡΡΠΎ ΡΠ΄ΠΎΠ±Π½ΠΎ, Π±ΡΡΡΡΠΎ, Π΄Π΅ΡΠ΅Π²ΠΎ.
ΠΠ»Ρ ΡΠ°Π½Π½Π΅ΡΠ° ΡΠ΅ΠΊΠΎΠΌΠ΅Π½Π΄ΡΡ Π»ΠΈΠ½ΡΠΊΡΠΎΠ²ΡΡ VDS Ρ 1 CPU, 2 GB RAM, 20 GB HDD. Π¦Π΅Π½Π° Π²ΠΎΠΏΡΠΎΡΠ° ~3000β½ Π² Π³ΠΎΠ΄.
ΠΠΎΠΉ ΡΠ°Π½Π½Π΅Ρ
ΠΠ»Ρ ΡΠ°Π½Π½Π΅ΡΠ° Ρ Π²Π·ΡΠ» VDS 4 CPU, 4 GB RAM, 50 GB SSD. ΠΠ±ΠΎΡΠ»Π°ΡΡ ~11000β½ ΠΈ Π½ΠΈ ΡΠ°Π·Ρ Π½Π΅ ΠΏΠΎΠΆΠ°Π»Π΅Π».
Π£ ΠΌΠ΅Π½Ρ Π² ΠΎΠ±ΡΠ΅ΠΉ ΡΠ»ΠΎΠΆΠ½ΠΎΡΡΠΈ 7 ΠΌΠ°ΡΠΈΠ½ΠΎΠΊ. 5 Π½Π° aruba ΠΈ 2 Π½Π° ihor.
ΠΡΠ°ΠΊ, Ρ Π½Π°Ρ Π΅ΡΡΡ ΡΠ°Π½Π½Π΅Ρ. Π’Π΅ΠΏΠ΅ΡΡ ΠΌΡ Π΅Π³ΠΎ Π±ΡΠ΄Π΅ΠΌ Π½Π°ΡΡΡΠ°ΠΈΠ²Π°ΡΡ.
ΠΠ°Ρ
ΠΎΠ΄ΠΈΠΌ Π½Π° ΠΌΠ°ΡΠΈΠ½ΠΊΡ ΠΏΠΎ SSH ΠΈ ΡΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°Π΅ΠΌ java, git, maven, gnupg2.
Π£ΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°Π΅ΠΌ gitlab runner
- Π‘ΠΎΠ·Π΄Π°Π΅ΠΌ Π½ΠΎΠ²ΡΡ Π³ΡΡΠΏΠΏΡ
runner
sudo groupadd runner
- Π‘ΠΎΠ·Π΄Π°Π΅ΠΌ Π΄ΠΈΡΠ΅ΠΊΡΠΎΡΠΈΡ Π΄Π»Ρ maven ΠΊΡΡΠ° ΠΈ Π½Π°Π²Π΅ΡΠΈΠ²Π°Π΅ΠΌ ΠΏΡΠ°Π²Π° Π³ΡΡΠΏΠΏΡ
runner
ΠΡΠΎΡ ΠΏΡΠ½ΠΊΡ ΠΌΠΎΠΆΠ½ΠΎ ΠΏΡΠΎΠΏΡΡΡΠΈΡΡ, Π΅ΡΠ»ΠΈ Π²Ρ Π½Π΅ ΠΏΠ»Π°Π½ΠΈΡΡΠ΅ΡΠ΅ Π·Π°ΠΏΡΡΠΊΠ°ΡΡ Π½Π΅ΡΠΊΠΎΠ»ΡΠΊΠΎ ΡΠ°Π½Π½Π΅ΡΠΎΠ² Π½Π° ΠΎΠ΄Π½ΠΎΠΉ ΠΌΠ°ΡΠΈΠ½Π΅.mkdir -p /usr/cache/.m2/repository chown -R :runner /usr/cache chmod -R 770 /usr/cache
- Π‘ΠΎΠ·Π΄Π°Π΅ΠΌ ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»Ρ
gitlab-deployer
ΠΈ Π΄ΠΎΠ±Π°Π²Π»ΡΠ΅ΠΌ Π² Π³ΡΡΠΏΠΏΡrunner
useradd -m -d /home/gitlab-deployer gitlab-deployer usermod -a -G runner gitlab-deployer
- ΠΠΎΠ±Π°Π²Π»ΡΠ΅ΠΌ Π² ΡΠ°ΠΉΠ»
/etc/ssh/sshd_config
ΡΠ»Π΅Π΄ΡΡΡΡΡ ΡΡΡΠΎΡΠΊΡAllowUsers root@* [email protected]
- ΠΠ΅ΡΠ΅Π·Π°Π³ΡΡΠΆΠ°Π΅ΠΌ
sshd
systemctl restart sshd
- Π£ΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°Π΅ΠΌ ΠΏΠ°ΡΠΎΠ»Ρ Π΄Π»Ρ ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»Ρ
gitlab-deployer
(ΠΌΠΎΠΆΠ½ΠΎ ΠΏΡΠΎΡΡΠΎΠΉ, ΡΠ°ΠΊ ΠΊΠ°ΠΊ Π΄Π΅ΠΉΡΡΠ²ΡΠ΅Ρ ΠΎΠ³ΡΠ°Π½ΠΈΡΠ΅Π½ΠΈΠ΅ Π΄Π»Ρ localhost)passwd gitlab-deployer
- Π£ΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°Π΅ΠΌ GitLab Runner (Linux x86-64)
sudo wget -O /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64 sudo chmod +x /usr/local/bin/gitlab-runner ln -s /usr/local/bin/gitlab-runner /etc/alternatives/gitlab-runner ln -s /etc/alternatives/gitlab-runner /usr/bin/gitlab-runner
- ΠΠ΅ΡΠ΅Ρ ΠΎΠ΄ΠΈΠΌ Π½Π° ΡΠ°ΠΉΡ gitlab.com -> deploy-project -> Settings -> CI/CD -> Runners -> Specific Runners ΠΈ ΠΊΠΎΠΏΠΈΡΡΠ΅ΠΌ registration token
Π‘ΠΊΡΠΈΠ½
- Π Π΅Π³ΠΈΡΡΡΠΈΡΡΠ΅ΠΌ ΡΠ°Π½Π½Π΅Ρ
gitlab-runner register --config /etc/gitlab-runner/gitlab-deployer-config.toml
ΠΡΠΎΡΠ΅ΡΡ
Runtime platform arch=amd64 os=linux pid=17594 revision=3001a600 version=11.10.0
Running in system-mode.
Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/):
https://gitlab.com/
Please enter the gitlab-ci token for this runner:
REGISTRATION_TOKEN
Please enter the gitlab-ci description for this runner:
[ih1174328.vds.myihor.ru]: Deploy Runner
Please enter the gitlab-ci tags for this runner (comma separated):
deploy
Registering runner... succeeded runner=ZvKdjJhx
Please enter the executor: docker-ssh, parallels, virtualbox, docker-ssh+machine, kubernetes, docker, ssh, docker+machine, shell:
shell
Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded!
- ΠΡΠΎΠ²Π΅ΡΡΠ΅ΠΌ, ΡΡΠΎ ΡΠ°Π½Π½Π΅Ρ Π·Π°ΡΠ΅Π³ΠΈΡΡΡΠΈΡΠΎΠ²Π°Π½. ΠΠ΅ΡΠ΅Ρ ΠΎΠ΄ΠΈΠΌ Π½Π° ΡΠ°ΠΉΡ gitlab.com -> deploy-project -> Settings -> CI/CD -> Runners -> Specific Runners -> Runners activated for this project
Π‘ΠΊΡΠΈΠ½
- ΠΠΎΠ±Π°Π²Π»ΡΠ΅ΠΌ ΠΎΡΠ΄Π΅Π»ΡΠ½ΡΠΉ ΡΠ΅ΡΠ²ΠΈΡ
/etc/systemd/system/gitlab-deployer.service
[Unit] Description=GitLab Deploy Runner After=syslog.target network.target ConditionFileIsExecutable=/usr/local/bin/gitlab-runner [Service] StartLimitInterval=5 StartLimitBurst=10 ExecStart=/usr/local/bin/gitlab-runner "run" "--working-directory" "/home/gitlab-deployer" "--config" "/etc/gitlab-runner/gitlab-deployer-config.toml" "--service" "gitlab-deployer" "--syslog" "--user" "gitlab-deployer" Restart=always RestartSec=120 [Install] WantedBy=multi-user.target
- ΠΠ°ΠΏΡΡΠΊΠ°Π΅ΠΌ ΡΠ΅ΡΠ²ΠΈΡ.
systemctl enable gitlab-deployer.service systemctl start gitlab-deployer.service systemctl status gitlab-deployer.service
- ΠΡΠΎΠ²Π΅ΡΡΠ΅ΠΌ, ΡΡΠΎ ΡΠ°Π½Π½Π΅Ρ Π·Π°ΠΏΡΡΠ΅Π½.
ΠΡΠΈΠΌΠ΅Ρ
ΠΠ΅Π½Π΅ΡΠ°ΡΠΈΡ GPG ΠΊΠ»ΡΡΠ΅ΠΉ
-
Π‘ ΡΡΠΎΠΉ ΠΆΠ΅ ΠΌΠ°ΡΠΈΠ½ΠΊΠΈ Π·Π°Ρ ΠΎΠ΄ΠΈΠΌ ΠΏΠΎ ssh ΠΏΠΎΠ΄ ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»Π΅ΠΌ
gitlab-deployer
(ΡΡΠΎ Π²Π°ΠΆΠ½ΠΎ Π΄Π»Ρ Π³Π΅Π½Π΅ΡΠ°ΡΠΈΠΈ GPG ΠΊΠ»ΡΡΠ°)ssh [email protected]
-
ΠΠ΅Π½Π΅ΡΠΈΡΡΠ΅ΠΌ ΠΊΠ»ΡΡ ΠΎΡΠ²Π΅ΡΠ°Ρ Π½Π° Π²ΠΎΠΏΡΠΎΡΡ. Π― ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π» ΡΠΎΠ±ΡΡΠ²Π΅Π½Π½ΡΠ΅ ΠΈΠΌΡ ΠΈ ΠΏΠΎΡΡΡ.
ΠΠ±ΡΠ·Π°ΡΠ΅Π»ΡΠ½ΠΎ ΡΠΊΠ°Π·ΡΠ²Π°Π΅ΠΌ ΠΏΠ°ΡΠΎΠ»Ρ Π΄Π»Ρ ΠΊΠ»ΡΡΠ°. ΠΠ°Π½Π½ΡΠΌ ΠΊΠ»ΡΡΠΎΠΌ Π±ΡΠ΄ΡΡ ΠΏΠΎΠ΄ΠΏΠΈΡΡΠ²Π°ΡΡΡΡ Π°ΡΡΠ΅ΡΠ°ΠΊΡΡ.gpg --gen-key
-
ΠΡΠΎΠ²Π΅ΡΡΠ΅ΠΌ
gpg --list-keys -a /home/gitlab-deployer/.gnupg/pubring.gpg ---------------------------------------- pub 4096R/00000000 2019-04-19 uid Petruha Petrov <[email protected]> sub 4096R/11111111 2019-04-19
-
ΠΠ°Π³ΡΡΠΆΠ°Π΅ΠΌ Π½Π°Ρ ΠΏΡΠ±Π»ΠΈΡΠ½ΡΠΉ ΠΊΠ»ΡΡ Π½Π° ΡΠ΅ΡΠ²Π΅Ρ ΠΊΠ»ΡΡΠ΅ΠΉ
gpg --keyserver keys.gnupg.net --send-key 00000000 gpg: sending key 00000000 to hkp server keys.gnupg.net
ΠΠ°ΡΡΡΠΎΠΉΠΊΠ° Maven
- ΠΠ°Ρ
ΠΎΠ΄ΠΈΠΌ ΠΏΠΎΠ΄ ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»Π΅ΠΌ
gitlab-deployer
su gitlab-deployer
- Π‘ΠΎΠ·Π΄Π°Π΅ΠΌ Π΄ΠΈΡΠ΅ΡΠΎΡΠΈΡ maven repository ΠΈ Π»ΠΈΠ½ΠΊΡΠ΅ΠΌ Ρ ΠΊΡΡΠ΅ΠΌ (Π½Π΅ ΠΎΡΠΈΠ±ΠΈΡΠ΅ΡΡ)
ΠΡΠΎΡ ΠΏΡΠ½ΠΊΡ ΠΌΠΎΠΆΠ½ΠΎ ΠΏΡΠΎΠΏΡΡΡΠΈΡΡ, Π΅ΡΠ»ΠΈ Π²Ρ Π½Π΅ ΠΏΠ»Π°Π½ΠΈΡΡΠ΅ΡΠ΅ Π·Π°ΠΏΡΡΠΊΠ° Π½Π΅ΡΠΊΠΎΠ»ΡΠΊΠΎ ΡΠ°Π½Π½Π΅ΡΠΎΠ² Π½Π° ΠΎΠ΄Π½ΠΎΠΉ ΠΌΠ°ΡΠΈΠ½Π΅.mkdir -p ~/.m2/repository ln -s /usr/cache/.m2/repository /home/gitlab-deployer/.m2/repository
- Π‘ΠΎΠ·Π΄Π°Π΅ΠΌ ΠΌΠ°ΡΡΠ΅Ρ ΠΊΠ»ΡΡ
mvn --encrypt-master-password password {hnkle5BJ9HUHUMP+CXfGBl8dScfFci/mpsur/73tR2I=}
- Π‘ΠΎΠ·Π΄Π°Π΅ΠΌ ΡΠ°ΠΉΠ» ~/.m2/settings-security.xml
<settingsSecurity> <master>{hnkle5BJ9HUHUMP+CXfGBl8dScfFci/mpsur/73tR2I=}</master> </settingsSecurity>
- Π¨ΠΈΡΡΡΠ΅ΠΌ ΠΏΠ°ΡΠΎΠ»Ρ ΠΎΡ ΡΡΠ΅ΡΠ½ΠΎΠΉ Π·Π°ΠΏΠΈΡΠΈ Sonatype
mvn --encrypt-password SONATYPE_PASSWORD {98Wv5+u+Tn0HX2z5G/kR4R8Z0WBgcDBgi7d12S/un+SCU7uxzaZGGmJ8Cu9pAZ2J}
- Π‘ΠΎΠ·Π΄Π°Π΅ΠΌ ΡΠ°ΠΉΠ» ~/.m2/settings.xml
<settings> <profiles> <profile> <id>env</id> <activation> <activeByDefault>true</activeByDefault> </activation> <properties> <gpg.passphrase>GPG_SECRET_KEY_PASSPHRASE</gpg.passphrase> </properties> </profile> </profiles> <servers> <server> <id>sonatype</id> <username>SONATYPE_USERNAME</username> <password>{98Wv5+u+Tn0HX2z5G/kR4R8Z0WBgcDBgi7d12S/un+SCU7uxzaZGGmJ8Cu9pAZ2J}</password> </server> </servers> </settings>
Π³Π΄Π΅,
GPG_SECRET_KEY_PASSPHRASE β ΠΏΠ°ΡΠΎΠ»Ρ ΠΎΡ GPG ΠΊΠ»ΡΡΠ°
SONATYPE_USERNAME β Π»ΠΎΠ³ΠΈΠ½ ΡΡΠ΅ΡΠ½ΠΎΠΉ Π·Π°ΠΏΠΈΡΠΈ sonatype
ΠΠ° ΡΡΠΎΠΌ Π½Π°ΡΡΡΠΎΠΉΠΊΠ° ΡΠ°Π½Π½Π΅ΡΠ° Π·Π°Π²Π΅ΡΡΠ΅Π½Π°, ΠΌΠΎΠΆΠ½ΠΎ ΠΏΠ΅ΡΠ΅Ρ
ΠΎΠ΄ΠΈΡΡ ΠΊ ΡΠ°Π·Π΄Π΅Π»Ρ
Shared Runner
ΠΠ΅Π½Π΅ΡΠ°ΡΠΈΡ GPG ΠΊΠ»ΡΡΠ΅ΠΉ
-
Π ΠΏΠ΅ΡΠ²ΡΡ ΠΎΡΠ΅ΡΠ΅Π΄Ρ Π½Π΅ΠΎΠ±Ρ ΠΎΠ΄ΠΈΠΌΠΎ ΡΠΎΠ·Π΄Π°ΡΡ GPG ΠΊΠ»ΡΡ. ΠΠ»Ρ ΡΡΠΎΠ³ΠΎ ΡΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°Π΅ΠΌ gnupg.
yum install -y gnupg
-
ΠΠ΅Π½Π΅ΡΠΈΡΡΠ΅ΠΌ ΠΊΠ»ΡΡ ΠΎΡΠ²Π΅ΡΠ°Ρ Π½Π° Π²ΠΎΠΏΡΠΎΡΡ. Π― ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π» ΡΠΎΠ±ΡΡΠ²Π΅Π½Π½ΡΠ΅ ΠΈΠΌΡ ΠΈ ΠΏΠΎΡΡΡ. ΠΠ±ΡΠ·Π°ΡΠ΅Π»ΡΠ½ΠΎ ΡΠΊΠ°Π·ΡΠ²Π°Π΅ΠΌ ΠΏΠ°ΡΠΎΠ»Ρ Π΄Π»Ρ ΠΊΠ»ΡΡΠ°.
gpg --gen-key
-
ΠΡΠ²ΠΎΠ΄ΠΈΠΌ ΠΈΠ½ΡΠΎΡΠΌΠ°ΡΠΈΡ ΠΏΠΎ ΠΊΠ»ΡΡΡ
gpg --list-keys -a pub rsa3072 2019-04-24 [SC] [expires: 2021-04-23] 2D0D1706366FC4AEF79669E24D09C55BBA3FD728 uid [ultimate] tttemp <[email protected]> sub rsa3072 2019-04-24 [E] [expires: none]
-
ΠΠ°Π³ΡΡΠΆΠ°Π΅ΠΌ Π½Π°Ρ ΠΏΡΠ±Π»ΠΈΡΠ½ΡΠΉ ΠΊΠ»ΡΡ Π½Π° ΡΠ΅ΡΠ²Π΅Ρ ΠΊΠ»ΡΡΠ΅ΠΉ
gpg --keyserver keys.gnupg.net --send-key 2D0D1706366FC4AEF79669E24D09C55BBA3FD728 gpg: sending key 2D0D1706366FC4AEF79669E24D09C55BBA3FD728 to hkp server keys.gnupg.net
-
ΠΠΎΠ»ΡΡΠ°Π΅ΠΌ ΠΏΡΠΈΠ²Π°ΡΠ½ΡΠΉ ΠΊΠ»ΡΡ
gpg --export-secret-keys --armor 2D0D1706366FC4AEF79669E24D09C55BBA3FD728 -----BEGIN PGP PRIVATE KEY BLOCK----- lQWGBFzAqp8BDADN41CPwJ/gQwiKEbyA902DKw/WSB1AvZQvV/ZFV77xGeG4K7k5 ... =2Wd2 -----END PGP PRIVATE KEY BLOCK-----
-
ΠΠ΅ΡΠ΅Ρ ΠΎΠ΄ΠΈΠΌ Π½Π°ΡΡΡΠΎΠΉΠΊΠΈ ΠΏΡΠΎΠ΅ΠΊΡΠ° -> Settings -> CI / CD -> Variables ΠΈ ΡΠΎΡ ΡΠ°Π½ΡΠ΅ΠΌ ΠΏΡΠΈΠ²Π°ΡΠ½ΡΠΉ ΠΊΠ»ΡΡ Π² ΠΏΠ΅ΡΠ΅ΠΌΠ΅Π½Π½ΠΎΠΉ
GPG_SECRET_KEY
ΠΠ°ΡΡΡΠΎΠΉΠΊΠ° Maven
- Π‘ΠΎΠ·Π΄Π°Π΅ΠΌ ΠΌΠ°ΡΡΠ΅Ρ ΠΊΠ»ΡΡ
mvn --encrypt-master-password password {hnkle5BJ9HUHUMP+CXfGBl8dScfFci/mpsur/73tR2I=}
- ΠΠ΅ΡΠ΅Ρ
ΠΎΠ΄ΠΈΠΌ Π½Π°ΡΡΡΠΎΠΉΠΊΠΈ ΠΏΡΠΎΠ΅ΠΊΡΠ° -> Settings -> CI / CD -> Variables ΠΈ ΡΠΎΡ
ΡΠ°Π½ΡΠ΅ΠΌ Π² ΠΏΠ΅ΡΠ΅ΠΌΠ΅Π½Π½ΠΎΠΉ
SETTINGS_SECURITY_XML
ΡΠ»Π΅Π΄ΡΡΡΠΈΠ΅ ΡΡΡΠΎΠΊΠΈ:<settingsSecurity> <master>{hnkle5BJ9HUHUMP+CXfGBl8dScfFci/mpsur/73tR2I=}</master> </settingsSecurity>
- Π¨ΠΈΡΡΡΠ΅ΠΌ ΠΏΠ°ΡΠΎΠ»Ρ ΠΎΡ ΡΡΠ΅ΡΠ½ΠΎΠΉ Π·Π°ΠΏΠΈΡΠΈ Sonatype
mvn --encrypt-password SONATYPE_PASSWORD {98Wv5+u+Tn0HX2z5G/kR4R8Z0WBgcDBgi7d12S/un+SCU7uxzaZGGmJ8Cu9pAZ2J}
- ΠΠ΅ΡΠ΅Ρ
ΠΎΠ΄ΠΈΠΌ Π½Π°ΡΡΡΠΎΠΉΠΊΠΈ ΠΏΡΠΎΠ΅ΠΊΡΠ° -> Settings -> CI / CD -> Variables ΠΈ ΡΠΎΡ
ΡΠ°Π½ΡΠ΅ΠΌ Π² ΠΏΠ΅ΡΠ΅ΠΌΠ΅Π½Π½ΠΎΠΉ
SETTINGS_XML
ΡΠ»Π΅Π΄ΡΡΡΠΈΠ΅ ΡΡΡΠΎΠΊΠΈ:<settings> <profiles> <profile> <id>env</id> <activation> <activeByDefault>true</activeByDefault> </activation> <properties> <gpg.passphrase>GPG_SECRET_KEY_PASSPHRASE</gpg.passphrase> </properties> </profile> </profiles> <servers> <server> <id>sonatype</id> <username>sonatype_username</username> <password>{98Wv5+u+Tn0HX2z5G/kR4R8Z0WBgcDBgi7d12S/un+SCU7uxzaZGGmJ8Cu9pAZ2J}</password> </server> </servers> </settings>
Π³Π΄Π΅,
GPG_SECRET_KEY_PASSPHRASE β ΠΏΠ°ΡΠΎΠ»Ρ ΠΎΡ GPG ΠΊΠ»ΡΡΠ°
SONATYPE_USERNAME β Π»ΠΎΠ³ΠΈΠ½ ΡΡΠ΅ΡΠ½ΠΎΠΉ Π·Π°ΠΏΠΈΡΠΈ sonatype
Deploy docker image
-
Π‘ΠΎΠ·Π΄Π°Π΅ΠΌ Π΄ΠΎΡΡΠ°ΡΠΎΡΠ½ΠΎ ΠΏΡΠΎΡΡΠΎΠΉ Dockerfile Π΄Π»Ρ Π·Π°ΠΏΡΡΠΊΠ° Π·Π°Π΄Π°Ρ Π½Π° deploy Ρ Π½ΡΠΆΠ½ΠΎΠΉ Π²Π΅ΡΡΠΈΠ΅ΠΉ Java. ΠΠΈΠΆΠ΅ ΠΏΡΠ΅Π΄ΡΡΠ°Π²Π»Π΅Π½ ΠΏΡΠΈΠΌΠ΅Ρ Π΄Π»Ρ alpine.
FROM java:8u111-jdk-alpine RUN apk add gnupg maven git --update-cache --repository http://dl-4.alpinelinux.org/alpine/edge/community/ --allow-untrusted && mkdir ~/.m2/
-
Π‘ΠΎΠ±ΠΈΡΠ°Π΅ΠΌ ΠΊΠΎΠ½ΡΠ΅ΠΉΠ½Π΅Ρ Π΄Π»Ρ Π²Π°ΡΠ΅Π³ΠΎ ΠΏΡΠΎΠ΅ΠΊΡΠ°
docker build -t registry.gitlab.com/group/deploy .
-
ΠΡΡΠ΅Π½ΡΠΈΡΠΈΡΠΈΡΡΠ΅ΠΌΡΡ ΠΈ Π·Π°Π³ΡΡΠΆΠ°Π΅ΠΌ ΠΊΠΎΠ½ΡΠ΅ΠΉΠ½Π΅Ρ Π² registry.
docker login -u USER -p PASSWORD registry.gitlab.com docker push registry.gitlab.com/group/deploy
GitLab CI
Deploy project
ΠΠΎΠ±Π°Π²Π»ΡΠ΅ΠΌ Π² ΠΊΠΎΡΠ΅Π½Ρ deploy-ΠΏΡΠΎΠ΅ΠΊΡΠ° ΡΠ°ΠΉΠ» .gitlab-ci.yml
Π ΡΠΊΡΠΈΠΏΡΠ΅ ΠΏΡΠ΅Π΄ΡΡΠ°Π²Π»Π΅Π½ΠΎ Π΄Π²Π΅ Π²Π·Π°ΠΈΠΌΠΎΠΈΡΠΊΠ»ΡΡΠ°ΡΡΠΈΠ΅ Π·Π°Π΄Π°ΡΠΈ Π½Π° Π΄Π΅ΠΏΠ»ΠΎΠΉ. Specific Runner ΠΈΠ»ΠΈ Shared Runner ΡΠΎΠΎΡΠ²Π΅ΡΡΡΠ²Π΅Π½Π½ΠΎ.
.gitlab-ci.yml
stages:
- deploy
Specific Runner:
extends: .java_deploy_template
# ΠΠ°Π΄Π°ΡΠ° Π±ΡΠ΄Π΅Ρ Π²ΡΠΏΠΎΠ»Π½ΡΡΡΡΡ Π½Π° Π²Π°ΡΠ΅ΠΌ shell-ΡΠ°Π½Π½Π΅ΡΠ΅
tags:
- deploy
Shared Runner:
extends: .java_deploy_template
# ΠΠ°Π΄Π°ΡΠ° Π±ΡΠ΄Π΅Ρ Π²ΡΠΏΠΎΠ»Π½ΡΡΡΡΡ Π½Π° ΠΏΡΠ±Π»ΠΈΡΠ½ΠΎΠΌ docker-ΡΠ°Π½Π½Π΅ΡΠ΅
tags:
- docker
# ΠΠ±ΡΠ°Π· ΠΈΠ· ΡΠ°Π·Π΄Π΅Π»Π° GitLab Runner -> Shared Runner -> Docker
image: registry.gitlab.com/group/deploy-project:latest
before_script:
# ΠΠΌΠΏΠΎΡΡΠΈΡΡΠ΅ΠΌ GPG ΠΊΠ»ΡΡ
- printf "${GPG_SECRET_KEY}" | gpg --batch --import
# Π‘ΠΎΡ
ΡΠ°Π½ΡΠ΅ΠΌ maven ΠΊΠΎΠ½ΡΠΈΠ³ΡΡΠ°ΡΠΈΡ
- printf "${SETTINGS_SECURITY_XML}" > ~/.m2/settings-security.xml
- printf "${SETTINGS_XML}" > ~/.m2/settings.xml
.java_deploy_template:
stage: deploy
# ΠΠ°Π΄Π°ΡΠ° ΡΡΠ°Π±ΠΎΡΠ°Π΅Ρ ΠΏΠΎ ΡΡΠΈΠ³Π³Π΅ΡΡ, Π΅ΡΠ»ΠΈ ΠΏΠ΅ΡΠ΅Π΄Π°Π½Π° ΠΏΠ΅ΡΠ΅ΠΌΠ΅Π½Π½Π°Ρ DEPLOY ΡΠΎ Π·Π½Π°ΡΠ΅Π½ΠΈΠ΅ΠΌ java
only:
variables:
- $DEPLOY == "java"
variables:
# ΠΎΡΠΊΠ»ΡΡΠ°Π΅ΠΌ ΠΊΠ»ΠΎΠ½ΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ ΡΠ΅ΠΊΡΡΠ΅Π³ΠΎ ΠΏΡΠΎΠ΅ΠΊΡΠ°
GIT_STRATEGY: none
script:
# ΠΡΠ΅Π΄ΠΎΡΡΠ°Π²Π»ΡΠ΅ΠΌ Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎΡΡΡ Ρ
ΡΠ°Π½Π΅Π½ΠΈΡ ΠΏΠ°ΡΠΎΠ»Ρ Π² Π½Π΅Π·Π°ΡΠΈΡΡΠΎΠ²Π°Π½Π½ΠΎΠΌ Π²ΠΈΠ΄Π΅
- git config --global credential.helper store
# Π‘ΠΎΡ
ΡΠ°Π½ΡΠ΅ΠΌ Π²ΡΠ΅ΠΌΠ΅Π½Π½ΡΠ΅ ΠΊΡΠ΅Π΄Ρ ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»Ρ gitlab-ci-token
# Π’ΠΎΠΊΠ΅Π½ ΡΠ°Π±ΠΎΡΠ°Π΅Ρ Π΄Π»Ρ Π²ΡΠ΅Ρ
ΠΏΡΠ±Π»ΠΈΡΠ½ΡΡ
ΠΏΡΠΎΠ΅ΠΊΡΠΎΠ² gitlab.com ΠΈ Π΄Π»Ρ ΠΏΡΠΎΠ΅ΠΊΡΠΎΠ² Π³ΡΡΠΏΠΏΡ
- echo "https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com" >> ~/.git-credentials
# ΠΠΎΠ»Π½ΠΎΡΡΡΡ ΡΠΈΡΡΠΈΠΌ ΡΠ΅ΠΊΡΡΡΡ Π΄ΠΈΡΠ΅ΠΊΡΠΎΡΠΈΡ
- rm -rf .* *
# ΠΠ»ΠΎΠ½ΠΈΡΡΠ΅ΠΌ ΠΏΡΠΎΠ΅ΠΊΡ ΠΊΠΎΡΠΎΡΡΠΉ, Π±ΡΠ΄Π΅ΠΌ Π΄Π΅ΠΏΠ»ΠΎΠΈΡΡ Π² Sonatype Nexus
- git clone ${DEPLOY_CI_REPOSITORY_URL} .
# ΠΠ΅ΡΠ΅ΠΊΠ»ΡΡΠ°Π΅ΠΌΡΡ Π½Π° Π½ΡΠΆΠ½ΡΠΉ ΠΊΠΎΠΌΠΌΠΈΡ
- git checkout ${DEPLOY_CI_COMMIT_SHA} -f
# ΠΡΠ»ΠΈ Ρ
ΠΎΡΡ ΠΎΠ΄ΠΈΠ½ pom.xml ΡΠΎΠ΄Π΅ΡΠΆΠΈΡ ΠΏΠ°ΡΠ°ΠΌΠ΅ΡΡ autoReleaseAfterClose Π²Π°Π»ΠΈΠΌ ΡΠ±ΠΎΡΠΊΡ.
# Π ΠΏΡΠΎΡΠΈΠ²Π½ΠΎΠΌ ΡΠ»ΡΡΠ°Π΅ Π΅ΡΡΡ ΡΠΈΡΠΊ Π·Π°Π»ΠΈΡΡ ΡΡΡΡΠ΅ Π°ΡΡΠ΅ΡΠ°ΠΊΡΡ Π² maven central
- >
for pom in $(find . -name pom.xml); do
if [[ $(grep -q autoReleaseAfterClose "$pom" && echo $?) == 0 ]]; then
echo "File $pom contains prohibited setting: <autoReleaseAfterClose>";
exit 1;
fi;
done
# ΠΡΠ»ΠΈ ΠΏΠ°ΡΠ°ΠΌΠ΅ΡΡ DEPLOY_CI_COMMIT_TAG ΠΏΡΡΡΠΎΠΉ, ΡΠΎ ΠΏΡΠΈΠ½ΡΠ΄ΠΈΡΠ΅Π»ΡΠ½ΠΎ ΡΡΠ°Π²ΠΈΠΌ SNAPSHOT-Π²Π΅ΡΡΠΈΡ
- >
if [[ "${DEPLOY_CI_COMMIT_TAG}" != "" ]]; then
mvn versions:set -DnewVersion=${DEPLOY_CI_COMMIT_TAG}
else
VERSION=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
if [[ "${VERSION}" == *-SNAPSHOT ]]; then
mvn versions:set -DnewVersion=${VERSION}
else
mvn versions:set -DnewVersion=${VERSION}-SNAPSHOT
fi
fi
# ΠΠ°ΠΏΡΡΠΊΠ°Π΅ΠΌ Π·Π°Π΄Π°ΡΡ Π½Π° ΡΠ±ΠΎΡΠΊΡ ΠΈ Π΄Π΅ΠΏΠ»ΠΎΠΉ Π°ΡΡΠ΅ΡΠ°ΠΊΡΠΎΠ²
- mvn clean deploy -DskipTests=true
Java project
Π java ΠΏΡΠΎΠ΅ΠΊΡΠ°Ρ ΠΊΠΎΡΠΎΡΡΠ΅ ΠΏΡΠ΅Π΄ΠΏΠΎΠ»Π°Π³Π°Π΅ΡΡΡ Π·Π°Π³ΡΡΠΆΠ°ΡΡ Π² ΠΏΡΠ±Π»ΠΈΡΠ½ΡΠ΅ ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠΈ Π½Π΅ΠΎΠ±Ρ ΠΎΠ΄ΠΈΠΌΠΎ Π΄ΠΎΠ±Π°Π²ΠΈΡΡ 2 ΡΠ°Π³Π° Π½Π° Π·Π°Π³ΡΡΠ·ΠΊΡ Release ΠΈ Snapshot Π²Π΅ΡΡΠΈΠΉ.
.gitlab-ci.yml
stages:
- build
- test
- verify
- deploy
<...>
Release:
extends: .trigger_deploy
# ΠΠ°ΠΏΡΡΠΊΠ°ΡΡ Π·Π°Π΄Π°ΡΡ ΡΠΎΠ»ΡΠΊΠΎ ΠΏo ΡΠ΅Π³Ρ.
only:
- tags
Snapshot:
extends: .trigger_deploy
# ΠΠ°ΠΏΡΡΠΊΠ°Π΅ΠΌ Π·Π°Π΄Π°ΡΡ Π½Π° ΠΏΡΠ±Π»ΠΈΠΊΠ°ΡΠΈΡ SNAPSHOT Π²Π΅ΡΡΠΈΠΈ Π²ΡΡΡΠ½ΡΡ
when: manual
# ΠΠ΅ Π·Π°ΠΏΡΡΠΊΠ°ΡΡ Π·Π°Π΄Π°ΡΡ, Π΅ΡΠ»ΠΈ ΠΏΡΠΎΡΡΠ°Π²Π»Π΅Π½ ΡΠ΅Π³.
except:
- tags
.trigger_deploy:
stage: deploy
variables:
# ΠΡΠΊΠ»ΡΡΠ°Π΅ΠΌ ΠΊΠ»ΠΎΠ½ΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ ΡΠ΅ΠΊΡΡΠ΅Π³ΠΎ ΠΏΡΠΎΠ΅ΠΊΡΠ°
GIT_STRATEGY: none
# Π‘ΡΡΠ»ΠΊΠ° Π½Π° ΡΡΠΈΠ³Π³Π΅Ρ deploy-Π·Π°Π΄Π°ΡΠΈ
URL: "https://gitlab.com/api/v4/projects/<deploy project ID>/trigger/pipeline"
# ΠΠ΅ΡΠ΅ΠΌΠ΅Π½Π½ΡΠ΅ deploy-Π·Π°Π΄Π°ΡΠΈ
POST_DATA: "
token=${DEPLOY_TOKEN}&
ref=master&
variables[DEPLOY]=${DEPLOY}&
variables[DEPLOY_CI_REPOSITORY_URL]=${CI_REPOSITORY_URL}&
variables[DEPLOY_CI_PROJECT_NAME]=${CI_PROJECT_NAME}&
variables[DEPLOY_CI_COMMIT_SHA]=${CI_COMMIT_SHA}&
variables[DEPLOY_CI_COMMIT_TAG]=${CI_COMMIT_TAG}
"
script:
# ΠΠ΅ ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΡ cURL, ΡΠ°ΠΊ ΠΊΠ°ΠΊ Ρ ΡΠ»Π°Π³Π°ΠΌΠΈ --fail --show-error
# ΠΎΠ½ Π½Π΅ Π²ΡΠ²ΠΎΠ΄ΠΈΡ ΡΠ΅Π»ΠΎ ΠΎΡΠ²Π΅ΡΠ°, Π΅ΡΠ»ΠΈ HTTP ΠΊΠΎΠ΄ 400 ΠΈ Π±ΠΎΠ»Π΅Π΅
- wget --content-on-error -qO- ${URL} --post-data ${POST_DATA}
Π Π΄Π°Π½Π½ΠΎΠΌ ΡΠ΅ΡΠ΅Π½ΠΈΠΈ Ρ ΠΏΠΎΡΠ΅Π» Π½Π΅ΠΌΠ½ΠΎΠ³ΠΎ Π΄Π°Π»ΡΡΠ΅ ΠΈ ΡΠ΅ΡΠΈΠ» ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΡ ΠΎΠ΄ΠΈΠ½ CI ΡΠ°Π±Π»ΠΎΠ½ Π΄Π»Ρ java ΠΏΡΠΎΠ΅ΠΊΡΠΎΠ².
ΠΠΎΠ»Π΅Π΅ ΠΏΠΎΠ΄ΡΠΎΠ±Π½ΠΎ
Π― ΡΠΎΠ·Π΄Π°Π» ΠΎΡΠ΄Π΅Π»ΡΠ½ΡΠΉ ΠΏΡΠΎΠ΅ΠΊΡ
common.yml
stages:
- build
- test
- verify
- deploy
variables:
SONAR_ARGS: "
-Dsonar.gitlab.commit_sha=${CI_COMMIT_SHA}
-Dsonar.gitlab.ref_name=${CI_COMMIT_REF_NAME}
"
.build_java_project:
stage: build
tags:
- touchbit-shell
variables:
SKIP_TEST: "false"
script:
- mvn clean
- mvn package -DskipTests=${SKIP_TEST}
artifacts:
when: always
expire_in: 30 day
paths:
- "*/target/reports"
.build_sphinx_doc:
stage: build
tags:
- touchbit-shell
variables:
DOCKERFILE: .indirect/docs/Dockerfile
script:
- docker build --no-cache -t ${CI_PROJECT_NAME}/doc -f ${DOCKERFILE} .
.junit_module_test_run:
stage: test
tags:
- touchbit-shell
variables:
MODULE: ""
script:
- cd ${MODULE}
- mvn test
artifacts:
when: always
expire_in: 30 day
paths:
- "*/target/reports"
.junit_test_run:
stage: test
tags:
- touchbit-shell
script:
- mvn test
artifacts:
when: always
expire_in: 30 day
paths:
- "*/target/reports"
.sonar_review:
stage: verify
tags:
- touchbit-shell
dependencies: []
script:
- >
if [ "$CI_BUILD_REF_NAME" == "master" ]; then
mvn compile sonar:sonar -Dsonar.login=$SONAR_LOGIN $SONAR_ARGS
else
mvn compile sonar:sonar -Dsonar.login=$SONAR_LOGIN $SONAR_ARGS -Dsonar.analysis.mode=preview
fi
.trigger_deploy:
stage: deploy
tags:
- touchbit-shell
variables:
URL: "https://gitlab.com/api/v4/projects/10345765/trigger/pipeline"
POST_DATA: "
token=${DEPLOY_TOKEN}&
ref=master&
variables[DEPLOY]=${DEPLOY}&
variables[DEPLOY_CI_REPOSITORY_URL]=${CI_REPOSITORY_URL}&
variables[DEPLOY_CI_PROJECT_NAME]=${CI_PROJECT_NAME}&
variables[DEPLOY_CI_COMMIT_SHA]=${CI_COMMIT_SHA}&
variables[DEPLOY_CI_COMMIT_TAG]=${CI_COMMIT_TAG}
"
script:
- wget --content-on-error -qO- ${URL} --post-data ${POST_DATA}
.trigger_release_deploy:
extends: .trigger_deploy
only:
- tags
.trigger_snapshot_deploy:
extends: .trigger_deploy
when: manual
except:
- tags
Π ΡΠ΅Π·ΡΠ»ΡΡΠ°ΡΠ΅ Π² ΡΠ°ΠΌΠΈΡ java ΠΏΡΠΎΠ΅ΠΊΡΠ°Ρ .gitlab-ci.yml Π²ΡΠ³Π»ΡΠ΄ΠΈΡ Π²Π΅ΡΡΠΌΠ° ΠΊΠΎΠΌΠΏΠ°ΠΊΡΠ½ΠΎ ΠΈ Π½Π΅ ΠΌΠ½ΠΎΠ³ΠΎΡΠ»ΠΎΠ²Π½ΠΎ
.gitlab-ci.yml
include: https://gitlab.com/TouchBIT/gitlab-ci/raw/master/common.yml
Shields4J:
extends: .build_java_project
Sphinx doc:
extends: .build_sphinx_doc
variables:
DOCKERFILE: .docs/Dockerfile
Sonar review:
extends: .sonar_review
dependencies:
- Shields4J
Release:
extends: .trigger_release_deploy
Snapshot:
extends: .trigger_snapshot_deploy
ΠΠΎΠ½ΡΠΈΠ³ΡΡΠ°ΡΠΈΡ pom.xml
ΠΡΠ΅Π½Ρ Π΄Π΅ΡΠ°Π»ΡΠ½ΠΎ Π΄Π°Π½Π½Π°Ρ ΡΠ΅ΠΌΠ° ΠΎΠΏΠΈΡΠ°Π½Π° nexus-staging-maven-plugin
, Π΅ΡΠ»ΠΈ Π²Ρ Π½Π΅ Ρ
ΠΎΡΠΈΡΠ΅ ΠΈΠ»ΠΈ Π½Π΅ ΠΌΠΎΠΆΠ΅ΡΠ΅ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΡ org.sonatype.oss:oss-parent Π² ΠΊΠ°ΡΠ΅ΡΡΠ²Π΅ ΡΠΎΠ΄ΠΈΡΠ΅Π»Ρ Π΄Π»Ρ ΡΠ²ΠΎΠ΅Π³ΠΎ ΠΏΡΠΎΠ΅ΠΊΡΠ°.
maven-install-plugin
Π£ΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°Π΅Ρ ΠΌΠΎΠ΄ΡΠ»ΠΈ Π² Π»ΠΎΠΊΠ°Π»ΡΠ½ΡΠΉ ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠΉ.
ΠΠ΅ΡΡΠΌΠ° ΠΏΠΎΠ»Π΅Π·Π΅Π½ Π΄Π»Ρ Π»ΠΎΠΊΠ°Π»ΡΠ½ΠΎΠΉ ΠΏΡΠΎΠ²Π΅ΡΠΊΠΈ ΡΠ΅ΡΠ΅Π½ΠΈΠΉ Π² Π΄ΡΡΠ³ΠΈΡ
ΠΏΡΠΎΠ΅ΠΊΡΠ°Ρ
, Π° ΡΠ°ΠΊ ΠΆΠ΅ ΠΊΠΎΠ½ΡΡΠΎΠ»ΡΠ½ΠΎΠΉ ΡΡΠΌΠΌΠΎΠΉ.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<executions>
<execution>
<id>install-project</id>
<!-- ΠΡΠ»ΠΈ Ρ Π²Π°Ρ ΠΌΠ½ΠΎΠ³ΠΎΠΌΠΎΠ΄ΡΠ»ΡΠ½ΡΠΉ ΠΏΡΠΎΠ΅ΠΊΡ Ρ Π΄Π΅ΠΏΠ»ΠΎΠ΅ΠΌ ΡΠΎΠ΄ΠΈΡΠ΅Π»ΡΡΠΊΠΎΠ³ΠΎ ΠΏΠΎΠΌΠΈΠΊΠ° -->
<phase>install</phase>
<!-- Π―Π²Π½ΠΎ ΡΠΊΠ°Π·ΡΠ²Π°Π΅ΠΌ ΡΠ°ΠΉΠ»Ρ Π΄Π»Ρ Π»ΠΎΠΊΠ°Π»ΡΠ½ΠΎΠΉ ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠΈ -->
<configuration>
<file>target/${project.artifactId}-${project.version}.jar</file>
```target/${project.artifactId}-${project.version}-sources.jar</sources>
<pomFile>dependency-reduced-pom.xml</pomFile>
<!-- ΠΡΠΈΠ½ΡΠ΄ΠΈΡΠ΅Π»ΡΠ½ΠΎΠ΅ ΠΎΠ±Π½ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΌΠ΅ΡΠ°Π΄Π°Π½Π½ΡΡ
ΠΏΡΠΎΠ΅ΠΊΡΠ° -->
<updateReleaseInfo>true</updateReleaseInfo>
<!-- ΠΠΎΠ½ΡΡΠΎΠ»ΡΠ½ΡΠ΅ ΡΡΠΌΠΌΡ Π΄Π»Ρ ΠΏΡΠΎΠ²Π΅ΡΠΊΠΈ ΡΠ΅Π»ΠΎΡΡΠ½ΠΎΡΡΠΈ -->
<createChecksum>true</createChecksum>
</configuration>
</execution>
</executions>
</plugin>
maven-javadoc-plugin
ΠΠ΅Π½Π΅ΡΠ°ΡΠΈΡ javadoc Π΄Π»Ρ ΠΏΡΠΎΠ΅ΠΊΡΠ°.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>jar</goal>
</goals>
<!-- ΠΠ΅Π½Π΅ΡΠ°ΡΠΈΡ javadoc Π΄ΠΎΠ»ΠΆΠ½Π° Π±ΡΡΡ ΠΏΠΎΡΠ»Π΅ ΡΠ°Π·Ρ Π³Π΅Π½Π΅ΡΠ°ΡΠΈΠΈ ΡΠ΅ΡΡΡΡΠΎΠ² -->
<phase>prepare-package</phase>
<configuration>
<!-- ΠΡΠ΅Π½Ρ ΠΏΠΎΠΌΠΎΠ³Π°Π΅Ρ Π² ΠΏΡΠ±Π»ΠΈΡΠ½ΡΡ
ΠΏΡΠΎΠ΅ΠΊΡΠ°Ρ
-->
<failOnError>true</failOnError>
<failOnWarnings>true</failOnWarnings>
<!-- Π£Π±ΠΈΡΠ°Π΅Ρ ΠΎΡΠΈΠ±ΠΊΡ ΠΏΠΎΠΈΡΠΊΠ° Π΄ΠΎΠΊΡΠΌΠ΅Π½ΡΠ°ΡΠΈΠΈ Π² target Π΄ΠΈΡΠ΅ΠΊΡΠΎΡΠΈΠΈ -->
<detectOfflineLinks>false</detectOfflineLinks>
</configuration>
</execution>
</executions>
</plugin>
ΠΡΠ»ΠΈ Ρ Π²Π°Ρ Π΅ΡΡΡ ΠΌΠΎΠ΄ΡΠ»Ρ, ΠΊΠΎΡΠΎΡΡΠΉ Π½Π΅ ΡΠΎΠ΄Π΅ΡΠΆΠΈΡ java (Π½Π°ΠΏΡΠΈΠΌΠ΅Ρ ΡΠΎΠ»ΡΠΊΠΎ ΡΠ΅ΡΡΡΡΡ)
ΠΠ»ΠΈ Π²Ρ Π½Π΅ Ρ
ΠΎΡΠΈΡΠ΅ Π² ΠΏΡΠΈΠ½ΡΠΈΠΏΠ΅ Π³Π΅Π½Π΅ΡΠΈΡΠΎΠ²Π°ΡΡ javadoc, ΡΠΎ Π² ΠΏΠΎΠΌΠΎΡΡ maven-jar-plugin
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>empty-javadoc-jar</id>
<phase>generate-resources</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>javadoc</classifier>
<classesDirectory>${basedir}/javadoc</classesDirectory>
</configuration>
</execution>
</executions>
</plugin>
maven-gpg-plugin
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<executions>
<execution>
<id>sign-artifacts</id>
<!-- Π‘Π±ΠΎΡΠΊΠ° Π±ΡΠ΄Π΅Ρ ΠΏΠ°Π΄Π°ΡΡ, Π΅ΡΠ»ΠΈ ΠΎΡΡΡΡΡΡΠ²ΡΠ΅Ρ GPG ΠΊΠ»ΡΡ -->
<!-- ΠΠΎΠ΄ΠΏΠΈΡΡΠ²Π°Π΅ΠΌ Π°ΡΡΠ΅ΡΠ°ΠΊΡΡ ΡΠΎΠ»ΡΠΊΠΎ Π½Π° ΡΠ°Π·Π΅ deploy -->
<phase>deploy</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
nexus-staging-maven-plugin
ΠΠΎΠ½ΡΠΈΠ³ΡΡΠ°ΡΠΈΡ:
<project>
<!-- ... -->
<build>
<plugins>
<!-- ... -->
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<serverId>sonatype</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<!-- ΠΠ±Π½ΠΎΠ²Π»ΡΠ΅ΠΌ ΠΌΠ΅ΡΠ°Π΄Π°Π½Π½ΡΠ΅, ΡΡΠΎΠ±Ρ ΠΏΠΎΠΌΠ΅ΡΠΈΡΡ Π°ΡΡΠ΅ΡΠ°ΠΊΡ ΠΊΠ°ΠΊ release -->
<!-- ΠΠ΅ Π²Π»ΠΈΡΠ΅Ρ Π½Π° snapshot Π²Π΅ΡΡΠΈΠΈ -->
<updateReleaseInfo>true</updateReleaseInfo>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<!-- ΠΡΠΊΠ»ΡΡΠ°Π΅ΠΌ ΠΏΠ»Π°Π³ΠΈΠ½ -->
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<distributionManagement>
<snapshotRepository>
<id>sonatype</id>
<name>Nexus Snapshot Repository</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</snapshotRepository>
<repository>
<id>sonatype</id>
<name>Nexus Release Repository</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
</project>
ΠΡΠ»ΠΈ Ρ Π²Π°Ρ ΠΌΠ½ΠΎΠ³ΠΎΠΌΠΎΠ΄ΡΠ»ΡΠ½ΡΠΉ ΠΏΡΠΎΠ΅ΠΊΡ, ΠΈ Π²Π°ΠΌ Π½Π΅Ρ Π½Π΅ΠΎΠ±Ρ
ΠΎΠ΄ΠΈΠΌΠΎΡΡΠΈ Π·Π°Π³ΡΡΠΆΠ°ΡΡ ΠΎΠΏΡΠ΅Π΄Π΅Π»Π΅Π½Π½ΡΠΉ ΠΌΠΎΠ΄ΡΠ»Ρ Π² ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠΉ, ΡΠΎ Π² pom.xml Π΄Π°Π½Π½ΠΎΠ³ΠΎ ΠΌΠΎΠ΄ΡΠ»Ρ Π½Π΅ΠΎΠ±Ρ
ΠΎΠ΄ΠΈΠΌΠΎ Π΄ΠΎΠ±Π°Π²ΠΈΡΡ nexus-staging-maven-plugin
Ρ ΡΠ»Π°Π³ΠΎΠΌ skipNexusStagingDeployMojo
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<configuration>
<skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
</configuration>
</plugin>
</plugins>
</build>
ΠΠΎΡΠ»Π΅ Π·Π°Π³ΡΡΠ·ΠΊΠΈ snapshot/release Π²Π΅ΡΡΠΈΠΈ Π΄ΠΎΡΡΡΠΏΠ½Ρ Π²
<repositories>
<repository>
<id>SonatypeNexus</id>
<url>https://oss.sonatype.org/content/groups/staging/</url>
<!-- ΠΠ΅ Π½Π°Π΄ΠΎ ΡΠΊΠ°Π·ΡΠ²Π°ΡΡ ΡΠ»Π°Π³ΠΈ snapshot/release Π΄Π»Ρ ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΡ -->
</repository>
</repositories>
ΠΡΠ΅ ΠΏΠ»ΡΡΡ
- ΠΡΠ΅Π½Ρ Π±ΠΎΠ³Π°ΡΡΠΉ ΡΠΏΠΈΡΠΎΠΊ ΡΠ΅Π»Π΅ΠΉ Π΄Π»Ρ ΡΠ°Π±ΠΎΡΡ Ρ nexus ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠ΅ΠΌ (
mvn help:describe -Dplugin=org.sonatype.plugins:nexus-staging-maven-plugin
). - ΠΠ²ΡΠΎΠΌΠ°ΡΠΈΡΠ΅ΡΠΊΠ°Ρ ΠΏΡΠΎΠ²Π΅ΡΠΊΠ° ΡΠ΅Π»ΠΈΠ·Π° Π½Π° Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎΡΡΡ Π·Π°Π³ΡΡΠ·ΠΊΠΈ Π² maven central
Π Π΅Π·ΡΠ»ΡΡΠ°Ρ
ΠΡΠ±Π»ΠΈΠΊΠ°ΡΠΈΡ SNAPSHOT Π²Π΅ΡΡΠΈΠΈ
ΠΡΠΈ ΡΠ±ΠΎΡΠΊΠ΅ ΠΏΡΠΎΠ΅ΠΊΡΠ° ΠΏΡΠΈΡΡΡΡΡΠ²ΡΠ΅Ρ Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎΡΡΡ ΡΡΡΠ½ΠΎΠ³ΠΎ Π·Π°ΠΏΡΡΠΊΠ° Π·Π°Π΄Π°ΡΠΈ Π½Π° Π·Π°Π³ΡΡΠ·ΠΊΡ SNAPSHOT Π²Π΅ΡΡΠΈΠΈ Π² nexus
ΠΡΠΈ Π·Π°ΠΏΡΡΠΊΠ΅ Π΄Π°Π½Π½ΠΎΠΉ Π·Π°Π΄Π°ΡΠΈ ΡΡΠΈΠ³Π³Π΅ΡΠΈΡΡΡ ΡΠΎΠΎΡΠ²Π΅ΡΡΡΠ²ΡΡΡΠ°Ρ Π·Π°Π΄Π°ΡΠ° Π² ΠΏΡΠΎΠ΅ΠΊΡΠ΅ deploy (
ΠΠΎΠ΄ΡΠ΅Π·Π°Π½Π½ΡΠΉ Π»ΠΎΠ³
Running with gitlab-runner 11.10.0 (3001a600)
on Deploy runner JSKWyxUw
Using Shell executor...
Running on ih1174328.vds.myihor.ru...
Skipping Git repository setup
Skipping Git checkout
Skipping Git submodules setup
$ rm -rf .* *
$ git config --global credential.helper store
$ echo "https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com" >> ~/.git-credentials
$ git clone ${DEPLOY_CI_REPOSITORY_URL} .
Cloning into 'shields4j'...
$ git checkout ${DEPLOY_CI_COMMIT_SHA}
Note: checking out '850f86aa317194395c5387790da1350e437125a7'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b new_branch_name
HEAD is now at 850f86a... skip deploy test-core
$ for pom in $(find . -name pom.xml); do # collapsed multi-line command
$ if [[ "${DEPLOY_CI_COMMIT_TAG}" != "" ]]; then # collapsed multi-line command
[INFO] Scanning for projects...
[INFO] Inspecting build with total of 4 modules...
[INFO] Installing Nexus Staging features:
[INFO] ... total of 4 executions of maven-deploy-plugin replaced with nexus-staging-maven-plugin
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Shields4J [pom]
[INFO] test-core [jar]
[INFO] Shields4J client [jar]
[INFO] TestNG listener [jar]
[INFO]
[INFO] --------------< org.touchbit.shields4j:shields4j-parent >---------------
[INFO] Building Shields4J 1.0.0 [1/4]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- versions-maven-plugin:2.5:set (default-cli) @ shields4j-parent ---
[INFO] Searching for local aggregator root...
[INFO] Local aggregation root: /home/gitlab-deployer/JSKWyxUw/0/TouchBIT/deploy/shields4j
[INFO] Processing change of org.touchbit.shields4j:shields4j-parent:1.0.0 -> 1.0.0-SNAPSHOT
[INFO] Processing org.touchbit.shields4j:shields4j-parent
[INFO] Updating project org.touchbit.shields4j:shields4j-parent
[INFO] from version 1.0.0 to 1.0.0-SNAPSHOT
[INFO]
[INFO] Processing org.touchbit.shields4j:client
[INFO] Updating parent org.touchbit.shields4j:shields4j-parent
[INFO] from version 1.0.0 to 1.0.0-SNAPSHOT
[INFO] Updating dependency org.touchbit.shields4j:test-core
[INFO] from version 1.0.0 to 1.0.0-SNAPSHOT
[INFO]
[INFO] Processing org.touchbit.shields4j:test-core
[INFO] Updating parent org.touchbit.shields4j:shields4j-parent
[INFO] from version 1.0.0 to 1.0.0-SNAPSHOT
[INFO]
[INFO] Processing org.touchbit.shields4j:testng
[INFO] Updating parent org.touchbit.shields4j:shields4j-parent
[INFO] from version 1.0.0 to 1.0.0-SNAPSHOT
[INFO] Updating dependency org.touchbit.shields4j:client
[INFO] from version 1.0.0 to 1.0.0-SNAPSHOT
[INFO] Updating dependency org.touchbit.shields4j:test-core
[INFO] from version 1.0.0 to 1.0.0-SNAPSHOT
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Shields4J 1.0.0 .................................... SUCCESS [ 0.992 s]
[INFO] test-core .......................................... SKIPPED
[INFO] Shields4J client ................................... SKIPPED
[INFO] TestNG listener 1.0.0 .............................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.483 s
[INFO] Finished at: 2019-04-21T02:40:42+03:00
[INFO] ------------------------------------------------------------------------
$ mvn clean deploy -DskipTests=${SKIP_TESTS}
[INFO] Scanning for projects...
[INFO] Inspecting build with total of 4 modules...
[INFO] Installing Nexus Staging features:
[INFO] ... total of 4 executions of maven-deploy-plugin replaced with nexus-staging-maven-plugin
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Shields4J [pom]
[INFO] test-core [jar]
[INFO] Shields4J client [jar]
[INFO] TestNG listener [jar]
[INFO]
[INFO] --------------< org.touchbit.shields4j:shields4j-parent >---------------
[INFO] Building Shields4J 1.0.0-SNAPSHOT [1/4]
[INFO] --------------------------------[ pom ]---------------------------------
...
DELETED
...
[INFO] * Bulk deploy of locally gathered snapshot artifacts finished.
[INFO] Remote deploy finished with success.
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Shields4J 1.0.0-SNAPSHOT ........................... SUCCESS [ 2.375 s]
[INFO] test-core .......................................... SUCCESS [ 3.929 s]
[INFO] Shields4J client ................................... SUCCESS [ 3.815 s]
[INFO] TestNG listener 1.0.0-SNAPSHOT ..................... SUCCESS [ 36.134 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 47.629 s
[INFO] Finished at: 2019-04-21T02:41:32+03:00
[INFO] ------------------------------------------------------------------------
Π ΡΠ΅Π·ΡΠ»ΡΡΠ°ΡΠ΅ Π² nexus Π·Π°Π³ΡΡΠΆΠ΅Π½Π° Π²Π΅ΡΡΠΈΡ
ΠΡΠ΅ snapshot Π²Π΅ΡΡΡΠΈ ΠΌΠΎΠΆΠ½ΠΎ ΡΠ΄Π°Π»ΠΈΡΡ ΠΈΠ· ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΡ Π½Π° ΡΠ°ΠΉΡΠ΅
ΠΡΠ±Π»ΠΈΠΊΠ°ΡΠΈΡ release Π²Π΅ΡΡΠΈΠΈ
ΠΡΠΈ ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠ΅ ΡΠ΅Π³Π°, Π°Π²ΡΠΎΠΌΠ°ΡΠΈΡΠ΅ΡΠΊΠΈ ΡΡΠΈΠ³Π³Π΅ΡΠΈΡΡΡ ΡΠΎΠΎΡΠ²Π΅ΡΡΡΠ²ΡΡΡΠ°Ρ Π·Π°Π΄Π°ΡΠ° Π² ΠΏΡΠΎΠ΅ΠΊΡΠ΅ deploy Π½Π° Π·Π°Π³ΡΡΠ·ΠΊΡ ΡΠ΅Π»ΠΈΠ·Π½ΠΎΠΉ Π²Π΅ΡΡΠΈΠΈ Π² nexus (
Π‘Π°ΠΌΠΎΠ΅ ΠΏΡΠΈΡΡΠ½ΠΎΠ΅, ΡΡΠΎ Π°Π²ΡΠΎΠΌΠ°ΡΠΈΡΠ΅ΡΠΊΠΈ ΡΡΠ°Π±Π°ΡΡΠ²Π°Π΅Ρ close release Π² nexus.
[INFO] Performing remote staging...
[INFO]
[INFO] * Remote staging into staging profile ID "9043b43f77dcc9"
[INFO] * Created staging repository with ID "orgtouchbit-1037".
[INFO] * Staging repository at https://oss.sonatype.org:443/service/local/staging/deployByRepositoryId/orgtouchbit-1037
[INFO] * Uploading locally staged artifacts to profile org.touchbit
[INFO] * Upload of locally staged artifacts finished.
[INFO] * Closing staging repository with ID "orgtouchbit-1037".
Waiting for operation to complete...
.........
[INFO] Remote staged 1 repositories, finished with success.
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Shields4J 1.0.0 .................................... SUCCESS [ 9.603 s]
[INFO] test-core .......................................... SUCCESS [ 3.419 s]
[INFO] Shields4J client ................................... SUCCESS [ 9.793 s]
[INFO] TestNG listener 1.0.0 .............................. SUCCESS [01:23 min]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:47 min
[INFO] Finished at: 2019-04-21T04:05:46+03:00
[INFO] ------------------------------------------------------------------------
Π Π΅ΡΠ»ΠΈ ΡΡΠΎ-ΡΠΎ ΠΏΠΎΡΠ»ΠΎ Π½Π΅ ΡΠ°ΠΊ, ΡΠΎ Π·Π°Π΄Π°ΡΠ° ΠΎΠ±ΡΠ·Π°ΡΠ΅Π»ΡΠ½ΠΎ Π·Π°Π²Π°Π»ΠΈΡΡΡ
[INFO] Performing remote staging...
[INFO]
[INFO] * Remote staging into staging profile ID "9043b43f77dcc9"
[INFO] * Created staging repository with ID "orgtouchbit-1038".
[INFO] * Staging repository at https://oss.sonatype.org:443/service/local/staging/deployByRepositoryId/orgtouchbit-1038
[INFO] * Uploading locally staged artifacts to profile org.touchbit
[INFO] * Upload of locally staged artifacts finished.
[INFO] * Closing staging repository with ID "orgtouchbit-1038".
Waiting for operation to complete...
.......
[ERROR] Rule failure while trying to close staging repository with ID "orgtouchbit-1039".
[ERROR]
[ERROR] Nexus Staging Rules Failure Report
[ERROR] ==================================
[ERROR]
[ERROR] Repository "orgtouchbit-1039" failures
[ERROR] Rule "signature-staging" failures
[ERROR] * No public key: Key with id: (1f42b618d1cbe1b5) was not able to be located on <a href=http://keys.gnupg.net:11371/>http://keys.gnupg.net:11371/</a>. Upload your public key and try the operation again.
...
[ERROR] Cleaning up local stage directory after a Rule failure during close of staging repositories: [orgtouchbit-1039]
[ERROR] * Deleting context 9043b43f77dcc9.properties
[ERROR] Cleaning up remote stage repositories after a Rule failure during close of staging repositories: [orgtouchbit-1039]
[ERROR] * Dropping failed staging repository with ID "orgtouchbit-1039" (Rule failure during close of staging repositories: [orgtouchbit-1039]).
[ERROR] Remote staging finished with a failure: Staging rules failure!
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Shields4J 1.0.0 .................................... SUCCESS [ 4.073 s]
[INFO] test-core .......................................... SUCCESS [ 2.788 s]
[INFO] Shields4J client ................................... SUCCESS [ 3.962 s]
[INFO] TestNG listener 1.0.0 .............................. FAILURE [01:07 min]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
Π ΡΠ΅Π·ΡΠ»ΡΠ°ΡΠ΅ Π½Π°ΠΌ ΠΎΡΡΠ°Π΅ΡΡΡ Π΅Π΄ΠΈΠ½ΡΡΠ²Π΅Π½Π½ΡΠΉ Π²ΡΠ±ΠΎΡ. ΠΠ»ΠΈ ΡΠ΄Π°Π»ΠΈΡΡ Π΄Π°Π½Π½ΡΡ Π²Π΅ΡΡΠΈΡ ΠΈΠ»ΠΈ ΠΎΠΏΡΠ±Π»ΠΈΠΊΠΎΠ²Π°ΡΡ.
ΠΠΎΡΠ»Π΅ ΡΠ΅Π»ΠΈΠ·Π°, ΡΠ΅ΡΠ΅Π· Π½Π΅ΠΊΠΎΡΠΎΡΠΎΠ΅ Π²ΡΠ΅ΠΌΡ Π°ΡΡΠ΅ΡΠ°ΠΊΡΡ ΠΎΠΊΠ°ΠΆΡΡΡΡ Π²
ΠΎΡΡΠΎΠΏ
ΠΠ»Ρ ΠΌΠ΅Π½Ρ Π±ΡΠ»ΠΎ ΠΎΡΠΊΡΡΡΠΈΠ΅ΠΌ, ΡΡΠΎ maven ΠΈΠ½Π΄Π΅ΠΊΡΠΈΡΡΠ΅Ρ Π΄ΡΡΠ³ΠΈΠ΅ ΠΏΡΠ±Π»ΠΈΡΠ½ΡΠ΅ ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠΈ.
ΠΡΠΈΡΠ»ΠΎΡΡ ΠΏΠΎΠ΄ΠΊΠΈΠ½ΡΡΡ robots.txt, ΡΠ°ΠΊ ΠΊΠ°ΠΊ ΠΎΠ½ ΠΏΡΠΎΠΈΠ½Π΄Π΅ΠΊΡΠΈΡΠΎΠ²Π°Π» ΠΌΠΎΠΉ ΡΡΠ°ΡΡΠΉ ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠΉ.
ΠΠ°ΠΊΠ»ΡΡΠ΅Π½ΠΈΠ΅
Π§ΡΠΎ ΠΌΡ ΠΈΠΌΠ΅Π΅ΠΌ
- ΠΡΠ΄Π΅Π»ΡΠ½ΡΠΉ deploy-ΠΏΡΠΎΠ΅ΠΊΡ Π² ΠΊΠΎΡΠΎΡΠΎΠΌ ΠΌΠΎΠΆΠ½ΠΎ ΡΠ΅Π°Π»ΠΈΠ·ΠΎΠ²Π°ΡΡ Π½Π΅ΡΠΊΠΎΠ»ΡΠΊΠΎ CI Π·Π°Π΄Π°Ρ Π½Π° Π·Π°Π³ΡΡΠ·ΠΊΡ Π°ΡΡΠ΅ΡΠ°ΠΊΡΠΎΠ² Π² ΠΏΡΠ±Π»ΠΈΡΠ½ΡΠ΅ ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠΈ Π΄Π»Ρ ΡΠ°Π·Π»ΠΈΡΠ½ΡΡ ΡΠ·ΡΠΊΠΎΠ² ΡΠ°Π·ΡΠ°Π±ΠΎΡΠΊΠΈ.
- Deploy-ΠΏΡΠΎΠ΅ΠΊΡ ΠΈΠ·ΠΎΠ»ΠΈΡΠΎΠ²Π°Π½ ΠΎΡ ΠΏΠΎΡΡΠΎΡΠΎΠ½Π½Π΅Π³ΠΎ Π²ΠΌΠ΅ΡΠ°ΡΠ΅Π»ΡΡΡΠ²Π° ΠΈ ΠΌΠΎΠΆΠ΅Ρ Π±ΡΡΡ ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ ΡΠΎΠ»ΡΠΊΠΎ ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»ΡΠΌΠΈ Ρ ΡΠΎΠ»ΡΡ Owner ΠΈ Maintainer.
- ΠΡΠ΄Π΅Π»ΡΠ½ΡΠΉ Specific Runner Ρ "Π³ΠΎΡΡΡΠΈΠΌ" ΠΊΡΡΠ΅ΠΌ Π΄Π»Ρ Π·Π°ΠΏΡΡΠΊΠ° ΡΠΎΠ»ΡΠΊΠΎ deploy Π·Π°Π΄Π°Ρ.
- ΠΡΠ±Π»ΠΈΠΊΠ°ΡΠΈΡ snapshot/release Π²Π΅ΡΡΠΈΠΉ Π² ΠΏΡΠ±Π»ΠΈΡΠ½ΠΎΠΌ ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠΈ.
- ΠΠ²ΡΠΎΠΌΠ°ΡΠΈΡΠ΅ΡΠΊΠ°Ρ ΠΏΡΠΎΠ²Π΅ΡΠΊΠ° release Π²Π΅ΡΡΠΈΠΈ Π½Π° Π³ΠΎΡΠΎΠ²Π½ΠΎΡΡΡ ΠΊ ΠΏΡΠ±Π»ΠΈΠΊΠ°ΡΠΈΠΈ Π² maven central.
- ΠΠ°ΡΠΈΡΠ° ΠΎΡ Π°Π²ΡΠΎΠΌΠ°ΡΠΈΡΠ΅ΡΠΊΠΎΠΉ ΠΏΡΠ±Π»ΠΈΠΊΠ°ΡΠΈΠΈ "ΡΡΡΡΡ " Π²Π΅ΡΡΠΈΠΉ Π² maven central.
- Π‘Π±ΠΎΡΠΊΠ° ΠΈ ΠΏΡΠ±Π»ΠΈΠΊΠ°ΡΠΈΡ snapshot Π²Π΅ΡΡΠΈΠΉ "ΠΏΠΎ ΠΊΠ»ΠΈΠΊΡ".
- ΠΠ΄ΠΈΠ½ΡΠΉ ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠΉ Π΄Π»Ρ ΠΏΠΎΠ»ΡΡΠ΅Π½ΠΈΡ snapshot/release Π²Π΅ΡΡΠΈΠΉ.
- ΠΠ±ΡΠΈΠΉ ΠΏΠ°ΠΉΠΏΠ»Π°ΠΉΠ½ Π½Π° ΡΠ±ΠΎΡΠΊΡ/ΡΠ΅ΡΡΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅/ΠΏΡΠ±Π»ΠΈΠΊΠ°ΡΠΈΡ java ΠΏΡΠΎΠ΅ΠΊΡΠ°.
ΠΠ°ΡΡΡΠΎΠΉΠΊΠ° GitLab CI Π½Π΅ ΡΠ°ΠΊΠ°Ρ ΡΠ»ΠΎΠΆΠ½Π°Ρ ΡΠ΅ΠΌΠ° ΠΊΠ°ΠΊ ΠΊΠ°ΠΆΠ΅ΡΡΡ Π½Π° ΠΏΠ΅ΡΠ²ΡΠΉ Π²Π·Π³Π»ΡΠ΄. ΠΠΎΡΡΠ°ΡΠΎΡΠ½ΠΎ ΠΏΠ°ΡΡ ΡΠ°Π· Π½Π°ΡΡΡΠΎΠΈΡΡ CI "ΠΏΠΎΠ΄ ΠΊΠ»ΡΡ" ΠΈ Π²ΠΎΡ, ΡΡ ΡΠΆΠ΅ Π΄Π°Π»Π΅ΠΊΠΎ Π½Π΅ Π΄ΠΈΠ»Π΅ΡΠ°Π½Ρ Π² ΡΡΠΎΠΌ Π΄Π΅Π»Π΅. Π’Π΅ΠΌ Π±ΠΎΠ»Π΅Π΅ GitLab Π΄ΠΎΠΊΡΠΌΠ΅Π½ΡΠ°ΡΠΈΡ Π²Π΅ΡΡΠΌΠ° ΠΈΠ·Π±ΡΡΠΎΡΠ½Π°. ΠΠ΅ Π±ΠΎΠΉΡΠ΅ΡΡ Π΄Π΅Π»Π°ΡΡ ΠΏΠ΅ΡΠ²ΡΠΉ ΡΠ°Π³. ΠΠΎΡΠΎΠ³Π° Π²ΠΎΠ·Π½ΠΈΠΊΠ°Π΅Ρ ΠΏΠΎΠ΄ ΡΠ°Π³Π°ΠΌΠΈ ΠΈΠ΄ΡΡΠ΅Π³ΠΎ (Π½Π΅ ΠΏΠΎΠΌΠ½Ρ ΠΊΡΠΎ ΡΠΊΠ°Π·Π°Π» π ).
ΠΡΠ΄Ρ ΡΠ°Π΄ ΡΠΈΠ΄Π±ΡΠΊΡ.
Π ΡΠ»Π΅Π΄ΡΡΡΠ΅ΠΉ ΡΡΠ°ΡΡΠ΅ ΡΠ°ΡΡΠΊΠ°ΠΆΡ ΠΎ ΡΠΎΠΌ, ΠΊΠ°ΠΊ Π½Π°ΡΡΡΠΎΠΈΡΡ GitLab CI Π΄Π»Ρ ΠΊΠΎΠ½ΠΊΡΡΠ΅Π½ΡΠ½ΠΎΠ³ΠΎ Π·Π°ΠΏΡΡΠΊΠ° Π·Π°Π΄Π°Ρ Ρ ΠΈΠ½ΡΠ΅Π³ΡΠ°ΡΠΈΠΎΠ½Π½ΡΠΌΠΈ ΡΠ΅ΡΡΠ°ΠΌΠΈ (Ρ Π·Π°ΠΏΡΡΠΊΠΎΠΌ ΡΠ΅ΡΡΠΈΡΡΠ΅ΠΌΡΡ ΡΠ΅ΡΠ²ΠΈΡΠΎΠ² ΠΏΡΠΈ ΠΏΠΎΠΌΠΎΡΠΈ docker-compose), Π΅ΡΠ»ΠΈ Ρ Π²Π°Ρ Π΅ΡΡΡ ΡΠΎΠ»ΡΠΊΠΎ ΠΎΠ΄ΠΈΠ½ shell ΡΠ°Π½Π½Π΅Ρ.
ΠΡΡΠΎΡΠ½ΠΈΠΊ: habr.com