Commit 635518eb authored by Jonas Waeber's avatar Jonas Waeber
Browse files

Refactor deployment

- Make license headers consistent.
- Rename chart folder
- Fix k8s manifests
parent 1e7d3c9f
Pipeline #11491 failed with stages
in 1 minute and 38 seconds
......@@ -64,7 +64,7 @@ test-chart:
tags:
- mbr
script:
- helm lint chart/
- helm lint helm-charts/
publish-chart:
stage: publish
......@@ -75,7 +75,7 @@ publish-chart:
- export HELM_EXPERIMENTAL_OCI=1
- helm registry login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
- ./insert_chart_versions.sh
- helm chart save chart/ "$CI_REGISTRY/$CI_PROJECT_PATH:$CI_COMMIT_TAG-chart"
- helm chart save helm-charts/ "$CI_REGISTRY/$CI_PROJECT_PATH:$CI_COMMIT_TAG-chart"
- helm chart push "$CI_REGISTRY/$CI_PROJECT_PATH:$CI_COMMIT_TAG-chart"
- helm registry logout "$CI_REGISTRY"
only:
......
......@@ -5,8 +5,6 @@ type: application
version: 0.0.0
appVersion: 0.0.0
maintainers:
- name: Thomas Bernhart
email: t.bernhart@docuteam.ch
\ No newline at end of file
apiVersion: v1
kind: ConfigMap
metadata:
name: "{{ .Values.processId }}-{{ .Values.jobId }}-app-config"
name: "{{ .Values.processId }}-{{ .Values.jobName }}-app-config"
namespace: memobase
data:
JOB_ID: "{{ .Values.jobId }}"
APP_DIRECTORY: "{{ .Values.appDirectory }}"
CLIENT_ID: "{{ .Values.processId }}-{{ .Values.jobId }}-{{ .Values.jobName }}"
TOPIC_IN: "{{ .Values.processId }}-{{ .Values.jobId }}-{{ .Values.jobName }}"
CLIENT_ID: "{{ .Values.processId }}-{{ .Values.jobName }}"
TOPIC_IN: "{{ .Values.processId }}-{{ .Values.jobName }}"
TOPIC_OUT: "{{.Values.processId }}-{{ .Values.jobName }}"
TOPIC_PROCESS: "{{ .Values.processId }}-reporting"
FEDORA_INTERNAL_BASE_URL: ""
FEDORA_EXTERNAL_BASE_URL: ""
FEDORA_USER: ""
FEDORA_PASSWORD: ""
apiVersion: batch/v1
kind: Job
metadata:
name: "{{ .Values.processId }}-{{ .Values.jobId }}-{{ .Values.jobName }}"
name: "{{ .Values.processId }}-{{ .Values.jobName }}-{{ .Values.jobName }}"
namespace: memobase
labels:
institutionId: "{{ .Values.institutionId }}"
......@@ -11,7 +11,7 @@ spec:
template:
spec:
containers:
- name: "{{ .Values.processId }}-{{ .Values.jobId }}-{{ .Values.jobName }}"
- name: "{{ .Values.processId }}-{{ .Values.jobName }}-{{ .Values.jobName }}"
image: "{{ .Values.registry }}/{{ .Values.image }}:{{ .Values.tag }}"
envFrom:
- secretRef:
......@@ -21,6 +21,6 @@ spec:
- configMapRef:
name: "{{ .Values.kafkaConfigs }}"
- configMapRef:
name: "{{ .Values.processId }}-{{ .Values.jobId }}-app-config"
name: "{{ .Values.processId }}-{{ .Values.jobName }}-app-config"
restartPolicy: Never
backoffLimit: 0
\ No newline at end of file
......@@ -5,15 +5,15 @@ tag: "latest"
jobName: ingest
processId: p0001
jobId: j0001
institutionId: placeholder
recordSetId: placeholder
kafkaConfigs: prod-kafka-bootstrap-servers
sftpConfigs: internal-sftp-config
fedoraConfigs: fedora-admin-credentials
## Needs to be set to the directory on the sftp server.
## this is a relative path built like this:
## "./{INSTITUTION_ID}/{RECORD_SET_ID}"
appDirectory: placeholderValue
## "./{RECORD_SET_ID}"
appDirectory: placeholderValue
\ No newline at end of file
#!/usr/bin/env bash
echo Creating release: $1
sed -i "s/version: 0.0.0/version: $CI_COMMIT_TAG/g" ./chart/Chart.yaml
sed -i "s/appVersion: 0.0.0/appVersion: $CI_COMMIT_TAG/g" ./chart/Chart.yaml
sed -i "s/tag: \"latest\"/tag: $CI_COMMIT_TAG/g" ./chart/values.yaml
\ No newline at end of file
sed -i "s/version: 0.0.0/version: $CI_COMMIT_TAG/g" ./helm-charts/Chart.yaml
sed -i "s/appVersion: 0.0.0/appVersion: $CI_COMMIT_TAG/g" ./helm-charts/Chart.yaml
sed -i "s/tag: \"latest\"/tag: $CI_COMMIT_TAG/g" ./helm-charts/values.yaml
\ No newline at end of file
/*
* text-file-validation
* fedora-ingest-service
* Copyright (C) 2020 Memoriav
*
* This program is free software: you can redistribute it and/or modify
......@@ -15,7 +15,6 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package org.memobase
import kotlin.system.exitProcess
......@@ -23,7 +22,7 @@ import org.apache.logging.log4j.LogManager
class App {
companion object {
private val log = LogManager.getLogger("FedorIngestApp")
private val log = LogManager.getLogger("FedoraIngestApp")
@JvmStatic fun main(args: Array<String>) {
try {
val service = Service()
......
/*
* fedora-ingest-service
* Copyright (C) 2020 Memoriav
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package org.memobase
// import java.io.File
......
/*
* text-file-validation
* fedora-ingest-service
* Copyright (C) 2020 Memoriav
*
* This program is free software: you can redistribute it and/or modify
......@@ -23,7 +23,7 @@ import java.util.Properties
import org.apache.kafka.clients.producer.KafkaProducer
import org.apache.kafka.clients.producer.ProducerRecord
class Producer(props: Properties, private val topic: String) : Closeable {
class Producer(props: Properties, topic: String) : Closeable {
private val instance = KafkaProducer<String, String>(props)
private val reportingTopic = "$topic-reporting"
......
/*
* text-file-validation
* fedora-ingest-service
* Copyright (C) 2020 Memoriav
*
* This program is free software: you can redistribute it and/or modify
......
/*
* fedora-ingest
* fedora-ingest-service
* Copyright (C) 2020 Memoriav
*
* This program is free software: you can redistribute it and/or modify
......
/*
* fedora-ingest
* fedora-ingest-service
* Copyright (C) 2020 Memoriav
*
* This program is free software: you can redistribute it and/or modify
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment