GitLab CI
GitLab CI
全部で2ステップ:1.セットアップGitLab Runner 2.作成提出.gitlab-ci.ymlファイル。設定が完了すると、コミットまたは転送のたびにCIがトリガされます。
GitLab Runnerの設置と配置
他のシステムでは非常に詳細な公式文書がインストールされています。以下はLinux環境下のデモのみです。
https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64
はダウンロードツールを使ってサンダーダウンロード後にアップロードしたり、他の国内のミラーを探したりします。):# 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
sudo useradd --comment 'GitLab Runner' --create-home gitlab-runner --shell /bin/bash
sudo gitlab-runner install --user=gitlab-runner --working-directory=/home/gitlab-runner
sudo gitlab-runner start
停止サービス:sudo gitlab-runner stop
sudo gitlab-runner register
Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com )
https://gitlab.com
Please enter the gitlab-ci token for this runner
xxx
Please enter the gitlab-ci description for this runner
xboot
Please enter the gitlab-ci tags for this runner (comma separated):
xboot
Please enter the executor: ssh, docker+machine, docker-ssh+machine, kubernetes, docker, parallels, virtualbox, docker-ssh, shell:
shell
.gitlab-ci.yml
ファイルを作成するstages:
- build
- test
- deploy
#
build:
stage: build
#
script:
- echo " "
- echo "mvn clean..."
- echo " "
#
test:
stage: test
script:
- echo " "
- echo "java -test..."
- echo " "
#
deploy:
stage: deploy
script:
- echo " "
- echo "mvn install..."
- echo " "
詳細は公式文書を参照してください。https://docs.gitlab.com/ee/ci/yaml/README.html
build:
#
when: manual
stage: build
build:
# tags xboot Runner
tags:
- xboot
stage: build