Commit e7355b40 authored by Sam Galson's avatar Sam Galson
Browse files

run ci using gitlab postgres service

parent 6c608685
services:
- postgres:latest
stages:
- build
- test
variables:
IMAGE_ORG: inkcoko
IMAGE_NAME: ink-api
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ''
build:
image: docker:latest
stage: build
script:
- docker version
- docker build -t $IMAGE_ORG/$IMAGE_NAME:$CI_COMMIT_SHA .
- if [ -z "$DOCKERHUB_USERNAME" ] || [ -z "$DOCKERHUB_PASSWORD" ]; then exit 0; fi
- docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
- echo "Ignore warning! Cannot perform an interactive login from a non TTY device"
- docker push $IMAGE_ORG/$IMAGE_NAME:$CI_COMMIT_SHA
test:
image: tmaier/docker-compose:latest
image: $IMAGE_ORG/$IMAGE_NAME:$CI_COMMIT_SHA
stage: test
variables:
GIT_STRATEGY: none
POSTGRESQL_HOST: postgres
POSTGRESQL_PORT: '5432'
POSTGRESQL_USERNAME: postgres
TEST_SECRET_KEY_BASE: "83dcb9140c078bd7d5a381be700e34b99de33ddf1b5d7f92ba5df356afc7f419bcc605a978649c6d639fe100f05ff721a1a482a7c1e0df416d904eef7a1acee9"
TEST_FILE_LOCATION: '/tmp/ink_api_files/'
RAILS_ENV: test
script:
- docker info
- docker-compose --version
- ./bin/ci-test
- cd /app
- ./bin/rake db:create
- ./bin/bundle exec rspec spec
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