Skip to content

Commit

Permalink
Always push the latest master images to dockerhub (airbytehq#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
michel-tricot authored Sep 10, 2020
1 parent 2208ad1 commit e43af2d
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 28 deletions.
20 changes: 15 additions & 5 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,28 +41,38 @@ jobs:
- name: Ensure no file change
run: git diff-index --quiet HEAD

- name: Build Integration Docker Images (Master branch only)
- name: Build Integration Docker Images
if: success() && github.ref == 'refs/heads/master'
run: ./gradlew buildImage --no-daemon -g ${{ env.GRADLE_PATH }}

- name: Write BigQuery Integration Test Credentials (Master branch only)
- name: Write BigQuery Integration Test Credentials
if: success() && github.ref == 'refs/heads/master'
run: 'mkdir dataline-integrations/singer/bigquery/destination/config && echo "$BIGQUERY_INTEGRATION_TEST_CREDS" > dataline-integrations/singer/bigquery/destination/config/credentials.json'
env:
BIGQUERY_INTEGRATION_TEST_CREDS: ${{secrets.BIGQUERY_INTEGRATION_TEST_CREDS}}
BIGQUERY_INTEGRATION_TEST_CREDS: ${{ secrets.BIGQUERY_INTEGRATION_TEST_CREDS }}

- name: Run Integration Tests (Master branch only)
- name: Run Integration Tests
if: success() && github.ref == 'refs/heads/master'
run: ./gradlew integrationTest --no-daemon -g ${{ env.GRADLE_PATH }}

- name: Build Core Docker Images (Master branch only)
- name: Build Core Docker Images
if: success() && github.ref == 'refs/heads/master'
run: docker-compose -f docker-compose.build.yaml build
env:
GIT_REVISION: ${{ github.sha }}

- name: Run End-to-End Acceptance Tests (Master branch only)
if: success() && github.ref == 'refs/heads/master'
run: ./tools/bin/acceptance_test.sh

- name: Push Core Docker Images
if: success() && github.ref == 'refs/heads/master'
run: |
docker login -u datalinebot -p ${DOCKER_PASSWORD}
docker-compose -f docker-compose.build.yaml push
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

- name: Slack Notification (Master branch only)
if: failure() && github.ref == 'refs/heads/master'
uses: rtCamp/action-slack-notify@master
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.gradle
.idea
build
!tools/build
.DS_Store
dataline-db/pg_data/*
data
20 changes: 1 addition & 19 deletions Dockerfile.build
Original file line number Diff line number Diff line change
@@ -1,25 +1,7 @@
#####################
# Setup build image #
#####################
FROM ubuntu:20.04 AS build-base

WORKDIR /code

ENV DEBIAN_FRONTEND noninteractive

# Install tools
RUN apt-get update && apt-get -y install curl

# Setup Node & Java
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
RUN apt-get update && apt-get -y install \
nodejs \
openjdk-14-jdk

#######################
# Prepare project env #
#######################
FROM build-base AS build-project
FROM dataline/build-base:1.0.0 AS build-project

WORKDIR /code

Expand Down
14 changes: 10 additions & 4 deletions docker-compose.build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,37 @@ services:
build:
dockerfile: Dockerfile.database
context: .
labels:
io.dataline.git-revision: ${GIT_REVISION}
seed:
image: dataline/seed:dev
build:
dockerfile: Dockerfile.build
target: seed
context: .
labels:
io.dataline.git-revision: ${GIT_REVISION}
scheduler:
image: dataline/scheduler:dev
build:
dockerfile: Dockerfile.build
target: scheduler
context: .
labels:
io.dataline.git-revision: ${GIT_REVISION}
server:
image: dataline/server:dev
build:
dockerfile: Dockerfile.build
target: server
context: .
labels:
io.dataline.git-revision: ${GIT_REVISION}
webapp:
image: dataline/webapp:dev
build:
dockerfile: Dockerfile.build
target: webapp
context: .

networks:
dataline:
driver: "bridge"
labels:
io.dataline.git-revision: ${GIT_REVISION}
20 changes: 20 additions & 0 deletions tools/build/Dockerfile.base
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#####################
# Setup build image #
#####################
FROM ubuntu:20.04

LABEL io.dataline.image=datalineio/build-base
LABEL io.dataline.version=1.0.0

WORKDIR /code

ENV DEBIAN_FRONTEND noninteractive

# Install tools
RUN apt-get update && apt-get -y install curl

# Setup Node & Java
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
RUN apt-get update && apt-get -y install \
nodejs \
openjdk-14-jdk
6 changes: 6 additions & 0 deletions tools/build/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
This docker image contains the build environment used to generate all our artifacts.

If you need to do some changes the environment:
1. Bump up the version in the docker file (`io.dataline.version`).
1. Build and push the image (with the new tag).
1. Update the consumers to use the most recent build image.

0 comments on commit e43af2d

Please sign in to comment.