diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 13c9dcf0885b43522a028ffffe3e9abd8232bdc7..3793085ad7af01f79fe58a07033cbd33d60cd554 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -59,22 +59,22 @@ Docker build to KSZK registry: - echo "{\"auths\":{\"harbor.sch.bme.hu\":{\"username\":\"$REGISTRY_USER\",\"password\":\"$REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CONTAINER_IMAGE -# Deploy to Kubernetes: -# stage: deploy -# image: alpine -# tags: [k9r] -# environment: -# name: master -# before_script: -# - chmod 600 $KUBECONFIG -# - apk add --no-cache curl -# - curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" -# - chmod +x ./kubectl -# - mv ./kubectl /usr/local/bin/kubectl -# - kubectl version -# script: -# - cd k8s -# - sed -i "s|##IMAGETAG##|${CI_COMMIT_REF_NAME}|" deployment.yml -# - kubectl apply -f deployment.yml -# rules: -# - if: '$CI_COMMIT_TAG' +Deploy to Kubernetes: + stage: deploy + image: + name: alpine + entrypoint: [ "" ] + before_script: + - chmod 600 $KUBECONFIG + - DIR="$PWD" + - apk add bash curl gettext + - cd /tmp + - curl https://get.helm.sh/helm-v3.16.4-linux-amd64.tar.gz | tar xvz + - export PATH="$PATH:/tmp/linux-amd64" + - cd "$DIR" + script: + - cd k8s + - envsubst < values.yaml | helm upgrade --install --atomic kszkepzes . -n kszk-kepzes-site --values - + only: + - tags + tags: [k9r] diff --git a/k8s/values.yaml b/k8s/values.yaml index 960d49561abc5b003f76dff68e94781284b67782..3d0b8c9b6e820e6376c308cd4037cf939a91a7bb 100644 --- a/k8s/values.yaml +++ b/k8s/values.yaml @@ -2,30 +2,29 @@ url: "ujonc.kszk.bme.hu" backend: image: "harbor.sch.bme.hu/kszk-kepzes/backend" - tag: "test" - storageClassName: "local-path" + tag: "${CI_COMMIT_REF_NAME}" imagePullSecretName: "harbor" - secretKey: "" + secretKey: "${SECRET_KEY}" oidc: - OIDC_CLIENT_ID: "a56088b8-c381-4da6-8e17-d7d129716b5a" - OIDC_CLIENT_SECRET: "" + OIDC_CLIENT_ID: "${OIDC_CLIENT_ID}" + OIDC_CLIENT_SECRET: "${OIDC_CLIENT_SECRET}" OIDC_AUTHORIZATION_ENDPOINT: "https://login.microsoftonline.com/79f0ae63-ef51-49f5-9f51-78a3346e1507/oauth2/v2.0/authorize" OIDC_TOKEN_ENDPOINT: "https://login.microsoftonline.com/79f0ae63-ef51-49f5-9f51-78a3346e1507/oauth2/v2.0/token" OIDC_USERINFO_ENDPOINT: "https://graph.microsoft.com/oidc/userinfo" OIDC_JWKS_ENDPOINT: "https://login.microsoftonline.com/79f0ae63-ef51-49f5-9f51-78a3346e1507/discovery/v2.0/keys" OIDC_SIGN_ALGO: "RS256" -frontend: +frontend: # The frontend is deployed by the CI in the frontend repo, but this chart can also deploy it if needed enabled: false - image: "harbor.sch.bme.hu/kszk-kepzes/frontend" - tag: "latest" - imagePullSecretName: "harbor" + # image: "harbor.sch.bme.hu/kszk-kepzes/frontend" + # tag: "1.3.19" + # imagePullSecretName: "harbor" db: host: "dbsch.internal" - name: "" - user: "" - password: "" + name: "${DB_NAME}" + user: "${DB_USER}" + password: "${DB_PASSWORD}" minio: # Deployoljon e saját miniot @@ -37,12 +36,12 @@ minio: # Helyi vagy külső minio user user: "user" # Helyi vagy külső minio pass - password: "" + password: "${MINIO_PASSWORD}" # Csak ha enabled = true image: "quay.io/minio/minio" tag: "RELEASE.2024-02-14T21-36-02Z" - storageClassName: "local-path" + storageClassName: "longhorn" redis: image: "redis" diff --git a/requirements/base.in b/requirements/base.in index cd4092b59be37f9e690b940b8172f59dbad8ef47..f3440af8634c614bc9a168fc94a2e67b93eea3d5 100644 --- a/requirements/base.in +++ b/requirements/base.in @@ -7,4 +7,4 @@ django-health-check sentry-sdk[django] django-extensions drf-oidc-auth -django-minio-backend \ No newline at end of file +django-minio-backend~=3.6.0 \ No newline at end of file diff --git a/requirements/production.in b/requirements/production.in index a92c0abdfccbc837ba7657abef4c108807f7acdd..f04c58efafc5ace359a9843fcf819faceb9173f8 100644 --- a/requirements/production.in +++ b/requirements/production.in @@ -13,6 +13,4 @@ djangorestframework-api-key~=2.3 mozilla_django_oidc drf_spectacular django-health-check -sentry-sdk[django] -drf-oidc-auth -django-minio-backend \ No newline at end of file +sentry-sdk[django] \ No newline at end of file