Loading .gitlab-ci.yml +39 −5 Original line number Diff line number Diff line Loading @@ -10,19 +10,48 @@ stages: - static - build-deploy ##### # YAML anchors Section # to reuse setup and teardown commands ##### # this creates a before script to grab some "common" functions, such as func_rse_docker_cleanup include: remote: "https://code.ornl.gov/rse-deployment/rse-sharables/-/raw/master/.gitlab-ci-before_script.yml" .docker-login: &docker-login - docker login --username=${CI_REGISTRY_USER} --password=${CI_REGISTRY_PASSWORD} ${CI_REGISTRY} .teardown_cleanup: &teardown_cleanup - func_rse_docker_cleanup - sudo chown -R gitlab-runner . ##### # Jobs Section ##### rpmlint: stage: static before_script: - sudo chown -R gitlab-runner . script: - docker login --username=${CI_REGISTRY_USER} --password=${CI_REGISTRY_PASSWORD} ${CI_REGISTRY} - *docker-login - docker run -v $PWD/nsd-app-wrap.spec:/tmp/nsd-app-wrap.spec "${CENTOS7_IMG}" /bin/bash -c "yum install -y git rpm-build rpmlint && rpmlint /tmp/nsd-app-wrap.spec" after_script: - *teardown_cleanup tags: - neutrons-multi-builder precommit: stage: static before_script: - sudo chown -R gitlab-runner . script: - docker login --username=${CI_REGISTRY_USER} --password=${CI_REGISTRY_PASSWORD} ${CI_REGISTRY} - *docker-login - docker run -v $PWD:/tmp "${MINICONDA_IMG}" /bin/bash -c "cd /tmp && pip install pre-commit && pre-commit run --all-files" after_script: - *teardown_cleanup tags: - neutrons-multi-builder Loading @@ -30,10 +59,15 @@ precommit: build-deploy: stage: build-deploy environment: $CI_COMMIT_REF_SLUG rules: - if: $CI_COMMIT_REF_PROTECTED == "true" before_script: - sudo chown -R gitlab-runner . - func_rse_docker_cleanup script: - docker login --username=$CI_REGISTRY_USER --password=$CI_REGISTRY_PASSWORD $CI_REGISTRY - *docker-login - docker build --build-arg SSH_KEY="$SSH_KEY" --build-arg SSH_USER="$SSH_USER" -t $IMAGE . after_script: - *teardown_cleanup tags: - sns-hfir-scse rules: - if: $CI_COMMIT_REF_PROTECTED == "true" Loading
.gitlab-ci.yml +39 −5 Original line number Diff line number Diff line Loading @@ -10,19 +10,48 @@ stages: - static - build-deploy ##### # YAML anchors Section # to reuse setup and teardown commands ##### # this creates a before script to grab some "common" functions, such as func_rse_docker_cleanup include: remote: "https://code.ornl.gov/rse-deployment/rse-sharables/-/raw/master/.gitlab-ci-before_script.yml" .docker-login: &docker-login - docker login --username=${CI_REGISTRY_USER} --password=${CI_REGISTRY_PASSWORD} ${CI_REGISTRY} .teardown_cleanup: &teardown_cleanup - func_rse_docker_cleanup - sudo chown -R gitlab-runner . ##### # Jobs Section ##### rpmlint: stage: static before_script: - sudo chown -R gitlab-runner . script: - docker login --username=${CI_REGISTRY_USER} --password=${CI_REGISTRY_PASSWORD} ${CI_REGISTRY} - *docker-login - docker run -v $PWD/nsd-app-wrap.spec:/tmp/nsd-app-wrap.spec "${CENTOS7_IMG}" /bin/bash -c "yum install -y git rpm-build rpmlint && rpmlint /tmp/nsd-app-wrap.spec" after_script: - *teardown_cleanup tags: - neutrons-multi-builder precommit: stage: static before_script: - sudo chown -R gitlab-runner . script: - docker login --username=${CI_REGISTRY_USER} --password=${CI_REGISTRY_PASSWORD} ${CI_REGISTRY} - *docker-login - docker run -v $PWD:/tmp "${MINICONDA_IMG}" /bin/bash -c "cd /tmp && pip install pre-commit && pre-commit run --all-files" after_script: - *teardown_cleanup tags: - neutrons-multi-builder Loading @@ -30,10 +59,15 @@ precommit: build-deploy: stage: build-deploy environment: $CI_COMMIT_REF_SLUG rules: - if: $CI_COMMIT_REF_PROTECTED == "true" before_script: - sudo chown -R gitlab-runner . - func_rse_docker_cleanup script: - docker login --username=$CI_REGISTRY_USER --password=$CI_REGISTRY_PASSWORD $CI_REGISTRY - *docker-login - docker build --build-arg SSH_KEY="$SSH_KEY" --build-arg SSH_USER="$SSH_USER" -t $IMAGE . after_script: - *teardown_cleanup tags: - sns-hfir-scse rules: - if: $CI_COMMIT_REF_PROTECTED == "true"