Deploy code to container on gitlab, error: Error: job failed: command terminated with exit code 1
1. Deploy the code to the container on GitLab, and report an error: Error: job failed: command terminated with exit code 1. as shown in Figure 1
ingress.extensions/ingress-nginx-internal configured
Cleaning up file based variables 00:01
ERROR: Job failed: command terminated with exit code 1
2. This COMMIT 4439826E is considered a pure number, using similar ${CI_COMMIT_SHORT_SHA} in the GitLab CI/CD configuration Variables to get the short hash value of the commit without quotation marks, then the hash value containing the letters (such as 4439826e) may be treated as a number. This kind of misidentification usually raises a command terminated with exit code 1 error. as shown in Figure 2
3. After finally resubmitting a git commit, the deployment is successful. as shown in Figure 3
4. Finally, in order to avoid subsequent resubmission, the plan is to try the following implementation, edit .gitlab-ci.yml, but in the end it has not been verified
# 定义版本信息
before_script:
# 镜像版本
- IMAGE_TAG=${IMAGE}:${CI_COMMIT_SHORT_SHA}
# 构建版本
- VERSION=${CI_COMMIT_SHORT_SHA}-${CI_JOB_ID}
Modified to:
# 定义版本信息
before_script:
# 镜像版本
- IMAGE_TAG=${IMAGE}:commit-${CI_COMMIT_SHORT_SHA}
# 构建版本
- VERSION=${CI_COMMIT_SHORT_SHA}-${CI_JOB_ID}


