Commit 5303a7b2 authored by John Red Medrano's avatar John Red Medrano

initial

parent 3636480f
Pipeline #282 failed
stages: stages:
- initial_repo - initial_repo
- build - clean_initial_repo
- cleanup_build - rebuild_dev
- clean_rebuild_dev
- build_sit
- rebuild_sit
intial_dev: initial_repo:
stage: initial_repo stage: initial_repo
image: ubuntu image: ubuntu
rules: rules:
- if: '$CI_COMMIT_MESSAGE =~ /initial/' - if: '$CI_COMMIT_MESSAGE =~ /initial/ && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "red-develop"'
when: always when: always
# except: # except:
# variables: # variables:
...@@ -43,12 +46,28 @@ intial_dev: ...@@ -43,12 +46,28 @@ intial_dev:
- echo "Successfully build dev environment" - echo "Successfully build dev environment"
- echo "Closed" - echo "Closed"
buid_dev: clean_initial_repo:
stage: build stage: clean_initial_repo
image: ubuntu image: ubuntu
script:
- echo "this is a clean up for clean_initial_repo"
- '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 rm -rf /var/www/gitlab_variable_red/dev"
rules: rules:
- if: '$CI_COMMIT_MESSAGE !~ /initial/' - if: '$CI_COMMIT_MESSAGE =~ /initial/ && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "red-develop"'
when: always when: on_failure
rebuild_dev:
stage: rebuild_dev
image: ubuntu
rules:
- if: '$CI_COMMIT_MESSAGE !~ /initial/ && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "red-develop"'
when: always
# only: # only:
# refs: # refs:
# - red-develop # - red-develop
...@@ -75,24 +94,28 @@ buid_dev: ...@@ -75,24 +94,28 @@ buid_dev:
- echo "Closed" - echo "Closed"
cleanup_build_dev: clean_rebuild_dev:
stage: cleanup_build stage: clean_rebuild_dev
image: ubuntu image: ubuntu
script: script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y)' - echo "this is a clean up for clean_rebuild_dev"
- eval $(ssh-agent -s) - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y)'
- mkdir -p ~/.ssh - eval $(ssh-agent -s)
- chmod 700 ~/.ssh - mkdir -p ~/.ssh
- echo "$CENTOS_SERVER" | ssh-add - > ~/.ssh/id_rsa - chmod 700 ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' - echo "$CENTOS_SERVER" | ssh-add - > ~/.ssh/id_rsa
- ssh -tt centos@13.251.192.208 "sudo rm -rf /var/www/gitlab_variable_red/dev" - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
when: on_failure - ssh -tt centos@13.251.192.208 "sudo rm -rf /var/www/gitlab_variable_red/dev"
rules:
- if: '$CI_COMMIT_MESSAGE =~ /initial/ && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "red-develop"'
when: on_failure
build sit: build sit:
stage: build stage: build_sit
image: ubuntu image: ubuntu
rules: rules:
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "red-test-sit"' - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "red-test-sit"'
......
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