You've already forked reloading-manager
No changes made
This commit is contained in:
35
backend/.gitlab-ci.yml
Normal file
35
backend/.gitlab-ci.yml
Normal file
@@ -0,0 +1,35 @@
|
||||
stages:
|
||||
- test
|
||||
- build
|
||||
|
||||
variables:
|
||||
IMAGE_URL: siteworxpro/
|
||||
IMAGE_NAME: reloading-backend
|
||||
|
||||
|
||||
Unit Tests:
|
||||
stage: test
|
||||
only:
|
||||
- branches
|
||||
image: siteworxpro/golang:1.24.0
|
||||
before_script:
|
||||
- go mod tidy
|
||||
script:
|
||||
- go test ./...
|
||||
|
||||
Build:
|
||||
stage: build
|
||||
dependencies:
|
||||
- Unit Tests
|
||||
only:
|
||||
- master
|
||||
image: docker:dind
|
||||
before_script:
|
||||
- docker login -u siteworxpro -p ${DOCKER_TOKEN}
|
||||
script:
|
||||
- TAG=${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}
|
||||
- docker build -t ${IMAGE_NAME} .
|
||||
- docker tag ${IMAGE_NAME}:latest ${IMAGE_URL}${IMAGE_NAME}:latest
|
||||
- docker tag ${IMAGE_URL}${IMAGE_NAME}:latest ${IMAGE_URL}${IMAGE_NAME}:${TAG}
|
||||
- docker push ${IMAGE_URL}${IMAGE_NAME}:${TAG}
|
||||
- docker push ${IMAGE_URL}${IMAGE_NAME}:latest
|
||||
Reference in New Issue
Block a user