Speed up builds even more
This commit is contained in:
parent
041d9ea40f
commit
a7e94b792e
|
@ -36,9 +36,17 @@ async function planDockerImage(name, dependentHashes, opts) {
|
||||||
local,
|
local,
|
||||||
remote,
|
remote,
|
||||||
download: async () => {
|
download: async () => {
|
||||||
|
if (name === "app") {
|
||||||
|
// Magic string parsed by publish.bash
|
||||||
|
console.log("[for publish script: plan-publish is tagging app image]");
|
||||||
|
}
|
||||||
await runCommand(`make pull I=${name}`);
|
await runCommand(`make pull I=${name}`);
|
||||||
},
|
},
|
||||||
build: async () => {
|
build: async () => {
|
||||||
|
if (name === "app") {
|
||||||
|
// Magic string parsed by publish.bash
|
||||||
|
console.log("[for publish script: plan-publish is tagging app image]");
|
||||||
|
}
|
||||||
await runCommand(`make image I=${name}`);
|
await runCommand(`make image I=${name}`);
|
||||||
},
|
},
|
||||||
upload: async () => {
|
upload: async () => {
|
||||||
|
|
|
@ -10,17 +10,6 @@ if [[ -z "${DEPLOY_SSH_PRIVATE_KEY:-}" ]]; then
|
||||||
DEPLOY_SSH_PRIVATE_KEY="$(base64 < "${DEPLOY_SSH_PUBLIC_KEY_FILE%.pub}")"
|
DEPLOY_SSH_PRIVATE_KEY="$(base64 < "${DEPLOY_SSH_PUBLIC_KEY_FILE%.pub}")"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
make pull-base scripts
|
|
||||||
|
|
||||||
node tools/plan-publish.js --publish --show-all --omit-unneeded-downloads
|
|
||||||
|
|
||||||
sha="$(git describe --match=always-omit-tag --always --abbrev=40 --dirty)"
|
|
||||||
|
|
||||||
image="${DOCKER_REPO}:app-${sha}"
|
|
||||||
|
|
||||||
docker tag "${DOCKER_REPO}:app" "${image}"
|
|
||||||
docker push "${image}"
|
|
||||||
|
|
||||||
tmpdir="$(mktemp -d)"
|
tmpdir="$(mktemp -d)"
|
||||||
|
|
||||||
function cleanup {
|
function cleanup {
|
||||||
|
@ -29,6 +18,23 @@ function cleanup {
|
||||||
|
|
||||||
trap cleanup EXIT
|
trap cleanup EXIT
|
||||||
|
|
||||||
|
make pull-base scripts
|
||||||
|
|
||||||
|
node tools/plan-publish.js --publish --show-all --omit-unneeded-downloads \
|
||||||
|
| tee "${tmpdir}/plan-publish.out"
|
||||||
|
|
||||||
|
if ! grep -F "plan-publish is tagging app image" "${tmpdir}/plan-publish.out"; then
|
||||||
|
echo "publish.bash: no changes to app image, so not deploying" >&2
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
sha="$(git describe --match=always-omit-tag --always --abbrev=40 --dirty)"
|
||||||
|
|
||||||
|
image="${DOCKER_REPO}:app-${sha}"
|
||||||
|
|
||||||
|
docker tag "${DOCKER_REPO}:app" "${image}"
|
||||||
|
docker push "${image}"
|
||||||
|
|
||||||
base64 -d <<< "${DEPLOY_SSH_PRIVATE_KEY}" > "${tmpdir}/id"
|
base64 -d <<< "${DEPLOY_SSH_PRIVATE_KEY}" > "${tmpdir}/id"
|
||||||
chmod go-rwx "${tmpdir}/id"
|
chmod go-rwx "${tmpdir}/id"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue