try script
ci.vdhsn.com/push Build is passing
Details
ci.vdhsn.com/push Build is passing
Details
parent
4a119c2523
commit
91c56d430e
@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
docker run --rm \
|
||||||
|
-e DRONE_COMMIT_REF=refs/heads/trunk \
|
||||||
|
-e DRONE_REPO_BRANCH=trunk \
|
||||||
|
-e PLUGIN_REGISTRY=git.vdhsn.com \
|
||||||
|
-e PLUGIN_REPO=git.vdhsn.com/barretthousen/service-catalog \
|
||||||
|
-e PLUGIN_BUILD_ARGS="service=catalog" \
|
||||||
|
-e PLUGIN_TAGS=$(git rev-parse --verify --short HEAD) \
|
||||||
|
-e PLUGIN_CONTEXT="./src" \
|
||||||
|
-e PLUGIN_DOCKERFILE="./src/Dockerfile.prod-backend" \
|
||||||
|
-e PLUGIN_USERNAME=${DOCKER_USERNAME} \
|
||||||
|
-e PLUGIN_PASSWORD=${DOCKER_PASSWORD} \
|
||||||
|
-e PLUGIN_ENABLE_CACHE=true \
|
||||||
|
-e PLUGIN_CACHE_REPO='git.vdhsn.com/barretthousen/ci-cache' \
|
||||||
|
-e PLUGIN_SKIP_UNUSED_STAGES=true \
|
||||||
|
-v $(pwd):/drone \
|
||||||
|
-w /drone \
|
||||||
|
plugins/kaniko:linux-amd64
|
@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
|
||||||
|
main(){
|
||||||
|
local REPOSITORY=${1};
|
||||||
|
if [ -z "${REPOSITORY}" ]; then
|
||||||
|
echo "First argument must be container repository";
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
|
||||||
|
local FROM=${2:-beta};
|
||||||
|
local TO=${3:-prod};
|
||||||
|
|
||||||
|
local CONTENT_TYPE="application/vnd.docker.distribution.manifest.v2+json";
|
||||||
|
local REGISTRY_URL="https://git.vdhsn.com/v2/${REPOSITORY}/manifests";
|
||||||
|
|
||||||
|
export MANIFEST=$(curl -u "${DOCKER_USERNAME}:${DOCKER_PASSWORD}" \
|
||||||
|
-H "Accept: ${CONTENT_TYPE}" "${REGISTRY_URL}/${FROM}");
|
||||||
|
|
||||||
|
|
||||||
|
curl -u "${DOCKER_USERNAME}:${DOCKER_PASSWORD}" \
|
||||||
|
-X PUT -H "Content-Type: ${CONTENT_TYPE}" -d "${MANIFEST}" "${REGISTRY_URL}/${TO}";
|
||||||
|
}
|
||||||
|
|
@ -1,3 +1,4 @@
|
|||||||
.idea
|
.idea
|
||||||
web-client
|
web-client
|
||||||
admin-client
|
admin-client
|
||||||
|
|
||||||
|
Loading…
Reference in new issue