Bitbucket Pipelines çšãã€ãã®äœææ¹æ³
ãã€ãã¯ãã¿ã¹ã¯ãå®è¡ããããã®ã¹ã¯ãªãããå«ããã³ã³ããçšã®ã«ã¹ã¿ã Docker ã€ã¡ãŒãžã§ããå€æ°ã®ãã€ããæäŸãããŠããŸãããèªèº«ã§äœæããããšãã§ããŸãã
1 ã€ã®ãã€ãã¯ããã€ãã®ç°ãªããã¡ã€ã«ã§æ§æãããŸãã
- ã¹ã¯ãªããããŸãã¯ãã€ããªãã¿ã¹ã¯ãå®è¡ããã³ãŒãã
- Dockerfileãã¹ã¯ãªãããå®è¡ãã Docker ã³ã³ããã®æ§ç¯æ¹æ³ã瀺ããŸãã
- (ãªãã·ã§ã³) ã¡ã¿ããŒã¿ãš readme ããã¥ã¡ã³ãããã€ãã«ã€ããŠç解ããã®ã«åœ¹ç«ã¡ãŸãã
- (ãªãã·ã§ã³) ãã€ããç°¡åã«æŽæ°ã§ããããã«ãããããã€ãã® CI/CD æ§æã
ãããã®ãã¡ã€ã«ã¯ 1 ç®æ (éåžžã¯ãã€ã ãªããžããª) ã«æ ŒçŽãããŸãã
ãã€ããèšè¿°ããçç±
ãã€ããèšè¿°ããçç±ã¯ããã€ããããŸãã
- ãã€ãã©ã€ã³ã®è€æ°ã®ã¹ãããã§åãã¢ã¯ã·ã§ã³ãå®è¡ãããã
- è€æ°ã®ãªããžããªã§åæ§ã®ã¿ã¹ã¯ãå®è¡ãããã
- ãã³ããŒã®å ŽåããœãããŠã§ã¢ãŸãã¯ãµãŒãã¹ããã€ãã©ã€ã³ã«ãã£ãŠäœ¿ãããããããã
- ã¡ã€ã³ã®ãã€ãã©ã€ã³ã«ã¯ãªããäŸåé¢ä¿ãå¿ èŠãšããã¢ã¯ã·ã§ã³ãå®è¡ãããã
ãã€ããäœæããããšã§ãPipelines ã®æ§æãç°¡çŽ åããç°¡åãã€å¹ççã«åå©çšã§ããããã«ãªããŸãã
ãã€ãã®å¯èœæ§ã¯ç¡éã§ãããããã«å©çšã§ãã次ã®ãããªãã€ããæäŸããŠããŸãã
- Elastic Beanstalk ã«ã³ãŒãããããã€ããÂ
- Lambda é¢æ°ããããã€ããÂ
- npm ããã±ãŒãžãå ¬éããÂ
- Slack ã«éç¥ãéä¿¡ãã
- Opsgenie ã«ã¢ã©ãŒããéä¿¡ãã
ãã€ããèšè¿°ããæ¹æ³
å¿ èŠãªå 容ã«å¿ããŠãã·ã³ãã«ãªãã€ããŸãã¯å®å šãªãã€ããäœãããšãã§ããŸãããããã¯åãããã«åäœããŸãããè¿œå å¯èœãªè©³çŽ°èšå®ãæ§æãç°ãªããŸãã
simple | å®å šãªãã€ã |
---|---|
ããã«å©çšãéå§ | ã¹ã¹ã ãã©ã¯ãã£ã¹ |
åŸããã®æŽæ°ã¯è€éæ§ãé«ããå¯èœæ§ããã | CI/CD ã«ããããŒãžã§ãã³ã°ã®èªåå |
æå°éã®æ§æ | ä»ã®ãŠãŒã¶ãŒãèªèº«ãå°æ¥äœ¿çšã§ããã䟿å©ãªããã¥ã¡ã³ã |
ç§çå©çšã®ã¿ | ããŒã±ãããã¬ã€ã¹ã«è¿œå å¯èœ |
次㮠3 ãã¡ã€ã«
| åè¿°ã® 3 ã€ã®ãã¡ã€ã«ãšæ¬¡ã®ãã¡ã€ã«
|
ãã®ã¬ã€ãã§ã¯ããŸãã·ã³ãã«ãªãã€ããäœæãããããå®å
šãªãã€ãã«ããæé ã«ã€ããŠèª¬æããŸããã³ã³ããããã«ãã㊠Dockerhub ã«ã¢ããããŒããããããDockerhub ã«ã¢ã«ãŠã³ããããããšã確èªããŠãã ãã (ç¡æã§ã»ããã¢ããã§ããŸã)ã
Prerequisites
- ãã€ãã¯ãdocker ããã®ãããªã㯠ã€ã¡ãŒãžã§ã®ã¿æ©èœããŸãã
- Docker ã«ç²ŸéããŠããŠãç§ç䜿çšã®ããã«ã®ã¿ãã€ããäœæãããå Žåãå¿ èŠãªãã¹ãŠã®ãã¡ã€ã«ãå«ãç¬èªã® Docker ã³ã³ãããäœæã§ããŸãã
ã¹ããã 1 - ãªããžããªãäœæãŸãã¯ã€ã³ããŒããã
æåã«ããã¡ã€ã«ãé 眮ããå Žæãå¿ èŠãšãªãããããªããžããªãäœæããŸãã
ãã€ã ãªããžããªãäœæããæ¹æ³ã¯äž»ã« 3 ã€ãããŸãã
- 空ã®ãªããžããªãäœæãã (å«ããæ å ±ã«ã€ããŠã¯åŸè¿°ããŸã)
- ãµã³ãã« ãªããžããªã®ãããã 1 ã€ãã€ã³ããŒããã
- ã¢ãã©ã·ã¢ã³ã®ãžã§ãã¬ãŒã¿ã䜿çšããŠããŒã«ã« ãªããžããªãäœæãã (å®å šãªãã€ãã§ã®ã¿æšå¥š)
ãŸãã ã·ã³ãã«ãªãã€ã ãªããžã㪠1 ã€ãšãåç §ã«äœ¿çšããããã€ã³ããŒããããã§ããå®å šãªãã€ã ãªããžã㪠2 〠(Bash çšãš Python çš) ã®ã3 ã€ã®ãµã³ãã«ãªããžããªãçšæããŠããŸãã
å®å šãªãã€ããäœãããå Žåãã¢ãã©ã·ã¢ã³ã®ãžã§ãã¬ãŒã¿ã䜿çšããŠãã¬ãŒã ã¯ãŒã¯ãäœæãããã¡ã€ã«ã«éšåçã«å ¥åã§ããŸãã
ã¹ããã 2 - ã¹ã¯ãªãããŸãã¯ãã€ããªãäœæãã
ããã¯ãã€ããåŒã³åºããããšãã«å®è¡ãããããã€ãã®äž»èŠéšåã§ãããã€ã ã¿ã¹ã¯ãå®è¡ããããã®ãã¹ãŠã®ã³ãã³ããšããžãã¯ãå«ãŸããŸããä»»æã®ã³ãŒãã£ã³ã°èšèªã䜿çšããŠãã¹ã¯ãªãããŸãã¯ãã€ã㪠ãã¡ã€ã«ãäœæããŸãã
ç°¡åãªã¹ã¯ãªããã¯æ¬¡ã®ããã«ãªããŸãã
#!/usr/bin/env bash
set -e
echo 'Hello World'
åŠçãæ¡åŒµãããå Žåãå€æ°ã䜿çšã§ããŸãã
ãã€ããåŒã³åºããã€ãã©ã€ã³ ã¹ãããã§äœ¿çšå¯èœãªä»»æã®ããã©ã«ãå€æ° (ããã©ã«ãå€æ°ã®äžèŠ§ãåç §) ãšããã€ããåŒã³åºããããšãã«æäŸãããä»»æã®ãã€ãå€æ°ã䜿çšã§ããŸããpipe.yml ã«èšèŒããå ŽåããŠãŒã¶ãŒå®çŸ©ã®å€æ° (ã¢ã«ãŠã³ããšããŒã ããªããžããªããŸãã¯ãããã€ã¡ã³ã) ã®ã¿ã䜿çšã§ããŸã (詳现ã¯åŸè¿°)ã
#!/usr/bin/env bash
set -e
echo 'Hello $BITBUCKET_REPO_OWNER'
#when you call the pipe from your pipeline
#you can provide variables, for example here: GREETING
echo '$GREETING'
ããã€ãã®å€æ°ãå¿
é ã«ããããæå®ããæ¢å®å€ãå€æ°ã§äœ¿çšããããã«ãããããããšãã§ããŸããæ¢å®å€ãæå®ããæ¹æ³ã¯ 2 ãšãããããŸããããã§ã¯ã¹ã¯ãªããã§ã®å®çŸ©æ¹æ³ã瀺ããŸãããåŸã»ã©ãpipe.yml
ãã¡ã€ã«ã䜿çšããããã匷åãªæ¹æ³ã«ã€ããŠèª¬æããŸããbash ã®å®å
šãªãã€ãã®äŸã§ã¯äž¡æ¹ã«ã€ããŠèª¬æããŸãã
ãã€ãã®ãšã³ã ãŠãŒã¶ãŒã䜿ãããããããå¿ é å€æ°ã¯æå°éã«æããããšãããããããŸããå€æ°ã«é©åãªæ¢å®å€ãããå Žåã¯ã¹ã¯ãªããã§ããããæå®ãããšããšã³ã ãŠãŒã¶ãŒã¯å¿ èŠã«å¿ããŠå€æ°ããªãŒããŒã©ã€ãã§ããŸãã
ãŸãããã°åºåã«è²ãè¿œå ããå€éšæ å ±ã«é·ç§»ã§ããã¯ãªãã¯å¯èœãªãªã³ã¯ãæäŸããããšãããããããŸãã
ããããã¹ã¯ãªãããå®è¡ãããããã¹ã¯ãªãããå®è¡å¯èœã§ããå¿
èŠããããŸã (ãããã£ãŠãã¿ãŒããã«ã§ chmod +x pipe.sh
ãå®è¡ããããšãå¿
èŠãªå¯èœæ§ããããŸã)ãã¢ãã©ã·ã¢ã³ã®ãµã³ãã« ãªããžããªã䜿çšããŠããå Žåãããã¯ãã§ã«å®äºããŠããŸãã
ã¹ããã 3: Dockerfile ãæ§æãã
å
ã»ã©äœæããã¹ã¯ãªãããå®è¡ããã«ã¯ãã¹ã¯ãªããã Docker ã³ã³ããã«å
¥ããå¿
èŠããããŸããDockerfile
ã¯ããã® Docker ã³ã³ãããæ§ç¯ããæ¹æ³ã®è©³çŽ°ãå®çŸ©ããŸããæäœã§ããFROM
ãCOPY
ãããã³ ENTRYPOINT
ã®å€ãå¿
èŠã§ãã
bash ã®å®å šãªãã€ãã®ãµã³ãã«ã®å Žåããã§ã«ã«ãŒã ãã£ã¬ã¯ããªã« Dockerfile ãå«ãŸããŠããŸãã
FROM alpine:3.8
RUN apk update && apk add bash
COPY pipe /
ENTRYPOINT ["/pipe.sh"]
ãã®å Žåãã³ã³ããã¯æ¬¡ã®ããšãå®è¡ããŸãã
- Alpine Linux 3.8 ã€ã¡ãŒãžã䜿çšãã
- æŽæ°ã³ãã³ããå®è¡ããã³ã³ããã« bash ãã€ã³ã¹ããŒã«ãã
- pipe ãã£ã¬ã¯ããªã®å 容ãã«ãŒã ãã£ã¬ã¯ããªã«ã³ããŒãã
- pipe.sh ã®å®è¡ãéå§ãã
ããããããŒãºã«åãããŠç·šéã§ããŸããAlpine Linux 3.9 ã䜿çšãããå ŽåãFROM alpine:3.9
ãèªã¿èŸŒãããã« FROM
ãå€æŽããã ãã§ãã
Linux ã«ããã«ããã±ãŒãžãã€ã³ã¹ããŒã«ãããå ŽåãRUN
ã³ãã³ãã«è¿œå ããŸãããã®åã«ããããã®ããã±ãŒãžãã€ã³ã¹ããŒã«æžã¿ã®ã€ã¡ãŒãžããããã©ããã Dockerhub ã§ç¢ºèªããŠãã ãããããã«ããã貎éãªæéãç¯çŽã§ããŸãã
åžæã©ããã®ã¹ã¯ãªãããšã³ã³ãããäœæããããã«ãè€æ°åã®å埩äœæ¥ãå¿ èŠã«ãªãããšããããŸãããããèæ ®ããDocker ãããŒã«ã« ãã·ã³ã«ã€ã³ã¹ããŒã«ããããšãããããããŸããããããããšã§ããã«ãæéã䜿çšããã«ãã€ã ã³ã³ããã®ãã«ããšå®è¡ããã¹ãã§ããŸããÂ
ã¹ããã 4 - ãã€ã ã³ã³ããã Dockerhub ã«æŽæ°ããããã®åºæ¬çãªãã€ãã©ã€ã³ãäœæãã
ã·ã³ãã«ãªãã€ããäœæããæåŸã®ã¹ãããã¯ãã³ã³ãããæ§ç¯ããããã Dockerhub ã«ã¢ããããŒãããããšã§ãã
å¿ ããããã€ãã©ã€ã³ã䜿çšããå¿ èŠã¯ãããŸããããããã«ãã£ãŠå°æ¥ã®æŽæ°ã容æã«ãªããããŒãžã§ã³çªå·ãèªåçã«æŽæ°ããããããææ°ããŒãžã§ã³ã䜿çšããŠããããšããã°ãã確èªã§ããŸãã
以äžã®ãµã³ãã«ã® bitbucket-pipelines.yml
ã¯ãã³ãããã®ãã³ã«ã³ã³ããã®æ°ããããŒãžã§ã³ããã«ãã㊠Dockerhub ã«ããã·ã¥ããŸãããããã£ãŠãDocker ã³ã³ããã§äœ¿çšãããã€ã¡ãŒãžãæŽæ°ããããã¹ã¯ãªãããå€æŽããããããšããã®ãã¡ã€ã«ã«ãã£ãŠ Dockerhub ã®ããŒãžã§ã³ãèªåçã«ææ°ã«ä¿ãããŸããdockerhub ã¢ã«ãŠã³ããæã£ãŠããããšã確èªããããpipe ãªããžããªã« 2 ã€ã®å€æ°: DOCKERHUB_USERNAME
ãš DOCKERHUB_PASSWORD
ããè¿œå ãããã€ãã©ã€ã³ãæå¹åããŸãã
image:
name: atlassian/default-image:2
pipelines:
default:
- step:
name: Build and Push
script:
# Build and push image
- VERSION="1.$BITBUCKET_BUILD_NUMBER"
- echo ${DOCKERHUB_PASSWORD} | docker login --username "$DOCKERHUB_USERNAME" --password-stdin
- IMAGE="$DOCKERHUB_USERNAME/$BITBUCKET_REPO_SLUG"
- docker build -t ${IMAGE}:${VERSION} .
- docker tag ${IMAGE}:${VERSION} ${IMAGE}:latest
- docker push ${IMAGE}
# Push tags
- git tag -a "${VERSION}" -m "Tagging for release ${VERSION}"
- git push origin ${VERSION}
services:
- docker
ããã§ã·ã³ãã«ãªãã€ããã§ããŸããã
ã·ã³ãã«ãªãã€ãã«å¿ èŠãªæé ã¯ä»¥äžã§ããããã§ã次ã®æ§æã䜿çšããŠãã¹ãããã§ãã€ããåç §ã§ããããã«ãªããŸããã
pipe: docker://<DockerAccountName>/<ImageName>:<version>
ãã€ãäœæã®æ¬¡ã®ã¹ãããã¯ãé·æçãªå©äŸ¿æ§ãé«ããä»ã®ãŠãŒã¶ãŒããã€ãã䜿çšããããããããã«èšèšãããŠããŸããæ£åŒã«ãµããŒãããããã€ããäœããããŠãŒã¶ãŒã®å Žåããã®ã¹ããããå¿ èŠã§ãã
å®å šãªãã€ããäœæããå Žåã¯ã以äžãã»ããã¢ããããå¿ èŠããããŸãã
- ãã€ãã®ã¡ã¿ããŒã¿ -ãã€ãã®è©³çŽ° (ä¿å®æ åœè ã®ååãªã©)
- readme - ãã€ãã®äœ¿çšæ¹æ³ã®è©³çŽ° (å¿ èŠãªå€æ°ãªã©)
- èªåãã¹ã - å€æŽã«ãã£ãŠåé¡ãçºçããŠããªãããšã®ç¢ºèª
- ã»ãã³ãã£ã㯠ããŒãžã§ãã³ã° - 䜿çšãããã€ãã®ããŒãžã§ã³ãæ確ã«ãã
- ãããã° ãã®ã³ã° - äœãåé¡ãçããå Žåã«ãšã³ã ãŠãŒã¶ãŒã容æã«ãã©ãã«ã·ã¥ãŒãã£ã³ã°ã§ããããã«ãã
ãããã¯ãµã³ãã« ãªããžã㪠(Bash ãš Python) ã§æ§ææžã¿ãªã®ã§ããªã³ã¯å ãã確èªãã ããã次ã®ã¹ãããããæ¡å ããŸãã
ã¹ããã 5 - pipe.yml
(ã¡ã¿ããŒã¿ ãã¡ã€ã«) ãäœæãã
pipe.yml ãã¡ã€ã«ã¯ããã€ããåé¡ããããã®äŸ¿å©ãªæ å ±ãæäŸããŸãã
ããŒã¯ãŒã | 説æ |
---|---|
| ãã€ãã«å¯ŸããŠè¡šç€ºããååãŸãã¯ã¿ã€ãã«ã |
| account/repo:tag ã®åœ¢åŒã§ Dockerhub äžã§äœæããããã€ãã® Docker ã€ã¡ãŒãžã |
category | Category of the pipe. Can be one of:
|
description | ãã€ãã®å®è¡å 容ã説æããç°¡åãªèŠçŽã |
| Bitbucket pipe repository absolute URL. Example: atlassian/demo-pipe-bash |
| Object that contains name, website and email.
|
| Object that contains name, website and email. For vendor pipes this field is mandatory.
|
| Keywords to help users find and categorize the pipe. Options could include the type of function your pipe performs (deploy, notify, test) or your product, or company, name, or specific tools you are integrating with. |
pipe.yml ãã¡ã€ã«ã¯æ¬¡ã®ããã«ãªããŸãã
ã¹ããã 6 - README.md
(readme ãã¡ã€ã«) ãäœæãã
ãŠãŒã¶ãŒã¯ readme ã䜿çšããŠããã€ãã®äœ¿çšæ¹æ³ã確èªã§ããŸãããã㯠Bitbucket ã§è¡šç€ºããããããããŒã¯ããŠã³ã§ç¹å®ã®åœ¢åŒã§èšè¿°ããèŠåºããé çªã«äžŠã¹ãå¿ èŠããããŸãã
# Bitbucket Pipelines Pipe: <pipe_name> <pipe_short_description > ## YAML Definition Add the following snippet to the script section of your `bitbucket-pipelines.yml` file: ```yaml <pipe_code_snippet> ``` ## Variables <pipe_variables_table> ## Details <pipe_long_description> ## Prerequisites <pipe_prerequisites> ## Examples <pipe_code_examples> ## Support <pipe_support> |
ã»ã¯ã·ã§ã³ | 説æ |
---|---|
<pipe_name> | ãã€ãå |
<pipe_short_description> | ãã€ãã®å®è¡å
容ã®æŠèŠ - 次ã®åœ¢åŒã䜿çšããããšããå§ãããŸã: "[å®å
| ãã³ã㌠| ã¹ã€ãŒã] (ãžã®) [ã¢ã¯ã·ã§ã³ãè¡šãåè©]" äŸ: "Dockerhub ãžã®ãããã€" ãŸã㯠"Opsgenie ãžã®éç¥" |
<pipe_code_snippet> | ãŠãŒã¶ãŒããã€ãã䜿çšããããã«ãã€ãã©ã€ã³ã«ã³ããŒããŠè²Œãä»ããå¿
èŠããããã® |
<pipe_variable_table> | ãã€ããå¿
èŠãšããå€æ°ã®äžèŠ§ãå¿
é ãä»»æããæ確ã«ããŸãã |
<pipe_long_description> | 䜿çšæ¹æ³ãæ§æãã»ããã¢ãããªã©ã®è©³çŽ°ãªèª¬æã |
<pipe_prerequisites> | ãã€ãã䜿çšããåã«å¿
èŠãšãªããã®ãäŸ: ã€ã³ã¹ããŒã«æžã¿ã®ããã±ãŒãžããµãŒãããŒã㣠ã·ã¹ãã ã®ã¢ã«ãŠã³ãã |
<pipe_code_examples> | ãµã³ãã«å€æ°ãæã€ã³ãŒã ã¹ãããããå°ãªããšã以äžãç¶²çŸ ããããšãããããããŸãã
|
<pipe_support> | 質åããµããŒãã®ããã®åãåããå
ãèšèŒããŸãã |
ã¹ããã 7 - ãã¹ããäœæãã
ãã€ãã«èªåçµ±åãã¹ããè¿œå ããããšãããããããŸããããããããšã§ãäžè¬ã«å ¬éããåã«ãæåŸ ã©ããã«åäœããŠããããšã確èªã§ããŸããããšãã°ãäºæããªãå€æ°ãåŠçããæ¹æ³ããå¿ èŠãªãµãŒã ããŒã㣠ãµãŒãã¹ã«æ£åžžã«æ¥ç¶ã§ãããã©ããããã¹ãã§ããŸããæ£åŒã«ãµããŒããããäºå®ã®ãã€ãã¯ãå®æçã«ãã¹ãããããšãéåžžã«éèŠã§ãã
ã¹ããã 8 - ãã€ãããããã°ãããããã
ã¹ã¯ãªããã«ã¯ããã€ãã§è¡ãããŠããããšã®è¿œå æ å ±ãåºåãããããã° ã¢ãŒããè¿œèšããããšãããããããŸãã
ãŸãããã°ã«è¡šç€ºããããªã³ã¯ãã¯ãªãã¯ã§ããããã«ããåºåã§ã¯è²ã䜿çšããŠéèŠãªæ å ±ã匷調衚瀺ããããšãããããããŸãã
ãããè¡ãæ¹æ³ã¯ã¹ã¯ãªããã®äœæã«äœ¿çšããŠããèšèªã«ãã£ãŠç°ãªããŸãããã¢ãã©ã·ã¢ã³ã® bash ã㢠ãªããžããªã® common.sh ãã¡ã€ã«ã§äŸã確èªã§ããŸãã
ã¹ããã 9 - ãã¹ããšæŽæ°ãèªååãããã CI/CD ãã»ããã¢ãããã
ãŸããCI/CD ã以äžã«äœ¿çšããããšããå§ãããŸãã
- èªåãã¹ã
- Dockerhub (ãŸãã¯éžæãããµã€ã) ãžã®èªåã¢ããããŒã
- 以äžã®ããŒãžã§ã³çªå·ãèªåçã«æŽæ°
- å€æŽå±¥æŽ
- readme
- ã¡ã¿ããŒã¿
bitbucket-pipelines.yml
ãã¡ã€ã«ãæ§æãããããã€ãã©ã€ã³ãæå¹åã§ããŸãããªããžããªã® [èšå®] > [Pipelines] ã»ã¯ã·ã§ã³ > [èšå®] > [ãã€ãã©ã€ã³ã®æå¹å] ã§ãã€ãã©ã€ã³ãæå¹ã«ã§ããŸãã
ã¹ããã 10 - ã»ãã³ãã£ã㯠ããŒãžã§ãã³ã°ãã»ããã¢ãããã
ãã€ãã«ã»ãã³ãã£ã㯠ããŒãžã§ãã³ã° (semver) ã䜿çšããããšããå§ãããŸããããã«ãããã©ã®ããŒãžã§ã³ãææ°ã§ããããã©ã®ããŒãžã§ã³ã䜿çšãã¹ãããæŽæ°ã«ãã£ãŠåé¡ãçºçããå¯èœæ§ããããã©ãããæ確ã«ãªããŸããããŒãžã§ã³ã¯ 3 ã€ã®éšåã«åãããŸã: <major>.<minor>.<patch>ãäŸ: 6.5.2
è¡ã£ãå€æŽã«å¿ããŠããŒãžã§ã³çªå·ãå¢ãããŸãã次ã®ããã«æŽæ°ããŸãã
- major: æ¢åã®ãŠãŒã¶ãŒã«ãã䜿çšã«åé¡ãçããå¯èœæ§ã®ããå€æŽãå ããå Žå (äŸ: å¿ é å€æ°ã®ååã®å€æŽ)
- minor: äžäœäºææ§ã®ããæ¹æ³ã§æ©èœãè¿œå ããå Žå
- patch: äžäœäºææ§ã®ãããã°ä¿®æ£ã®å Žå
ããŒãžã§ã³ãå€æŽããéã¯ãè€æ°ã®å Žæã®æŽæ°ãå¿ èŠãªå ŽåããããŸãããã®äœæ¥ãç°¡çŽ åãããsemversioner (https://pypi.org/project/semversioner/) ãšåŒã°ããããŒã«ããããŸãããã®ããŒã«ã¯ãå€æŽå±¥æŽã«æ°ãããšã³ããªãäœæããããŒãžã§ã³çªå·ãæŽæ°ããŠããªããžããªã«ã³ãããããŸãã
ã¹ããã 11 - æ°ããå®å šãªãã€ãã䜿çšãã
ãã€ãã®ã·ã³ãã«ãªããŒãžã§ã³ãšåæ§ãæåŸã®ã¹ãããã¯ã³ã³ãããæ§ç¯ã㊠Dockerhub ã«ããã·ã¥ããããšã§ããÂ
ä»ã®ãªããžããªã§ãã®ãã€ããåç
§ããæ¹æ³ã¯ 2 ãšãããããŸããbitbucket-pipelines.yml
ãã¡ã€ã«ã§ã¯ã次ã®æäœãå®è¡ã§ããŸãã
- docker ã€ã¡ãŒãžãçŽæ¥åç
§ãã
pipe: docker://acct/repo:tag
(ããã§acct/repo
㯠Dockerhub ã¢ã«ãŠã³ããšãªããžããªã§ã) - Bitbucket ã§ãã¹ããããŠãããã€ã ãªããžããªãåç
§ãã
pipe: <BB_acct>/repo
:tag
(ããã§ãBB_acct/repo
ã¯èªåã® Bitbucket ã¢ã«ãŠã³ããšãã€ã ãªããžããªã§ã)
ãã®åç §ããŒãžã§ã³ã¯ pipe.yml ãã¡ã€ã«ã§ã€ã¡ãŒãžã®ååŸå ãèŠã€ããŸãã
é«åºŠãªãã³ã
- Docker ã€ã¡ãŒãžããã¹ãããå¥ã®ãµãŒãã¹ãããå Žå㯠Dockerhubã䜿çšããå¿ èŠã¯ãããŸããããã€ã¡ãŒãžã¯å ¬éãããŠããå¿ èŠããããŸãã
- Docker ãããŒã«ã« ãã·ã³ã«ã€ã³ã¹ããŒã«ããããšã§ãã¢ããããŒãã®åã«ãã¹ãŠãããŸãåäœããããšããã¹ãã§ããŸãã
- éèŠãªå€æ°ãããå Žåã¯ããããã®å€æ°ãæäŸãããæå¹ã§ããããšãã¹ã¯ãªããã§ãã¹ãããããã«ããŸãã
- å¿ é å€æ°ã¯æå°éã«æããå¯èœã§ããã°æ¢å®å€ãæå®ããŸãã
- äºæãã¬äºæ ãçºçããå Žåã«åããŠãè¿ éãã€å¹ççã«ãã€ã ãµããŒããæäŸã§ããããã»ã¹ãçšæããŠãããŸãããã£ãŒãããã¯ããã°ããåãåãããã€ã ãŠãŒã¶ãŒã«ããè¯ããšã¯ã¹ããªãšã³ã¹ãæäŸã§ããŸãã
- ä»ã®ãã€ããšå
±æããããã¡ã€ã«ããŸãã¯ã¡ã€ã³ ãã€ãã©ã€ã³ã§äœ¿çšãããã¡ã€ã«ãäœæããå Žåããã®ãã¡ã€ã«ã®æš©éãç·šéããå¿
èŠããããŸãããããè¡ãäžè¬çãªæ¹æ³ãšããŠããã€ã ã¹ã¯ãªããã®å
é ã«
umask 000
ãé 眮ããŸãã1 ã€ã®ãã¡ã€ã«ã®å€ã®ã¿ãå€æŽãããå Žåãchown
ãŸãã¯chmod
ã³ãã³ãã䜿çšããããšãã§ããŸãã - æé©ãªåŒçšæ¹æ³ãé
åå€æ°ãæž¡ãæ¹æ³ãªã©ã®ããã«é«åºŠãªãã€ãèšè¿°ãã¯ããã¯ãã芧ãã ããã
å ¬åŒãã€ããžã®åå
ãã€ããç»é²ããŠã¢ãã©ã·ã¢ã³ã®å ¬åŒãªã¹ããžã®è¿œå ãäŸé Œã§ããŸãããã®å Žåãå®å šãªãã€ãã®äœææ¹æ³ã«åŸã£ãŠããããšãã確èªãã ããã
ãã€ãã®æçš¿æ¹æ³ã®è©³çŽ°ãã芧ãã ããã
ãã®å 容ã¯ã圹ã«ç«ã¡ãŸããã?
ã¯ã ãã®èšäºã«ã€ããŠã®ãã£ãŒãããã¯ãéä¿¡ãã