Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(misc) Add some docker related tasks #89

Merged
merged 1 commit into from Mar 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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