From c6db6cac55201679fdae9648f5e4ae932eb0320e Mon Sep 17 00:00:00 2001
From: Volker Schukai <volker.schukai@schukai.com>
Date: Sat, 9 Sep 2023 22:24:10 +0200
Subject: [PATCH] chore: fix file names

---
 .gitlab-ci.yml | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++
 Taskfile.yml   | 48 +++++++++++++++++++++++++++++++++++++
 2 files changed, 113 insertions(+)
 create mode 100644 .gitlab-ci.yml
 create mode 100644 Taskfile.yml

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..4bda37c
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,65 @@
+image: docker-registry.schukai.com:443/nixos-ci-devenv:latest
+
+services:
+  - docker:dind
+
+
+variables:
+  # The repo name as used in
+  # https://github.com/nix-community/NUR/blob/master/repos.json
+  NIXOS_VERSION: "23.05"
+  NIXPKGS_ALLOW_UNFREE: "1"
+  NIXPKGS_ALLOW_INSECURE: "1"
+  DOCKER_DRIVER: overlay2
+  GIT_DEPTH: 10
+
+
+stages:
+  - test
+  - deploy 
+
+before_script:
+  - nix shell nixpkgs#coreutils-full -c mkdir -p /certs/client/
+  - nix shell nixpkgs#coreutils-full -c ln -fs /etc/ssl/certs/ca-bundle.crt /certs/client/ca.pem
+  - echo > .env-gitlab-ci
+  - variables=("HOME=$HOME" "CI_COMMIT_REF_NAME=$CI_COMMIT_REF_NAME" "CI_REPOSITORY_URL=$CI_REPOSITORY_URL" "GITLAB_TOKEN=$GITLAB_TOKEN" "CI_JOB_TOKEN=$CI_JOB_TOKEN" "GITLAB_USER_EMAIL=$GITLAB_USER_EMAIL" "GITLAB_USER_NAME=\"$GITLAB_USER_NAME\"" "CI_REGISTRY_USER=$CI_REGISTRY_USER" "CI_PROJECT_ID=$CI_PROJECT_ID" "CI_PROJECT_DIR=$CI_PROJECT_DIR" "CI_API_V4_URL=$CI_API_V4_URL" "CI_PROJECT_NAME=$CI_PROJECT_NAME" "CI_COMMIT_SHORT_SHA=$CI_COMMIT_SHORT_SHA"); for var in "${variables[@]}"; do echo "$var" >> .env-gitlab-ci; done
+  - cat .env-gitlab-ci
+
+after_script:
+  - if [ -f .env-gitlab-ci ]; then rm .env-gitlab-ci; fi
+
+test:
+  stage: test
+  tags:
+    - nixos
+  script:
+    - devenv shell test-lib
+
+  cache:
+    - key: nixos
+      paths:
+        - /nix/store
+  
+  artifacts:
+    paths:
+      - dist
+
+deploy:
+  stage: deploy
+  tags:
+    - nixos
+  script:
+    - devenv shell -c deploy-lib
+
+  when: on_success
+
+  cache:
+    - key: nixos
+      paths:
+        - /nix/store
+
+
+  artifacts:
+    paths:
+      - dist   
+
diff --git a/Taskfile.yml b/Taskfile.yml
new file mode 100644
index 0000000..7febe83
--- /dev/null
+++ b/Taskfile.yml
@@ -0,0 +1,48 @@
+# https://taskfile.dev
+
+version: '3'
+
+tasks:
+  default:
+    cmds:
+      - task --list-all
+    silent: true
+  test:
+    desc: Execute unit tests in Go.
+    cmds:  
+      - echo "Execute unit tests in Go."
+      - go test -cover -v ./...
+
+  test-fuzz:
+    desc: Conduct fuzzing tests.#
+    cmds:  
+      - echo "Conduct fuzzing tests."
+      - go test -v -fuzztime=30s -fuzz=Fuzz ./...
+
+  add-licenses:
+    desc: Attach license headers to Go files.
+    cmds:
+      - echo "Attach license headers to Go files."
+      - addlicense -c "schukai GmbH" -s -l "AGPL-3.0" ./*.go
+    silent: true
+
+  check:
+    desc: Confirm repository status.
+    cmds:
+      - git diff-index --quiet HEAD || (echo "There are uncommitted changes after running make. Please commit or stash them before running make."; exit 1)
+    silent: true
+
+  build:
+    desc: Compile the application,
+    aliases:
+      - b
+    vars:
+      DEVENV_ROOT:
+        sh: echo "$DEVENV_ROOT"
+    
+    cmds:
+      - devenv shell build-app
+    sources:
+      - source/**/*.go
+      - source/**/*.mod
+      - dist/**      
-- 
GitLab