Commit 1746ab72 authored by John Red Medrano's avatar John Red Medrano

Merge branch 'red-develop' into 'red-test-sit'

Red develop

See merge request red/red-ci-cd!14
parents 214394af 20feb69e
Pipeline #320 passed with stages
in 1 minute and 48 seconds
...@@ -59,6 +59,7 @@ clean_initial_repo: ...@@ -59,6 +59,7 @@ clean_initial_repo:
- 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 "cd $root_path/dev/$repo_folder && docker-compose -f docker-compose.yml -p xxx_rmsv2_api_container down"
- ssh -tt centos@13.251.192.208 "sudo rm -rf $root_path/dev" - ssh -tt centos@13.251.192.208 "sudo rm -rf $root_path/dev"
rebuild_dev: rebuild_dev:
...@@ -97,7 +98,7 @@ clean_rebuild_dev: ...@@ -97,7 +98,7 @@ clean_rebuild_dev:
stage: clean_rebuild_dev stage: clean_rebuild_dev
image: ubuntu image: ubuntu
rules: rules:
- if: '$CI_COMMIT_MESSAGE =~ /initial/ && $CI_COMMIT_BRANCH == "red-develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "red-develop"' - if: '$CI_COMMIT_MESSAGE !~ /initial/ && $CI_COMMIT_BRANCH == "red-develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "red-develop"'
when: on_failure when: on_failure
script: script:
- echo "this is a clean up for clean_rebuild_dev" - echo "this is a clean up for clean_rebuild_dev"
...@@ -107,6 +108,7 @@ clean_rebuild_dev: ...@@ -107,6 +108,7 @@ clean_rebuild_dev:
- 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 "cd $root_path/dev/$repo_folder && docker-compose -f docker-compose.yml -p xxx_rmsv2_api_container down"
- ssh -tt centos@13.251.192.208 "sudo rm -rf $root_path/dev" - ssh -tt centos@13.251.192.208 "sudo rm -rf $root_path/dev"
...@@ -130,9 +132,8 @@ build_sit: ...@@ -130,9 +132,8 @@ build_sit:
- ssh -tt centos@13.251.192.208 "cd $root_path/sit/$repo_folder && $dockerfile_sit" - ssh -tt centos@13.251.192.208 "cd $root_path/sit/$repo_folder && $dockerfile_sit"
- ssh -tt centos@13.251.192.208 "cd $root_path/sit/$repo_folder && $testenv" - ssh -tt centos@13.251.192.208 "cd $root_path/sit/$repo_folder && $testenv"
- ssh -tt centos@13.251.192.208 "cd $root_path/sit/$repo_folder && $TIRdevINI" - ssh -tt centos@13.251.192.208 "cd $root_path/sit/$repo_folder && $TIRdevINI"
- ssh -tt centos@13.251.192.208 "docker-compose -f $root_path/sit/$repo_folder/docker-compose.yml down" - ssh -tt centos@13.251.192.208 "docker-compose -f $root_path/sit/$repo_folder/docker-compose.yml -p xxx_sit_rmsv2_api_container down"
- ssh -tt centos@13.251.192.208 "docker-compose -f $root_path/sit/$repo_folder/docker-compose.yml -p xxx_rmsv2_api_container up -d --build" - ssh -tt centos@13.251.192.208 "docker-compose -f $root_path/sit/$repo_folder/docker-compose.yml -p xxx_rmsv2_api_container up -d --build"
- ssh -tt centos@13.251.192.208 "cd $root_path/sit/$repo_folder && sudo docker-compose up --build -d"
- echo "building sit environment for red test ci cd" - echo "building sit environment for red test ci cd"
variables: variables:
...@@ -158,6 +159,7 @@ clean_build_sit: ...@@ -158,6 +159,7 @@ clean_build_sit:
- 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 "docker-compose -f $root_path/sit/$repo_folder/docker-compose.yml -p xxx_sit_rmsv2_api_container down"
- ssh -tt centos@13.251.192.208 "sudo rm -rf $root_path/sit" - ssh -tt centos@13.251.192.208 "sudo rm -rf $root_path/sit"
...@@ -175,9 +177,9 @@ rebuild_sit: ...@@ -175,9 +177,9 @@ rebuild_sit:
- 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'
- echo "pulling updates on $sit" - echo "pulling updates on $sit"
- ssh -tt centos@13.251.192.208 "cd $root_path/dev/$repo_folder && sudo git pull origin $sit" - ssh -tt centos@13.251.192.208 "cd $root_path/sit/$repo_folder && sudo git pull origin $sit"
- ssh -tt centos@13.251.192.208 "cd $root_path/dev/$repo_folder && docker-compose -f docker-compose.yml -p xxx_sit_rmsv2_api_container down" - ssh -tt centos@13.251.192.208 "cd $root_path/sit/$repo_folder && docker-compose -f docker-compose.yml -p xxx_sit_rmsv2_api_container down"
- ssh -tt centos@13.251.192.208 "cd $root_path/dev/$repo_folder && docker-compose -f docker-compose.yml -p xxx_sit_rmsv2_api_container up -d --build" - ssh -tt centos@13.251.192.208 "cd $root_path/sit/$repo_folder && docker-compose -f docker-compose.yml -p xxx_sit_rmsv2_api_container up -d --build"
- echo "the $dev branch is successfully updated" - echo "the $dev branch is successfully updated"
variables: variables:
...@@ -203,4 +205,5 @@ clean_rebuild_sit: ...@@ -203,4 +205,5 @@ clean_rebuild_sit:
- 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 "cd $root_path/sit/$repo_folder && docker-compose -f docker-compose.yml -p xxx_sit_rmsv2_api_container down"
- ssh -tt centos@13.251.192.208 "sudo rm -rf $root_path/sit" - ssh -tt centos@13.251.192.208 "sudo rm -rf $root_path/sit"
\ No newline at end of file
this is a new file that test if the build job will work this is a new file that test if the build job will work
xxxx xxxx
\ No newline at end of file
asdasd
\ No newline at end of file
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