Have CI push Docker image

This commit is contained in:
Hakan Ensari 2018-10-10 13:39:00 +01:00
parent 67911aacb8
commit 4debe6f5a6
2 changed files with 16 additions and 2 deletions

View File

@ -6,10 +6,19 @@ rvm:
- 2.5 - 2.5
addons: addons:
postgresql: "9.6" postgresql: 10
before_install: before_install:
- "psql -c 'create database frankfurter_test;' -U postgres" - "psql -c 'create database frankfurter_test;' -U postgres"
bundler_args: "--without development" services:
- docker
bundler_args: "--without development test"
env: env:
- APP_ENV=test - APP_ENV=test
deploy:
provider: script
script: bash bin/docker_push
on:
branch: master

5
bin/docker_push Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
docker build -t "$DOCKER_USERNAME/frankfurter" .
docker push "$DOCKER_USERNAME/frankfurter"