OpenG2P Odoo Package Dockers build #60
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: OpenG2P Odoo Package Dockers build | |
on: | |
workflow_dispatch: | |
inputs: | |
packageName: | |
description: 'Package Name' | |
required: true | |
default: '15.0-develop' | |
type: choice | |
options: | |
- "*" | |
- 15.0-develop | |
- 15.0-develop-pilot001 | |
- 15.0-ugc-demo | |
- 15.0-1.1.0 | |
- 1.1.0 | |
jobs: | |
docker-build: | |
runs-on: ubuntu-latest | |
env: | |
NAMESPACE: ${{ secrets.docker_hub_organisation }} | |
SERVICE_NAME: openg2p-odoo-package | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Docker Login | |
run: | | |
echo "${{ secrets.docker_hub_token }}" | docker login -u ${{ secrets.docker_hub_actor }} --password-stdin || echo "::warning::Failed to Login to dockerhub" | |
- name: Docker build & push | |
run: | | |
export IMAGE_ID=$NAMESPACE/$SERVICE_NAME | |
cd packaging | |
packageNameInput=${{ inputs.packageName }} | |
if [ ! -f "packages/${packageNameInput}.txt" ]; then | |
echo "Could not find the package specified." 1>&2; | |
exit 1; | |
fi | |
for package in packages/${packageNameInput}.txt; do | |
export VERSION=$(basename "${package}" ".txt") | |
if [[ $VERSION == 15.0-* ]]; then | |
export OCA_DEPENDENCY_VERSION="15.0" | |
export DOCKER_BASE_TAG="15.0.20220810-debian-11-r9" | |
# elif [[ $VERSION == 16.0-* ]]; then | |
# TODO | |
fi | |
./package.sh ${package} | |
docker build . \ | |
--build-arg BASE_VERSION=${DOCKER_BASE_TAG} \ | |
--file Dockerfile \ | |
--tag $IMAGE_ID:$VERSION | |
docker push $IMAGE_ID:$VERSION | |
done |