<p>Probably this <a href="https://gitlab.com/gitlab-org/cluster-integration/auto-deploy-image/-/blob/master/src/bin/auto-deploy" rel="nofollow noreferrer">https://gitlab.com/gitlab-org/cluster-integration/auto-deploy-image/-/blob/master/src/bin/auto-deploy</a></p>
<p>.....................................................................</p>

CC BY-SA 4.0
2021-03-01T12:59:37.157Z
2021-03-01T12:59:37.157Z
Chris Stryczynski
<p><a href="https://gitlab.com/gitlab-org/gitlab/blob/master/lib/gitlab/ci/templates/Jobs/Deploy.gitlab-ci.yml" rel="nofollow noreferrer">https://gitlab.com/gitlab-org/gitlab/blob/master/lib/gitlab/ci/templates/Jobs/Deploy.gitlab-ci.yml</a></p>
<pre><code>staging:
  extends: .auto-deploy
  stage: staging
  script:
    - auto-deploy check_kube_domain
    - auto-deploy download_chart
    - auto-deploy ensure_namespace
    - auto-deploy initialize_tiller
    - auto-deploy create_secret
    - auto-deploy deploy
  environment:
    name: staging
    url: http://$CI_PROJECT_PATH_SLUG-staging.$KUBE_INGRESS_BASE_DOMAIN
  rules:
    - if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == &quot;&quot;'
      when: never
    - if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
      when: never
    - if: '$STAGING_ENABLED'
</code></pre>
<p>What does <code>auto-deploy</code> refer to? Is it a script? Where is it located? Where can I find out more info about it (because the staging stage is currently failing, and I'd like to debug what it's doing)?</p>
<p>The failing job logs:</p>
<pre><code>To get the password for &quot;user&quot; run:
    export POSTGRES_PASSWORD=$(kubectl get secret --namespace initial-24739737-staging staging-postgresql -o jsonpath=&quot;{.data.postgresql-password}&quot; | base64 --decode)
To connect to your database run the following command:
    kubectl run staging-postgresql-client --rm --tty -i --restart='Never' --namespace initial-24739737-staging --image docker.io/bitnami/postgresql:9.6.16 --env=&quot;PGPASSWORD=$POSTGRES_PASSWORD&quot; --command -- psql --host staging-postgresql -U user -d staging -p 5432
To connect to your database from outside the cluster execute the following commands:
    kubectl port-forward --namespace initial-24739737-staging svc/staging-postgresql 5432:5432 &amp;
    PGPASSWORD=&quot;$POSTGRES_PASSWORD&quot; psql --host 127.0.0.1 -U user -d staging -p 5432
WARNING: Rolling tag detected (bitnami/postgresql:9.6.16), please note that it is strongly recommended to avoid using rolling tags in a production environment.
+info https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/
Validating chart version...
Fetching the previously deployed chart version... 
Fetching the deploying chart version... v1.0.7
secret &quot;staging-secret&quot; deleted
secret/staging-secret replaced
No helm values file found at '.gitlab/auto-deploy-values.yaml'
Deploying new stable release...
Release &quot;staging&quot; does not exist. Installing it now.
INSTALL FAILED
PURGING CHART
Error: release staging failed: timed out waiting for the condition
Successfully purged a chart!
Error: release staging failed: timed out waiting for the condition
Cleaning up file based variables
00:00
ERROR: Job failed: exit code 1
</code></pre>

<gitlab>
Where/what is the `auto-devops` script in gitlab's "auto devops" staging stage?
Chris Stryczynski
# Where/what is the `auto-devops` script in gitlab's "auto devops" staging stage?

(Asked by: username_0 on 2021-03-01)

https://gitlab.com/gitlab-org/gitlab/blob/master/lib/gitlab/ci/templates/Jobs/Deploy.gitlab-ci.yml
staging:
  extends: .auto-deploy
  stage: staging
  script:
    - auto-deploy check_kube_domain
    - auto-deploy download_chart
    - auto-deploy ensure_namespace
    - auto-deploy initialize_tiller
    - auto-deploy create_secret
    - auto-deploy deploy
  environment:
    name: staging
    url: http://$CI_PROJECT_PATH_SLUG-staging.$KUBE_INGRESS_BASE_DOMAIN
  rules:
    - if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""'
      when: never
    - if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
      when: never
    - if: '$STAGING_ENABLED'

What does auto-deploy refer to? Is it a script? Where is it located? Where can I find out more info about it (because the staging stage is currently failing, and I'd like to debug what it's doing)?
The failing job logs:
To get the password for "user" run:
    export POSTGRES_PASSWORD=$(kubectl get secret --namespace initial-24739737-staging staging-postgresql -o jsonpath="{.data.postgresql-password}" | base64 --decode)
To connect to your database run the following command:
    kubectl run staging-postgresql-client --rm --tty -i --restart='Never' --namespace initial-24739737-staging --image docker.io/bitnami/postgresql:9.6.16 --env="PGPASSWORD=$POSTGRES_PASSWORD" --command -- psql --host staging-postgresql -U user -d staging -p 5432
To connect to your database from outside the cluster execute the following commands:
    kubectl port-forward --namespace initial-24739737-staging svc/staging-postgresql 5432:5432 &
    PGPASSWORD="$POSTGRES_PASSWORD" psql --host 127.0.0.1 -U user -d staging -p 5432
WARNING: Rolling tag detected (bitnami/postgresql:9.6.16), please note that it is strongly recommended to avoid using rolling tags in a production environment.
+info https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/
Validating chart version...
Fetching the previously deployed chart version... 
Fetching the deploying chart version... v1.0.7
secret "staging-secret" deleted
secret/staging-secret replaced
No helm values file found at '.gitlab/auto-deploy-values.yaml'
Deploying new stable release...
Release "staging" does not exist. Installing it now.
INSTALL FAILED
PURGING CHART
Error: release staging failed: timed out waiting for the condition
Successfully purged a chart!
Error: release staging failed: timed out waiting for the condition
Cleaning up file based variables
00:00
ERROR: Job failed: exit code 1

**Tags:** gitlab


---

## 1 answers

### Answer by username_0 on 2021-03-01. Score: 1

Probably this <https://gitlab.com/gitlab-org/cluster-integration/auto-deploy-image/-/blob/master/src/bin/auto-deploy>

.....................................................................


---

