Skip to content

Commit

Permalink
testing make logic
Browse files Browse the repository at this point in the history
  • Loading branch information
bryan-nice committed Feb 24, 2020
1 parent 48bc668 commit c8287dc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/push-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@ jobs:
run: git checkout origin/${GITHUB_HEAD_REF:-${GITHUB_REF##*/}}
- name: Build Docker Image
id: build_docker_image
run: make docker-build
run: |
make \
GITHUB_HEAD_REF=${GITHUB_HEAD_REF:-${GITHUB_REF##*/}} \
GITHUB_EVENT_NAME=${GITHUB_EVENT_NAME} \
docker-build
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,17 @@ default: help
.PHONY: docker-build
docker-build: docker-rmi-for-build
docker build \
--build-arg GITHUB_HEAD_REF=$(GITHUB_HEAD_REF) \
--build-arg GITHUB_EVENT_NAME=$(GITHUB_EVENT_NAME) \
--tag $(GIT_REPOSITORY_NAME) \
--tag $(GIT_REPOSITORY_NAME):$(GIT_VERSION) \
build/docker

.PHONY: docker-build-development-cache
docker-build-development-cache: docker-rmi-for-build-development-cache
docker build \
--build-arg GITHUB_HEAD_REF=$(GITHUB_HEAD_REF) \
--build-arg GITHUB_EVENT_NAME=$(GITHUB_EVENT_NAME) \
--tag $(GIT_REPOSITORY_NAME):$(GIT_VERSION) \
build/docker

Expand Down
3 changes: 1 addition & 2 deletions build/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ WORKDIR /go/src/git-action-jira-issue-creation

# Check merge if build is triggered by a pull request
WORKDIR /go/src/git-action-jira-issue-creation
RUN if [[ "${GITHUB_HEAD_REF}" != "master" && ${GITHUB_EVENT_NAME} == "pull_request" ]]; \
then \
RUN if [[ "${GITHUB_HEAD_REF}" != "master" && "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then \
git checkout ${GITHUB_HEAD_REF}; \
git merge master; \
fi
Expand Down

0 comments on commit c8287dc

Please sign in to comment.