From b9c3e93564e733da6fbd2a2331906b1ea23a273f Mon Sep 17 00:00:00 2001 From: jastornig Date: Sun, 24 Sep 2023 19:20:20 +0000 Subject: [PATCH 1/5] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..e0c4685 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,37 @@ +# This file is a template, and might need editing before it works on your project. +# You can copy and paste this template into a new `.gitlab-ci.yml` file. +# You should not add this template to an existing `.gitlab-ci.yml` file by using the `include:` keyword. +# +# To contribute improvements to CI/CD templates, please follow the Development guide at: +# https://docs.gitlab.com/ee/development/cicd/templates.html +# This specific template is located at: +# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/C++.gitlab-ci.yml + +# use the official gcc image, based on debian +# can use versions as well, like gcc:5.2 +# see https://hub.docker.com/_/gcc/ + +image: gcc + +build: + stage: build + # instead of calling g++ directly you can also use some build toolkit like make + # install the necessary build tools when needed + before_script: + - apt update && apt -y install cmake + script: + - cmake . + - cmake --build . + artifacts: + paths: + - c_make + # depending on your build setup it's most likely a good idea to cache outputs to reduce the build time + # cache: + # paths: + # - "*.o" + + +deploy: + stage: deploy + script: echo "Define your deployment script!" + environment: production From 77b67aa949fc7875839333dfe14121955c455121 Mon Sep 17 00:00:00 2001 From: jastornig Date: Sun, 24 Sep 2023 20:12:14 +0000 Subject: [PATCH 2/5] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e0c4685..e7a3182 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,6 +12,9 @@ # see https://hub.docker.com/_/gcc/ image: gcc +stages: + - build + - release build: stage: build @@ -24,14 +27,25 @@ build: - cmake --build . artifacts: paths: - - c_make - # depending on your build setup it's most likely a good idea to cache outputs to reduce the build time - # cache: - # paths: - # - "*.o" + - c_net + reports: + dotenv: CI_JOB_ID.env + -deploy: - stage: deploy +release: + stage: release + needs: + - build + release: + tag_name: $CI_COMMIT_SHORT_SHA' + description: "latest" + + assets: + links: + - name: c_net + url: '${CI_PROJECT_URL}/-/jobs/${BUILD_JOB_ID}/artifacts/file/c_net' + script: echo "Define your deployment script!" - environment: production + + From a681833712c145887f251d1c4ddb1fde4bdc8f78 Mon Sep 17 00:00:00 2001 From: jastornig Date: Sun, 24 Sep 2023 20:19:40 +0000 Subject: [PATCH 3/5] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e7a3182..7e04fb1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -23,8 +23,11 @@ build: before_script: - apt update && apt -y install cmake script: + - echo BUILD_JOB_ID=$CI_JOB_ID >> CI_JOB_ID.env + - echo "Compiling the code..." - cmake . - cmake --build . + artifacts: paths: - c_net @@ -36,7 +39,8 @@ build: release: stage: release needs: - - build + - job: build + release: tag_name: $CI_COMMIT_SHORT_SHA' description: "latest" From e821afdbd5cf9741c5d203eff557198ec9ee42b6 Mon Sep 17 00:00:00 2001 From: jastornig Date: Sun, 24 Sep 2023 20:23:22 +0000 Subject: [PATCH 4/5] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7e04fb1..0af1ae5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -37,6 +37,7 @@ build: release: + image: registry.gitlab.com/gitlab-org/release-cli:latest stage: release needs: - job: build From 754d170616a8e55b1be531a41e98909d2865ccf9 Mon Sep 17 00:00:00 2001 From: jastornig Date: Sun, 24 Sep 2023 20:36:11 +0000 Subject: [PATCH 5/5] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0af1ae5..39e9622 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -48,7 +48,7 @@ release: assets: links: - - name: c_net + - name: c_net linux download (precompiled) url: '${CI_PROJECT_URL}/-/jobs/${BUILD_JOB_ID}/artifacts/file/c_net' script: echo "Define your deployment script!"