Skip to content

Commit

Permalink
Use new builder. Fixed repo name.
Browse files Browse the repository at this point in the history
  • Loading branch information
flounderpinto committed Dec 15, 2023
1 parent 95ac72e commit 6e72c3d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/workflow-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ jobs:

- name: Docker build branch
run: make docker
if: ${{ github.ref_type == 'branch' }}
if: ${{ github.ref_type == 'branch' && github.ref_name != 'main' }}

- name: Docker build main
run: make docker ARGS="-t latest"
run: make docker_main
if: ${{ github.ref_type == 'branch' && github.ref_name == 'main' }}

- name: Docker build tag
run: make docker ARGS="-t ${{github.ref_name}}"
run: make docker_tag TAG="${{github.ref_name}}"
if: ${{ github.ref_type == 'tag' }}
23 changes: 16 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,34 @@ ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))

CONTAINER_CODE_DIR=/opt/code

#TODO - registry var needs to move elsewhere. Builder?
DOCKER_REGISTRY=index.docker.io/flounder5
DOCKER_REGISTRY=index.docker.io/flounderpinto

DOCKER_REPO=runner-bash
DOCKER_BUILD_CMD=dockerBuildStandard -e ${DOCKER_REGISTRY} -r ${DOCKER_REPO} ${ARGS}
#TODO
DOCKER_BUILDER_IMAGE=flounder5/builder-docker:v0.0.6
DOCKER_BUILD_BRANCH_CMD=dockerBuildStandardBranch -e ${DOCKER_REGISTRY} -r ${DOCKER_REPO} ${ARGS}
DOCKER_BUILD_MAIN_CMD=dockerBuildStandardMain -e ${DOCKER_REGISTRY} -r ${DOCKER_REPO} ${ARGS}
DOCKER_BUILD_TAG_CMD=dockerBuildStandardTag ${TAG} -e ${DOCKER_REGISTRY} -r ${DOCKER_REPO} ${ARGS}
DOCKER_BUILDER_IMAGE=flounderpinto/builder-docker:v0.0.10
DOCKER_BUILDER_PULL_CMD=docker pull ${DOCKER_BUILDER_IMAGE}
DOCKER_BUILDER_RUN_CMD=${DOCKER_BUILDER_PULL_CMD} && \
docker run \
--rm \
-v /var/run/docker.sock:/var/run/docker.sock \
-v ${HOME}/.docker:/tmp/.docker:ro \
-v ${ROOT_DIR}:${CONTAINER_CODE_DIR} \
-w ${CONTAINER_CODE_DIR} \
${DOCKER_BUILDER_IMAGE}

.PHONY: docker
.PHONY: docker docker_main docker_tag

docker:
${DOCKER_BUILDER_RUN_CMD} ${DOCKER_BUILD_CMD}
${DOCKER_BUILDER_RUN_CMD} ${DOCKER_BUILD_BRANCH_CMD}

docker_main:
${DOCKER_BUILDER_RUN_CMD} ${DOCKER_BUILD_MAIN_CMD}

docker_tag:
test ${TAG}
${DOCKER_BUILDER_RUN_CMD} ${DOCKER_BUILD_TAG_CMD}

#Everything right of the pipe is order-only prerequisites.
all: | docker

0 comments on commit 6e72c3d

Please sign in to comment.