mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-23 01:55:00 +02:00
explicit repo name in pods/external (#8929)
Signed-off-by: Alexey Aristov <aav@acm.org>
This commit is contained in:
Vendored
+27
@@ -0,0 +1,27 @@
|
||||
# External Pods Integration
|
||||
|
||||
A container for integrating external Docker images into the build process.
|
||||
|
||||
Implements two entry points consumed by the Rush build process: "docker:build" and "docker:push".
|
||||
|
||||
## docker:build
|
||||
|
||||
Imports external images into the local registry. The `services.d/` directory contains files that describe external images. A 'local' tag is applied to imported images.
|
||||
|
||||
## docker:push
|
||||
|
||||
Copies external images into the official registry (hardcoreeng). A git-based `git describe --tags --abbrev=0` tag is applied to copied images.
|
||||
|
||||
## Configuration
|
||||
|
||||
Each file in the `services.d/` directory describes a single external image. Only the first line in every file is used. The line should follow this format:
|
||||
|
||||
```
|
||||
<repository> <external_registry>/<repository>:<tag>
|
||||
```
|
||||
|
||||
If the file name starts with "-", it will be ignored. Lines starting with "#" are also ignored.
|
||||
|
||||
## More information
|
||||
|
||||
More details are available in the [Design Document](https://app.hc.engineering/workbench/platform/document/external-services-build-682232fa8c2a2eb48ffe47d5)
|
||||
Vendored
+9
-7
@@ -4,16 +4,18 @@ registry=hardcoreeng
|
||||
tag=latest
|
||||
|
||||
find services.d/ -type f -name "*.service" ! -name "-*" | sort | while read -r file; do
|
||||
extern=$(cat $file | grep -v -e '^[[:space:]]*$' -e '^#' | head -n 1 | tr -d '[:space:]')
|
||||
line=$(cat $file | grep -v -e '^[[:space:]]*$' -e '^#' | head -n 1)
|
||||
|
||||
if [ ! -z $extern ]; then
|
||||
repo=$(echo $extern | cut -d'/' -f2 | cut -d':' -f1)
|
||||
pulled=$(docker pull --quiet $extern)
|
||||
local=$registry/$repo:$tag
|
||||
target_repo=$(echo $line | cut -d ' ' -f1 | tr -d '[:space:]')
|
||||
source=$(echo $line | cut -d ' ' -f2 | tr -d '[:space:]')
|
||||
|
||||
docker tag $extern $local
|
||||
if [ ! -z $target_repo ] && [ ! -z $source ]; then
|
||||
target=$registry/$target_repo:$tag
|
||||
|
||||
echo "Pull&Tag: $pulled -> $local"
|
||||
docker pull --quiet $source > /dev/null
|
||||
docker tag $source $target
|
||||
|
||||
echo "Pull&Tag: $source -> $target"
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
Vendored
+9
-6
@@ -4,14 +4,17 @@ registry=hardcoreeng
|
||||
tag=$(git describe --tags --abbrev=0)
|
||||
|
||||
find services.d/ -type f -name "*.service" ! -name "-*" | sort | while read -r file; do
|
||||
extern=$(cat $file | grep -v -e '^[[:space:]]*$' -e '^#' | head -n 1 | tr -d '[:space:]')
|
||||
line=$(cat $file | grep -v -e '^[[:space:]]*$' -e '^#' | head -n 1)
|
||||
|
||||
if [ ! -z $extern ]; then
|
||||
repo=$(echo $extern | cut -d'/' -f2 | cut -d':' -f1)
|
||||
local=$registry/$repo:$tag
|
||||
docker buildx imagetools create --tag $local $extern
|
||||
target_repo=$(echo $line | cut -d ' ' -f1 | tr -d '[:space:]')
|
||||
source=$(echo $line | cut -d ' ' -f2 | tr -d '[:space:]')
|
||||
|
||||
echo "Copy: $extern -> $local"
|
||||
if [ ! -z $target_repo ] && [ ! -z $source ]; then
|
||||
target=$registry/$target_repo:$tag
|
||||
|
||||
docker buildx imagetools create --tag $target $source
|
||||
|
||||
echo "Copy: $source -> $target"
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
aristov/hulykvs:0.1.1
|
||||
hulykvs hardcoreeng/service_hulykvs:0.2.0
|
||||
|
||||
Reference in New Issue
Block a user