Skip to content
Snippets Groups Projects
Commit 0283ba5a authored by Łukasz Łopatowski's avatar Łukasz Łopatowski
Browse files

Disabled GitHub CI and added GitLab CI spec

parent f4572e76
Branches
Tags
No related merge requests found
stages:
- test
- build
test:
stage: test
image: golang:1.21
tags:
- docker
script:
- |
go get github.com/johnaoss/htpasswd/apr1
go get github.com/xanzy/go-gitlab
go get k8s.io/api/core/v1
go get k8s.io/apimachinery/pkg/apis/meta/v1
go get k8s.io/apimachinery/pkg/types
go get k8s.io/client-go/kubernetes
go get k8s.io/client-go/rest
go get github.com/evanphx/json-patch
go get google.golang.org/grpc
go install google.golang.org/grpc
go get github.com/golang/protobuf/protoc-gen-go
go install github.com/golang/protobuf/protoc-gen-go
wget https://github.com/protocolbuffers/protobuf/releases/download/v25.1/protoc-25.1-linux-x86_64.zip
unzip protoc-25.1-linux-x86_64.zip -d ./protoc
mkdir -p pkg/api/v1
protoc/bin/protoc --proto_path=api/proto/v1 --proto_path=third_party --go_out=plugins=grpc:pkg/api/v1 config-service.proto
go test ./...
build_and_push_latest_image:
stage: build
only:
- develop
variables:
IMAGE_TAG: "latest"
script:
- |
docker image prune -f
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD $DOCKER_REPOSITORY
docker build -t $DOCKER_REPOSITORY_LOCAL:$IMAGE_TAG .
docker push $DOCKER_REPOSITORY_LOCAL:$IMAGE_TAG
docker logout $DOCKER_REPOSITORY
build_and_push_release_image:
stage: build
only:
- tags
script:
- |
export IMAGE_TAG=$(echo $CI_COMMIT_TAG | cut -c 2-)
docker image prune -f
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD $DOCKER_REPOSITORY
docker build -t $DOCKER_REPOSITORY_LOCAL:$IMAGE_TAG .
docker push $DOCKER_REPOSITORY_LOCAL:$IMAGE_TAG
docker logout $DOCKER_REPOSITORY
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment