forked from salesforce/dockerfile-image-update
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
36 lines (29 loc) · 1.74 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
all: mvn-docker-build get-itest-jar-from-maven-image integration-test
# JDK_VERSION should be the JDK version we use to source our container dependencies
JDK_VERSION=8
MVN_SNAPSHOT_VERSION=1.0-SNAPSHOT
DFIU_DIR=dockerfile-image-update
DFIU_TARGET=${DFIU_DIR}/target
DFIU_FULLPATH=${DFIU_TARGET}/dockerfile-image-update-1.0-SNAPSHOT.jar
DFIU_ITEST_DIR=dockerfile-image-update-itest
DFIU_ITEST_TARGET=${DFIU_ITEST_DIR}/target
DFIU_ITEST_FULLPATH=${DFIU_ITEST_TARGET}/dockerfile-image-update-itest-1.0-SNAPSHOT.jar
mvn-docker-build:
docker build --tag local-maven-build --file Dockerfile.maven --build-arg JDK_VERSION=${JDK_VERSION} .
mkdir -p ${DFIU_TARGET}
docker run --rm -v $(CURDIR):/tmp/project local-maven-build /bin/bash -c "cp ${DFIU_FULLPATH} /tmp/project/${DFIU_FULLPATH}"
docker build --tag salesforce/dockerfile-image-update --build-arg JDK_VERSION=${JDK_VERSION} --build-arg MVN_VERSION=${MVN_SNAPSHOT_VERSION} .
#TODO: Modify docker-compose.yml for local image
#TODO: add --abort-on-container-exit to docker-compose once itests can be made not to flap see issue #21
integration-test:
@-echo git_api_token=${ITEST_GH_TOKEN} > $(CURDIR)/itest.env
user_itest_secrets_file_secret=$(CURDIR)/itest.env docker-compose up
rm itest.env
get-main-project-dirs:
docker run --rm -v $(CURDIR):/tmp/project local-maven-build /bin/bash -c "cp -R ${DFIU_DIR}/. /tmp/project/${DFIU_DIR}/"
docker run --rm -v $(CURDIR):/tmp/project local-maven-build /bin/bash -c "cp -R ${DFIU_ITEST_DIR}/. /tmp/project/${DFIU_ITEST_DIR}/"
get-itest-jar-from-maven-image:
mkdir -p ${DFIU_ITEST_TARGET}
docker run --rm -v $(CURDIR):/tmp/project local-maven-build /bin/bash -c "cp ${DFIU_ITEST_FULLPATH} /tmp/project/${DFIU_ITEST_FULLPATH}"
deploy:
JDK_VERSION=${JDK_VERSION} ./.ci.deploy.sh