diff --git a/.woodpecker/build.yaml b/.woodpecker/build.yaml index 2b568c2..3561c6c 100644 --- a/.woodpecker/build.yaml +++ b/.woodpecker/build.yaml @@ -26,30 +26,25 @@ steps: environment: REGISTRY_TOKEN: from_secret: GITEA_REGISTRY_TOKEN + CHART_PATH: ./helm/softplayer-backend privileged: true commands: - |- helm registry login https://gitea.badhouseplants.net \ - --password-stdin=$REGISTRY_TOKEN \ + --password=$REGISTRY_TOKEN \ --username=devops-bot \ - - export SHORT_SHA="+$(git rev-parse --short HEAD)" - - |- - for chart in $(find charts -maxdepth 1 -mindepth 1 -type d); do - yq e -i ".version += env(SHORT_SHA)" "$chart/Chart.yaml" - yq e -i ".appVersion = env(SHORT_SHA)" "$chart/Chart.yaml" - helm dep build $chart - helm package $chart -d chart-packages; - done - - export CHARTS=$(find chart-packages -maxdepth 1 -mindepth 1 -type f) + - export SHORT_SHA="$(git rev-parse --short HEAD)" + - yq e -i '.version += "+" + env(SHORT_SHA)' "$CHART_PATH/Chart.yaml" + - yq e -i ".appVersion = env(SHORT_SHA)" "$CHART_PATH/Chart.yaml" + - yq e -i ".image.tag = env(CI_COMMIT_SHA)" "$CHART_PATH/values.yaml" + - helm dep build "$CHART_PATH" + - helm package "$CHART_PATH" -d packages; - export REGISTRY=$(echo oci://gitea.badhouseplants.net/$CI_REPO/helm | tr '[:upper:]' '[:lower:]') + - export CHART_NAME=$(helm show chart "$CHART_PATH/Chart.yaml" | yq .name) + - export CHART_VERSION=$(helm show chart "$CHART_PATH/Chart.yaml" | yq .version) - |- - for chart in $CHARTS; do - echo ${chart} - CHART_NAME=$(helm show chart "${chart}" | yq .name) - CHART_VERSION=$(helm show chart "${chart}" | yq .version) - if helm pull ${REGISTRY}/${CHART_NAME}:${CHART_VERSION}; then - echo "Chart is found in the upstream: ${CHART_NAME}:${CHART_VERSION}" - continue; - fi - helm push "${chart}" "${REGISTRY}" - done + if helm pull ${REGISTRY}/${CHART_NAME}:${CHART_VERSION}; then + echo "Chart is found in the upstream: ${CHART_NAME}:${CHART_VERSION}" + exit 0; + fi + helm push "./packages/$CHART_NAME-$CHART_VERSION.tgz" "${REGISTRY}" diff --git a/helm/softplayer-backend/Chart.yaml b/helm/softplayer-backend/Chart.yaml index addb10e..34b3c46 100644 --- a/helm/softplayer-backend/Chart.yaml +++ b/helm/softplayer-backend/Chart.yaml @@ -1,7 +1,6 @@ apiVersion: v2 name: softplayer-backend description: A Helm chart for Kubernetes - # A chart can be either an 'application' or a 'library' chart. # # Application charts are a collection of templates that can be packaged into versioned archives @@ -11,13 +10,12 @@ description: A Helm chart for Kubernetes # a dependency of application charts to inject those utilities and functions into the rendering # pipeline. Library charts do not define any templates and therefore cannot be deployed. type: application - # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.4.0 +version: 0.4.0+fd9e135 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "1.16.0" +appVersion: "fd9e135" diff --git a/helm/softplayer-backend/values.yaml b/helm/softplayer-backend/values.yaml index 3e3eec1..84c40ea 100644 --- a/helm/softplayer-backend/values.yaml +++ b/helm/softplayer-backend/values.yaml @@ -2,7 +2,7 @@ replicaCount: 1 image: repository: gitea.badhouseplants.net/softplayer/softplayer-backend pullPolicy: Always - tag: + tag: test imagePullSecrets: [] nameOverride: "" fullnameOverride: "" @@ -11,41 +11,36 @@ serviceAccount: automount: true annotations: {} name: "" - podAnnotations: {} podLabels: {} - podSecurityContext: {} - securityContext: {} - # capabilities: - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 +# capabilities: +# drop: +# - ALL +# readOnlyRootFilesystem: true +# runAsNonRoot: true +# runAsUser: 1000 service: type: ClusterIP port: 4020 - ingressRoute: target: 195.201.249.91 class: traefik url: softplayer-dummy.badhouseplants.net clusterIssuer: badhouseplants-issuer-http01 - resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi +# We usually recommend not to specify default resources and to leave this as a conscious +# choice for the user. This also increases chances charts run on environments with little +# resources, such as Minikube. If you do want to specify resources, uncomment the following +# lines, adjust them as necessary, and remove the curly braces after 'resources:'. +# limits: +# cpu: 100m +# memory: 128Mi +# requests: +# cpu: 100m +# memory: 128Mi # This is to setup the liveness and readiness probes more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/ #livenessProbe: @@ -64,22 +59,19 @@ autoscaling: maxReplicas: 100 targetCPUUtilizationPercentage: 80 # targetMemoryUtilizationPercentage: 80 - # Additional volumes on the output Deployment definition. volumes: [] - # - name: foo - # secret: - # secretName: mysecret - # optional: false +# - name: foo +# secret: +# secretName: mysecret +# optional: false # Additional volumeMounts on the output Deployment definition. volumeMounts: [] - # - name: foo - # mountPath: "/etc/foo" - # readOnly: true +# - name: foo +# mountPath: "/etc/foo" +# readOnly: true nodeSelector: {} - tolerations: [] - affinity: {} diff --git a/packages/softplayer-backend-0.4.0+fd9e135.tgz b/packages/softplayer-backend-0.4.0+fd9e135.tgz new file mode 100644 index 0000000..a4e9b9d Binary files /dev/null and b/packages/softplayer-backend-0.4.0+fd9e135.tgz differ