Skip to content
Snippets Groups Projects
Commit 7bf91858 authored by Kamal Dodiya's avatar Kamal Dodiya
Browse files

test git clone from ci-job

parent e9c93625
No related branches found
No related tags found
No related merge requests found
Pipeline #18883 failed with stage
in 19 seconds
......@@ -3,66 +3,15 @@ image: docker:stable
services:
- docker:dind
#before_script:
# - docker info
stages:
- Build image
- Push to DTR
- deploy_to_prod
variables:
CONTAINER_IMAGE: $REGISTRY_URL/$REGISTRY_NAMESPACE/ett-cicd-test:${CI_COMMIT_SHORT_SHA}
KUBECONFIG: /etc/deploy/config
docker_build_job:
stage: Build image
script:
- docker info
- Clone Repo
docker push:
stage: Push to DTR
only:
- master
script:
- docker build -t ${CONTAINER_IMAGE} --no-cache .
- echo "$REGISTRY_PASSWORD" | docker login -u "$REGISTRY_USER" --password-stdin https://hh-dee-dtr01.caas.ebi.ac.uk
- docker push ${CONTAINER_IMAGE}
- docker rmi ${CONTAINER_IMAGE}
- docker logout hh-dee-dtr01.caas.ebi.ac.uk
# - echo "$KUBE_URL"
# - echo "$KUBE_USER"
# - echo "$KUBE_PASSWORD\n"
deploy:
stage: deploy_to_prod
clone_client:
stage: Clone Repo
image: alpine
only:
- master
before_script:
- mkdir -p /etc/deploy
- echo ${KUBE_CONFIG} | base64 -d > ${KUBECONFIG}
script:
- apk add --no-cache curl
- curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
- chmod +x ./kubectl
- mv ./kubectl /usr/local/bin/kubectl
- sed -i "s/<VERSION>/${CI_COMMIT_SHORT_SHA}/g" ett_cicd_test_deployment.yaml
- cat ett_cicd_test_deployment.yaml
- kubectl config view
- kubectl config use-context ucp_hh-ucp.caas.ebi.ac.uk:6443_kamal
- kubectl apply -f ett_cicd_test_service.yaml
- kubectl apply -f ett_cicd_test_deployment.yaml
#- kubectl get deploy
#- echo "$KUBE_URL"
# - echo "$KUBE_USER"
# - echo "$KUBE_PASSWORD"
#- kubectl config set-cluster k8s --server="${SERVER}"
#- kubectl config set clusters.k8s.certificate-authority-data ${CERTIFICATE_AUTHORITY_DATA}
#- kubectl config set-credentials gitlab --token="${USER_TOKEN}"
#- kubectl config set-context default --cluster=k8s --user=gitlab
#- kubectl config use-context default
#- sed -i "s/<VERSION>/${CI_COMMIT_SHORT_SHA}/g" ett_cicd_test_deployment.yaml
#- kubectl apply -f ett_cicd_test_deployment.yaml
- apk update && apk add git
- git clone https://kamal:${DEPLOY_TOKEN}@gitlab.com/kamal/ensembl-client-nginx
- ls ./
only:
- git-clone
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