Add GitLab CI/CD configuration
This commit is contained in:
parent
70c71105a1
commit
58b2dd2730
1 changed files with 25 additions and 0 deletions
25
.gitlab-ci.yml
Normal file
25
.gitlab-ci.yml
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
stages:
|
||||||
|
- build
|
||||||
|
- deploy
|
||||||
|
|
||||||
|
variables:
|
||||||
|
DOCKER_IMAGE: "daily-briefing-app"
|
||||||
|
CONTAINER_NAME: "daily-briefing-running"
|
||||||
|
|
||||||
|
build-image:
|
||||||
|
stage: build
|
||||||
|
tags:
|
||||||
|
- shell
|
||||||
|
script:
|
||||||
|
- docker build -t $DOCKER_IMAGE .
|
||||||
|
|
||||||
|
deploy-container:
|
||||||
|
stage: deploy
|
||||||
|
tags:
|
||||||
|
- shell
|
||||||
|
script:
|
||||||
|
- docker stop $CONTAINER_NAME || true
|
||||||
|
- docker rm $CONTAINER_NAME || true
|
||||||
|
- docker run -d --name $CONTAINER_NAME -p 8080:8080 $DOCKER_IMAGE
|
||||||
|
only:
|
||||||
|
- master
|
||||||
Loading…
Add table
Add a link
Reference in a new issue