Skip to content
Snippets Groups Projects
Commit ec02ab60 authored by Andrew Kapuscinski's avatar Andrew Kapuscinski
Browse files

Minor CI pipeline gripe fixes

parent 51b2ecd8
No related branches found
Tags end-of-sprint-18 end-of-sprint-18.5
1 merge request!443Minor CI pipeline gripe fixes
Pipeline #2727 passed
......@@ -79,6 +79,7 @@ services/**/**/testing
tmp
delivery_root
lustre/
pgdata/
# ignore local NGAS
local_ngas_root/cache/
......
stages:
- build-base
- push-base
- run-schema
- cache-build
- build
- unit-test
......@@ -11,7 +10,6 @@ stages:
- deploy
- e2e-test
- .post
# - deploy-test
variables:
# Gitlab optimization https://docs.gitlab.com/ee/ci/large_repositories/
......@@ -26,11 +24,6 @@ variables:
POSTGRES_USER: "archive"
POSTGRES_PASSWORD: "docker"
# CI Postgres Service
services:
- name: ssa-containers.aoc.nrao.edu/ops/ci/db:workspaces
alias: db
image: docker:19.03.12
workflow:
......@@ -72,19 +65,6 @@ push base image:
- Dockerfile.base
- docker.properties
# Run Schema
run schema:
stage: run-schema
image: ${REGISTRY_URL}/ops/base:${PROJECT_NAME}
script:
- export PGPASSWORD=$POSTGRES_PASSWORD
- cd schema && ./bin/run-migrations.sh "docker"
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
when: always
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: always
# Cache
build cache:
stage: cache-build
......@@ -177,6 +157,10 @@ unit test coverage:
e2e:
stage: e2e-test
image: docker/compose:1.27.4
# CI Postgres Service
services:
- name: ssa-containers.aoc.nrao.edu/ops/ci/db:workspaces
alias: db
variables:
ENV_HOST: workflow
before_script:
......@@ -197,6 +181,7 @@ e2e:
- docker logs workspaces_capability_1
- docker logs workspaces_workflow_1
- docker logs workspaces_web_1
- docker network prune -f
- docker-compose -f docker-compose.ci.yml down
- docker image rm -f base-build:ci
- docker image rm -f e2e:${CI_COMMIT_SHORT_SHA}
......
......@@ -4,9 +4,8 @@
- NAME="${REGISTRY_URL}/${PROJECT_NAME}/${SERVICE_NAME}"
- |
printf "%s\n" "- Removing Images -" \
"${NAME}:${TAG}" \
"${NAME}:${CI_COMMIT_SHORT_SHA}"
- docker image rm --force "${NAME}:${TAG}" "${NAME}:${CI_COMMIT_SHORT_SHA}" "cache:${CI_COMMIT_SHORT_SHA}"
- docker image rm --force "${NAME}:${CI_COMMIT_SHORT_SHA}" "cache:${CI_COMMIT_SHORT_SHA}"
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_COMMIT_MESSAGE =~ /\A(?i)-debug/'
when: never
......
.unit-test:
# Postgres DB service
services:
- name: ssa-containers.aoc.nrao.edu/ops/ci/db:workspaces
alias: db
image: ${REGISTRY_URL}/${PROJECT_NAME}/${SERVICE_NAME}:${CI_COMMIT_SHORT_SHA}
script:
- |
......
......@@ -6,6 +6,8 @@
set -e
set -o pipefail
ARG="${$1:-docker}"
if [[ $# -eq 0 ]] ; then
echo 'ERROR: run-migrations requires an argument for CAPO_PROFILE'
exit 0
......@@ -14,4 +16,4 @@ fi
# Python library installation
pip install -r requirements.txt
env CAPO_PROFILE=$1 alembic upgrade head
env CAPO_PROFILE=$ARG alembic upgrade head
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment