Skip to content

Commit

Permalink
Makefile cleanup. Fix pipeline.
Browse files Browse the repository at this point in the history
  • Loading branch information
flounderpinto committed Dec 14, 2023
1 parent f41d065 commit 569afc1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/workflow-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,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' }}
17 changes: 11 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ INIT_CMD=git submodule update --init --recursive
ANALYZE_CMD=cd ./src && find . -name '*.sh' | xargs shellcheck -x && \
cd ../test/unit && find . -name '*.sh' | xargs shellcheck -x
UNIT_TEST_CMD=cd ./test/unit && ./test.sh
DOCKER_BUILD_BRANCH_CMD=./src/dockerBuild.sh dockerBuildStandardBranch -e ${DOCKER_REGISTRY} -r ${DOCKER_REPO} ${ARGS}
DOCKER_BUILD_MAIN_CMD=./src/dockerBuild.sh dockerBuildStandardMain -e ${DOCKER_REGISTRY} -r ${DOCKER_REPO} ${ARGS}
DOCKER_BUILD_TAG_CMD=./src/dockerBuild.sh dockerBuildStandardTag ${TAG} -e ${DOCKER_REGISTRY} -r ${DOCKER_REPO} ${ARGS}

DOCKER_REGISTRY=index.docker.io/flounder5

Expand All @@ -22,7 +25,7 @@ BUILDER_RUN_CMD=${BUILDER_PULL_CMD} && \

DOCKER_REPO=builder-docker

.PHONY: init analyze analyze_local unit_test unit_test_local docker
.PHONY: init analyze analyze_local unit_test unit_test_local docker docker_main docker_tag

init:
${INIT_CMD}
Expand All @@ -42,11 +45,13 @@ unit_test_local:
#To prevent the circular dependency, this repo calls the dockerBuild script directly
# instead of through the builder-docker image.
docker:
./src/dockerBuild.sh \
dockerBuildStandardBranch \
-e ${DOCKER_REGISTRY} \
-r ${DOCKER_REPO} \
${ARGS}
${DOCKER_BUILD_BRANCH_CMD}

docker_main:
${DOCKER_BUILD_MAIN_CMD}

docker_tag:
.${DOCKER_BUILD_TAG_CMD}

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

0 comments on commit 569afc1

Please sign in to comment.