Skip to content

Update Dockerfile

Update Dockerfile #16

Workflow file for this run

name: Maven Package upon a push
on:
push:
branches:
- master
- 1.*
- develop
- release*
- tf-develop*
jobs:
build-postgres-init-docker:
runs-on: ubuntu-latest
env:
NAMESPACE: ${{ secrets. dev_namespace_docker_hub }}
SERVICE_NAME: postgres-init
SERVICE_LOCATION: postgres-init
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- name: Setup branch and env
run: |
# Strip git ref prefix from version
echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV
echo "GPG_TTY=$(tty)" >> $GITHUB_ENV
- name: clone all repos
run: |
cd "./${{env.SERVICE_LOCATION}}"
chmod +x ./get_db_data.sh
bash ./get_db_data.sh ${{ env.BRANCH_NAME }}
- name: Build image
run: |
cd "./${{env.SERVICE_LOCATION}}"
docker build . --file Dockerfile --tag ${{ env.SERVICE_NAME }}
- name: Log into registry
run: echo "${{ secrets.release_docker_hub }}" | docker login -u ${{ secrets.actor_docker_hub }} --password-stdin
- name: Push image
run: |
IMAGE_ID=$NAMESPACE/$SERVICE_NAME
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
VERSION=$BRANCH_NAME
echo "push version $VERSION"
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $SERVICE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
# - uses: 8398a7/action-slack@v3
# with:
# status: ${{ job.status }}
# fields: repo,message,commit,author,job,took # selectable (default: repo,message)
# env:
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required
# if: failure() # Pick up events even if the job fails or is canceled.
build-postgres-upgrade-docker:
runs-on: ubuntu-latest
env:
NAMESPACE: ${{ secrets. dev_namespace_docker_hub }}
SERVICE_NAME: postgres-upgrade
SERVICE_LOCATION: postgres-upgrade
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- name: Setup branch and env
run: |
# Strip git ref prefix from version
echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV
echo "GPG_TTY=$(tty)" >> $GITHUB_ENV
- name: clone all repos
run: |
cd "./${{env.SERVICE_LOCATION}}"
chmod +x ./get_db_data.sh
bash ./get_db_data.sh ${{ env.BRANCH_NAME }}
- name: Build image
run: |
cd "./${{env.SERVICE_LOCATION}}"
docker build . --file Dockerfile --tag ${{ env.SERVICE_NAME }}
- name: Log into registry
run: echo "${{ secrets.release_docker_hub }}" | docker login -u ${{ secrets.actor_docker_hub }} --password-stdin
- name: Push image
run: |
IMAGE_ID=$NAMESPACE/$SERVICE_NAME
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
VERSION=$BRANCH_NAME
echo "push version $VERSION"
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $SERVICE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
# - uses: 8398a7/action-slack@v3
# with:
# status: ${{ job.status }}
# fields: repo,message,commit,author,job,took # selectable (default: repo,message)
# env:
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required
# if: failure() # Pick up events even if the job fails or is canceled.
build-masterdata-loader-docker:
runs-on: ubuntu-latest
env:
NAMESPACE: ${{ secrets. dev_namespace_docker_hub }}
SERVICE_NAME: masterdata-loader
SERVICE_LOCATION: masterdata
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- name: Setup branch and env
run: |
# Strip git ref prefix from version
echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV
echo "GPG_TTY=$(tty)" >> $GITHUB_ENV
- name: Build image
run: |
cd "./${{env.SERVICE_LOCATION}}"
docker build . --file Dockerfile --tag ${{ env.SERVICE_NAME }}
- name: Log into registry
run: echo "${{ secrets.release_docker_hub }}" | docker login -u ${{ secrets.actor_docker_hub }} --password-stdin
- name: Push image
run: |
IMAGE_ID=$NAMESPACE/$SERVICE_NAME
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
VERSION=$BRANCH_NAME
echo "push version $VERSION"
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $SERVICE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
## - uses: 8398a7/action-slack@v3
# with:
# status: ${{ job.status }}
# fields: repo,message,commit,author,job,took # selectable (default: repo,message)
# env:
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required
# if: failure() # Pick up events even if the job fails or is canceled.