Commit fb10dc90 authored by John Red Medrano's avatar John Red Medrano

Update .gitlab-ci.yml

parent 7ade46e0
Pipeline #263 failed with stages
in 56 seconds
stages: stages:
- initial_repo
- build - build
- cleanup_build - cleanup_build
intial_dev:
stage: initial_repo
image: ubuntu
except:
variables:
- $CI_COMMIT_MESSAGE =~ /intial deploy/
before_script:
- echo "Building dev environment for red test ci cd"
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y)'
- eval $(ssh-agent -s)
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "$CENTOS_SERVER" | ssh-add - > ~/.ssh/id_rsa
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- ssh -tt centos@13.251.192.208 "sudo mkdir $root_path"
- ssh -tt centos@13.251.192.208 "cd $root_path && sudo git clone http://tir:Qwerty1234@54.169.104.100:27015/red/red-ci-cd.git -b $dev"
- ssh -tt centos@13.251.192.208 "cd $root_path/$repo_folder && $dockercompose"
- ssh -tt centos@13.251.192.208 "cd $root_path/$repo_folder && $dockerfile"
- ssh -tt centos@13.251.192.208 "cd $root_path/$repo_folder && $testenv"
- ssh -tt centos@13.251.192.208 "cd $root_path/$repo_folder && $TIRdevINI"
- ssh -tt centos@13.251.192.208 "docker-compose -f $root_path/$repo_folder/api-main-service/docker-compose.yml down"
- ssh -tt centos@13.251.192.208 "docker-compose -f $root_path/$repo_folder/api-main-service/docker-compose.yml -p xxx_rmsv2_api_container up -d --build"
- ssh -tt centos@13.251.192.208 "cd $root_path/$repo_folder && sudo docker-compose up --build -d"
- echo "Initial dev environment for red test ci cd"
variables:
GIT_STRATEGY: clone
GIT_DEPTH: "1"
script:
- echo "Successfully build dev environment"
- echo "Closed"
buid_dev: buid_dev:
stage: build stage: build
image: ubuntu image: ubuntu
...@@ -9,24 +43,19 @@ buid_dev: ...@@ -9,24 +43,19 @@ buid_dev:
refs: refs:
- red-develop - red-develop
before_script: before_script:
- echo "rebuilding dev environment for red test ci cd"
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y)' - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y)'
- eval $(ssh-agent -s) - eval $(ssh-agent -s)
- mkdir -p ~/.ssh - mkdir -p ~/.ssh
- chmod 700 ~/.ssh - chmod 700 ~/.ssh
- echo "$CENTOS_SERVER" | ssh-add - > ~/.ssh/id_rsa - echo "$CENTOS_SERVER" | ssh-add - > ~/.ssh/id_rsa
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- ssh -tt centos@13.251.192.208 "sudo mkdir /var/www/gitlab_variable_red/dev" - echo "pulling updates on $dev"
- ssh -tt centos@13.251.192.208 "cd /var/www/gitlab_variable_red/dev && sudo git clone http://tir:Qwerty1234@54.169.104.100:27015/red/red-ci-cd.git -b $dev" - ssh -tt centos@13.251.192.208 "cd $root_path/$repo_folder && git pull origin $dev"
- ssh -tt centos@13.251.192.208 "cd /var/www/gitlab_variable_red/dev/red-ci-cd && $dockercompose" - ssh -tt centos@13.251.192.208 "docker-compose -f $root_path/$repo_folder/api-main-service/docker-compose.yml down"
- ssh -tt centos@13.251.192.208 "cd /var/www/gitlab_variable_red/dev/red-ci-cd && $dockerfile" - ssh -tt centos@13.251.192.208 "docker-compose -f $root_path/$repo_folder/api-main-service/docker-compose.yml -p xxx_rmsv2_api_container up -d --build"
- ssh -tt centos@13.251.192.208 "cd /var/www/gitlab_variable_red/dev/red-ci-cd && $testenv" - ssh -tt centos@13.251.192.208 "cd $root_path/$repo_folder && sudo docker-compose up --build -d"
- ssh -tt centos@13.251.192.208 "cd /var/www/gitlab_variable_red/dev/red-ci-cd && $TIRdevINI" - echo "the $dev branch is successfully updated"
- ssh -tt centos@13.251.192.208 "docker-compose -f /var/www/gitlab_variable_red/dev/red-ci-cd/api-main-service/docker-compose.yml down"
- ssh -tt centos@13.251.192.208 "docker-compose -f /var/www/gitlab_variable_red/dev/red-ci-cd/api-main-service/docker-compose.yml -p xxx_rmsv2_api_container up -d --build"
- ssh -tt centos@13.251.192.208 "cd /var/www/gitlab_variable_red/dev/red-ci-cd && sudo docker-compose up --build -d"
- echo "building dev environment for red test ci cd"
- echo "building dev environment for red test ci cd"
variables: variables:
GIT_STRATEGY: clone GIT_STRATEGY: clone
GIT_DEPTH: "1" GIT_DEPTH: "1"
......
Markdown is supported
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