Fixed Dockerfile but commented out docker stage in ci temporarily

This commit is contained in:
Kwoth
2022-02-09 22:49:27 +01:00
parent 0c1ccfacf8
commit 09800cb8a3
2 changed files with 28 additions and 28 deletions

View File

@@ -97,29 +97,29 @@ upload-windows-updater-release:
- aws --endpoint-url $AWS_SERVICE_URL s3api put-object --bucket "$AWS_BUCKET_NAME" --key "dl/bot/$INSTALLER_FILE_NAME" --acl public-read --body "$INSTALLER_OUTPUT_DIR/$INSTALLER_FILE_NAME" - aws --endpoint-url $AWS_SERVICE_URL s3api put-object --bucket "$AWS_BUCKET_NAME" --key "dl/bot/$INSTALLER_FILE_NAME" --acl public-read --body "$INSTALLER_OUTPUT_DIR/$INSTALLER_FILE_NAME"
- aws --endpoint-url $AWS_SERVICE_URL s3api put-object --bucket "$AWS_BUCKET_NAME" --key "dl/bot/releases-v4.json" --acl public-read --body "releases-v4.json" - aws --endpoint-url $AWS_SERVICE_URL s3api put-object --bucket "$AWS_BUCKET_NAME" --key "dl/bot/releases-v4.json" --acl public-read --body "releases-v4.json"
docker-build: # docker-build:
# Use the official docker image. # # Use the official docker image.
image: docker:latest # image: docker:latest
stage: build # stage: build
services: # services:
- docker:dind # - docker:dind
before_script: # before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY # - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
# Default branch leaves tag empty (= latest tag) # # Default branch leaves tag empty (= latest tag)
# All other branches are tagged with the escaped branch name (commit ref slug) # # All other branches are tagged with the escaped branch name (commit ref slug)
script: # script:
- | # - |
if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then # if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then
tag="" # tag=""
echo "Running on default branch '$CI_DEFAULT_BRANCH': tag = 'latest'" # echo "Running on default branch '$CI_DEFAULT_BRANCH': tag = 'latest'"
else # else
tag=":$CI_COMMIT_REF_SLUG" # tag=":$CI_COMMIT_REF_SLUG"
echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag" # echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag"
fi # fi
- docker build --pull -t "$CI_REGISTRY_IMAGE${tag}" . # - docker build --pull -t "$CI_REGISTRY_IMAGE${tag}" .
- docker push "$CI_REGISTRY_IMAGE${tag}" # - docker push "$CI_REGISTRY_IMAGE${tag}"
# Run this job in a branch where a Dockerfile exists # # Run this job in a branch where a Dockerfile exists
rules: # rules:
- if: $CI_COMMIT_BRANCH # - if: $CI_COMMIT_BRANCH
exists: # exists:
- Dockerfile # - Dockerfile

View File

@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:6.0-buster-slim AS build FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /source WORKDIR /source
COPY src/NadekoBot/*.csproj src/NadekoBot/ COPY src/NadekoBot/*.csproj src/NadekoBot/
@@ -18,7 +18,7 @@ RUN set -xe; \
chmod +x /app/NadekoBot chmod +x /app/NadekoBot
# final stage/image # final stage/image
FROM mcr.microsoft.com/dotnet/runtime:6.0-buster-slim FROM mcr.microsoft.com/dotnet/runtime:6.0
WORKDIR /app WORKDIR /app
RUN set -xe; \ RUN set -xe; \