Skip to content
Snippets Groups Projects
Commit eb03ab14 authored by Muhammad Arsalan's avatar Muhammad Arsalan
Browse files

more changes

parent 834a78e4
No related branches found
No related tags found
No related merge requests found
stages:
- build
- deploy
variables:
# Define environment-specific variables
DOCKER_REGISTRY: dockerhub.ebi.ac.uk/chembl/chebi/chebi-2.0/chebi-frontend
......@@ -21,28 +17,69 @@ image: docker:latest
services:
- docker:dind
# Define the Docker image building job
build:
stages:
- build
- deploy
build-image-dev:
image:
name: docker/compose:1.24.1
entrypoint: ["/bin/sh", "-c"]
stage: build
before_script:
script:
# - echo $DOCKERHUB_REGISTRY_PASSWORD | docker login -u $DOCKERHUB_REGISTRY_USER --password-stdin $DOCKERHUB_REGISTRY
# - docker run chemblsingularity/hello-chembl
- echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY
- echo Building ${DOCKER_IMAGE}:${CI_COMMIT_SHORT_SHA}
- docker build -t $DOCKER_REGISTRY .
- echo Deploying ${DOCKER_IMAGE}:${CI_COMMIT_SHORT_SHA}
- docker push ${DOCKER_IMAGE}:${CI_COMMIT_SHORT_SHA}
- echo "Image pushed"
only:
- main
script:
- docker build --platform linux/amd64 -t $DOCKER_REGISTRY .
- docker push $DOCKER_REGISTRY
# Define the Docker image building job
#build:
# stage: build
# before_script:
# - echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY
#
# script:
# - docker build --platform linux/amd64 -t $DOCKER_REGISTRY .
# - docker push $DOCKER_REGISTRY
# Define the deployment job
deploy:
deploy-dev:
image:
name: lachlanevenson/k8s-kubectl:latest
entrypoint: [ "/bin/sh", "-c" ]
entrypoint: ["/bin/sh", "-c"]
stage: deploy
before_script:
- echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY
script:
- echo "Now into deploy part"
# - kubectl config use-context ${KUBE_NAMESPACE_DEV}
# - echo ${KUBE_NAMESPACE_DEV} ${KUBE_URL_HH} ${KUBE_CLUS_NAME_HH} ${KUBE_USER_HH}
# - kubectl get pods -n ${KUBE_NAMESPACE_DEV}
# - sed -i "s~<VERSION>~${CI_COMMIT_SHORT_SHA}~" k8s-deployment.yml
# - sed -i "s~<DOCKER_IMAGE>~${DOCKER_IMAGE}~" k8s-deployment.yml
# - kubectl apply -n ${KUBE_NAMESPACE_DEV} -f k8s-deployment.yml
- kubectl config use-context chebi-staging
- kubectl delete deployment -n $K8_NAMESPACE muhammad-chebi-frontend --ignore-not-found
- kubectl apply -f $K8_DEPLOYMENT_FILE -n $K8_NAMESPACE
only:
- main
# Define the deployment job
#deploy:
# image:
# name: lachlanevenson/k8s-kubectl:latest
# entrypoint: [ "/bin/sh", "-c" ]
# stage: deploy
# before_script:
# - echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY
#
# script:
# - kubectl config use-context chebi-staging
# - kubectl delete deployment -n $K8_NAMESPACE muhammad-chebi-frontend --ignore-not-found
# - kubectl apply -f $K8_DEPLOYMENT_FILE -n $K8_NAMESPACE
# only:
# - main
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