diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d75533f..b5846c4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,9 +13,7 @@ build-app: deploy-to-staging: extends: .deploy_template rules: - - if: "$CI_COMMIT_BRANCH == $BRANCH" - after_script: - - ls + - if: "$CI_COMMIT_BRANCH == $STAGING_BRANCH" deploy-to-prod: rules: diff --git a/Dockerfile b/Dockerfile index ecf3043..8d292ab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,7 @@ FROM golang:1.20.3-alpine AS build RUN apk add --no-cache curl # Set work directory WORKDIR /app +RUN apk add git # Create binary directory RUN mkdir /app/bin -p # Create golang migrate util directory @@ -13,8 +14,9 @@ RUN mkdir /bin/golang-migrate -p ADD ./tools/migrate /bin/golang-migrate/ # Add main files to app ADD . . +RUN git config --global url."https://buildToken:glpat-axA8ttckx3aPf_xd2Dym@penahub.gitlab.yandexcloud.net/".insteadOf "https://penahub.gitlab.yandexcloud.net/" # Download go depences -# RUN go mod download + RUN go mod download # Build app RUN GOOS=linux go build -o bin ./...