Skip to content

Commit

Permalink
(misc) Add some docker related tasks
Browse files Browse the repository at this point in the history
Signed-off-by: R.I.Pienaar <rip@devco.net>
  • Loading branch information
ripienaar committed Mar 16, 2023
1 parent 8ebfff4 commit 28e9c98
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 2 deletions.
57 changes: 56 additions & 1 deletion ABTaskFile
Expand Up @@ -153,14 +153,69 @@ commands:
--build-arg REPO={{ .Flags.repo | escape }} \
--tag "choria/stream-replicator:nightly-${DATE}" \
--tag "choria/stream-replicator:nightly" \
--tag "registry.choria.io/choria-nightly/stream-replicator:nightly-${DATE}" \
--tag "registry.choria.io/choria-nightly/stream-replicator:nightly" \
.

{{ if .Flags.push }}
echo
echo ">>> Pushing built containers"
echo
docker push choria/stream-replicator:nightly
docker push "choria/stream-replicator:nightly"
docker push "choria/stream-replicator:nightly-${DATE}"
docker push "registry.choria.io/choria-nightly/stream-replicator:nightly-${DATE}"
docker push "registry.choria.io/choria-nightly/stream-replicator:nightly"
{{ else }}
echo
echo ">>> Skipping container push"
echo
{{ end }}

- name: release-docker
description: Builds release docker container
type: exec
aliases: [rd]
flags:
- name: repo
description: YUM Repository to use
default: https://yum.eu.choria.io/release/el/release.repo
- name: push
description: Push the built images
default: false
bool: true
banner: |
>>>
>>> Building release docker container using {{ .Flags.repo }}
>>>
script: |
set -e

TAG=$(git tag --points-at HEAD|sed -e s/^v//)
if [ -z "${TAG}" ]
then
echo "!!! HEAD is not a tag"
exit 1
fi

docker pull almalinux:8

docker build \
--no-cache \
--build-arg REPO={{ .Flags.repo | escape }} \
--tag "choria/stream-replicator:${TAG}" \
--tag "choria/stream-replicator:latest" \
--tag "registry.choria.io/choria/stream-replicator:${TAG}" \
--tag "registry.choria.io/choria/stream-replicator:latest" \
.

{{ if .Flags.push }}
echo
echo ">>> Pushing built containers"
echo
docker push "choria/stream-replicator:${TAG}"
docker push "choria/stream-replicator:latest"
docker push "registry.choria.io/choria/stream-replicator:${TAG}"
docker push "registry.choria.io/choria/stream-replicator:latest"
{{ else }}
echo
echo ">>> Skipping container push"
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Expand Up @@ -10,7 +10,7 @@ task :build do
buildid = SecureRandom.hex
packages = (ENV["PACKAGES"] || "").split(",")
packages = ["el7_64", "el8_64"] if packages.empty?
builder = "choria/packager:el8-go1.19"
builder = "registry.choria.io/choria/packager:el8-go1.19"
source = "/go/src/github.com/choria-io/stream-replicator"

packages.each do |pkg|
Expand Down

0 comments on commit 28e9c98

Please sign in to comment.