-
Notifications
You must be signed in to change notification settings - Fork 29.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into pr/107705
- Loading branch information
Showing
1,571 changed files
with
69,563 additions
and
46,063 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.manifest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
# This file establishes a basline for the reposuitory before any steps in the "prepare.sh" | ||
# are run. Its just a find command that filters out a few things we don't need to watch. | ||
|
||
set -e | ||
|
||
SCRIPT_PATH="$(cd "$(dirname $0)" && pwd)" | ||
SOURCE_FOLDER="${1:-"."}" | ||
|
||
cd "${SOURCE_FOLDER}" | ||
echo "[$(date)] Generating ""before"" manifest..." | ||
find -L . -not -path "*/.git/*" -and -not -path "${SCRIPT_PATH}/*.manifest" -type f > "${SCRIPT_PATH}/before.manifest" | ||
echo "[$(date)] Done!" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
# This file simply wraps the dockeer build command used to build the image with the | ||
# cached result of the commands from "prepare.sh" and pushes it to the specified | ||
# container image registry. | ||
|
||
set -e | ||
|
||
SCRIPT_PATH="$(cd "$(dirname $0)" && pwd)" | ||
CONTAINER_IMAGE_REPOSITORY="$1" | ||
BRANCH="${2:-"master"}" | ||
|
||
if [ "${CONTAINER_IMAGE_REPOSITORY}" = "" ]; then | ||
echo "Container repository not specified!" | ||
exit 1 | ||
fi | ||
|
||
TAG="branch-${BRANCH//\//-}" | ||
echo "[$(date)] ${BRANCH} => ${TAG}" | ||
cd "${SCRIPT_PATH}/../.." | ||
|
||
echo "[$(date)] Starting image build..." | ||
docker build -t ${CONTAINER_IMAGE_REPOSITORY}:"${TAG}" -f "${SCRIPT_PATH}/cache.Dockerfile" . | ||
echo "[$(date)] Image build complete." | ||
|
||
echo "[$(date)] Pushing image..." | ||
docker push ${CONTAINER_IMAGE_REPOSITORY}:"${TAG}" | ||
echo "[$(date)] Done!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
# This file is used to archive off a copy of any differences in the source tree into another location | ||
# in the image. Once the codespace is up, this will be restored into its proper location (which is | ||
# quick and happens parallel to other startup activities) | ||
|
||
set -e | ||
|
||
SCRIPT_PATH="$(cd "$(dirname $0)" && pwd)" | ||
SOURCE_FOLDER="${1:-"."}" | ||
CACHE_FOLDER="${2:-"/usr/local/etc/devcontainer-cache"}" | ||
|
||
echo "[$(date)] Starting cache operation..." | ||
cd "${SOURCE_FOLDER}" | ||
echo "[$(date)] Determining diffs..." | ||
find -L . -not -path "*/.git/*" -and -not -path "${SCRIPT_PATH}/*.manifest" -type f > "${SCRIPT_PATH}/after.manifest" | ||
grep -Fxvf "${SCRIPT_PATH}/before.manifest" "${SCRIPT_PATH}/after.manifest" > "${SCRIPT_PATH}/cache.manifest" | ||
echo "[$(date)] Archiving diffs..." | ||
mkdir -p "${CACHE_FOLDER}" | ||
tar -cf "${CACHE_FOLDER}/cache.tar" --totals --files-from "${SCRIPT_PATH}/cache.manifest" | ||
echo "[$(date)] Done! $(du -h "${CACHE_FOLDER}/cache.tar")" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# This dockerfile is used to build up from a base image to create an image with cached results of running "prepare.sh". | ||
# Other image contents: https://github.com/microsoft/vscode-dev-containers/blob/master/repository-containers/images/github.com/microsoft/vscode/.devcontainer/base.Dockerfile | ||
FROM mcr.microsoft.com/vscode/devcontainers/repos/microsoft/vscode:dev | ||
|
||
ARG USERNAME=node | ||
COPY --chown=${USERNAME}:${USERNAME} . /repo-source-tmp/ | ||
RUN mkdir /usr/local/etc/devcontainer-cache \ | ||
&& chown ${USERNAME} /usr/local/etc/devcontainer-cache /repo-source-tmp \ | ||
&& su ${USERNAME} -c "\ | ||
cd /repo-source-tmp \ | ||
&& .devcontainer/cache/before-cache.sh \ | ||
&& .devcontainer/prepare.sh \ | ||
&& .devcontainer/cache/cache-diff.sh" \ | ||
&& rm -rf /repo-source-tmp |
Oops, something went wrong.