With the help of Docker and gitlab-runner, I set up a system that automatically converts the project to exe when pushed to the repository and versions it in gitlab release. I did this in a different project. Now I need to integrate it into this project. I got one of the errors I encountered in the previous project, but I could not solve the problem with the same solution.
My yml file is as follows;
default:
image: docker:24.0.7
services:
- name: docker:24.0.7-dind
variables:
DOCKER_TLS_CERTDIR: "/certs"
stages:
- prepare_release
- release
prepare_release:
stage: prepare_release
before_script:
- echo "Setting up packages for Build"
- apk --no-cache add zip
- apk --no-cache add git
rules:
- if: '$CI_COMMIT_TAG'
script:
- docker buildx build -t demo-image --platform linux/arm64 . --build-arg TAG=$TAG
- container_id=$(docker run -d -t demo-image)
- mkdir -p artifacts/dist
- docker cp $container_id:/app/dist ./artifacts/dist
- echo "Zip distribution folder for Artifacts"
- zip -r artifacts.zip ./artifacts/dist
- echo "JOB_ID=$CI_JOB_ID" >> artifacts/job.env
- PREVIOUS_TAG=$(git tag --sort=v:refname | tail -n 2 | head -n 1)
- echo "PREVIOUS_TAG=$PREVIOUS_TAG" >> artifacts/job.env
- COMMIT_LIST=$(git log --oneline $PREVIOUS_TAG..$CI_COMMIT_TAG)
- echo "COMMIT_LIST=$COMMIT_LIST" >> artifacts/job.env
after_script:
- cat artifacts/job.env
artifacts:
paths:
- artifacts/
expire_in: never
reports:
dotenv: artifacts/job.env
create_release:
stage: release
before_script:
- echo "Setting up packages for Build"
- apk --no-cache add git
image: registry.gitlab.com/gitlab-org/release-cli:latest
needs:
- job: prepare_release
artifacts: true
variables:
TAG: '$CI_COMMIT_TAG'
script:
- echo "Running the release job."
- echo "JOB ID=$JOB_ID"
- echo "PREV TAG=$PREVIOUS_TAG"
- echo "commits=$COMMIT_LIST"
rules:
- if: '$CI_COMMIT_TAG'
release:
name: 'Version $TAG'
tag_name: '$TAG'
description: "Release created using the release-cli. Release '$TAG'\n\nCommits between $PREVIOUS_TAG and $CI_COMMIT_TAG:\n\n$COMMIT_LIST"
assets:
links:
- name: 'my-app.exe'
url: '$CI_SERVER_URL/$CI_PROJECT_PATH/-/jobs/$JOB_ID/artifacts/download'
This is the error I get;
I did this before as a solution.
etc/gitlab-runner/config.toml ;
[[runners]]
name = "demo-runner"
url = "https://gitlabs.........com/"
id = 24
token = "J..............cu"
token_obtained_at = 2023-11-07T14:45:41Z
token_expires_at = 0001-01-01T00:00:00Z
executor = "docker"
[runners.cache]
MaxUploadedArchiveSize = 0
[runners.docker]
tls_verify = false
image = "docker:24.0.7"
privileged = true
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = ["/var/run/docker.sock:/var/run/docker.sock", "/cache"]
shm_size = 0
network_mtu = 0
Now I did the same thing but the problem was not solved.