Skip to content

Commit f0f6704

Browse files
committed
missing build script
1 parent 49ff3be commit f0f6704

File tree

2 files changed

+30
-5
lines changed

2 files changed

+30
-5
lines changed

.github/bin/docker-release.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
4+
5+
export DOCKER_ORG="travisghansen"
6+
export DOCKER_PROJECT="freenas-iscsi-provisioner"
7+
export DOCKER_REPO="${DOCKER_ORG}/${DOCKER_PROJECT}"
8+
9+
if [[ $GITHUB_REF == refs/tags/* ]]; then
10+
export GIT_TAG=${GITHUB_REF#refs/tags/}
11+
else
12+
export GIT_BRANCH=${GITHUB_REF#refs/heads/}
13+
fi
14+
15+
if [[ -n "${GIT_TAG}" ]]; then
16+
docker buildx build --build-arg "GIT_TAG=${GIT_TAG}" --progress plain --pull --push --platform "${DOCKER_BUILD_PLATFORM}" -t ${DOCKER_REPO}:${GIT_TAG} .
17+
elif [[ -n "${GIT_BRANCH}" ]]; then
18+
if [[ "${GIT_BRANCH}" == "master" ]]; then
19+
docker buildx build --progress plain --pull --push --platform "${DOCKER_BUILD_PLATFORM}" -t ${DOCKER_REPO}:latest .
20+
else
21+
docker buildx build --progress plain --pull --push --platform "${DOCKER_BUILD_PLATFORM}" -t ${DOCKER_REPO}:${GIT_BRANCH} .
22+
fi
23+
else
24+
:
25+
fi

.gitignore

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515

1616
*.swp
1717
*.swo
18-
bin/
19-
vendor/
20-
tmp/
21-
bin_release/
22-
manifests/
18+
/bin/
19+
/vendor/
20+
/tmp/
21+
/bin_release/
22+
/manifests/

0 commit comments

Comments
 (0)