Skip to content

Commit

Permalink
Merge pull request #131 from stuartleeks/sl/azdo-task-rename
Browse files Browse the repository at this point in the history
Rename AzDO extension/task to align with new repo name
  • Loading branch information
stuartleeks authored Jun 8, 2022
2 parents 31a44bb + 551acd6 commit fb66b7c
Show file tree
Hide file tree
Showing 46 changed files with 60 additions and 64 deletions.
10 changes: 5 additions & 5 deletions .azure-devops/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
env:
IMAGE_TAG: $(IMAGE_TAG)
- task: DevContainerBuildRun@0
- task: DevcontainersCi@0
inputs:
imageName: '$(ACR_NAME).azurecr.io/devcontainers-ci/azdo-devcontainer-build-run-examples-acr'
runCmd: 'echo $PWD'
Expand All @@ -45,7 +45,7 @@ jobs:
env:
IMAGE_TAG: $(IMAGE_TAG)
- task: DevContainerBuildRun@0
- task: DevcontainersCi@0
inputs:
imageName: '$(ACR_NAME).azurecr.io/devcontainers-ci/azdo-devcontainer-build-run/test/run-args'
subFolder: github-tests/Dockerfile/run-args
Expand All @@ -70,7 +70,7 @@ jobs:
env:
IMAGE_TAG: $(IMAGE_TAG)
- task: DevContainerBuildRun@0
- task: DevcontainersCi@0
inputs:
imageName: '$(ACR_NAME).azurecr.io/devcontainers-ci/azdo-devcontainer-build-run/test/build-args'
subFolder: github-tests/Dockerfile/build-args
Expand All @@ -95,7 +95,7 @@ jobs:
env:
IMAGE_TAG: $(IMAGE_TAG)
- task: DevContainerBuildRun@0
- task: DevcontainersCi@0
inputs:
imageName: '$(ACR_NAME).azurecr.io/devcontainers-ci/azdo-devcontainer-build-run/test/dockerfile-context'
subFolder: github-tests/Dockerfile/dockerfile-context
Expand All @@ -120,7 +120,7 @@ jobs:
env:
IMAGE_TAG: $(IMAGE_TAG)
- task: DevContainerBuildRun@0
- task: DevcontainersCi@0
inputs:
imageName: '$(ACR_NAME).azurecr.io/devcontainers-ci/azdo-devcontainer-build-run/test/feature-docker-from-docker'
subFolder: github-tests/Dockerfile/feature-docker-from-docker
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.117.1/containers/go
{
"name": "devcontainer-build-run",
"name": "devcontainers-ci",
"dockerFile": "Dockerfile",
"build": {
"cacheFrom": "ghcr.io/devcontainers/ci-devcontainer:latest"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci_common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,14 @@ jobs:
name: Create dev AzDO VSIX artifact
with:
name: azdo-task-dev
path: ./output/devcontainers-dev.devcontainer-build-run-${{ steps.build.outputs.version }}.vsix
path: ./output/devcontainers-dev.ci-${{ steps.build.outputs.version }}.vsix
if-no-files-found: error

- uses: actions/upload-artifact@v2
name: Create release AzDO VSIX artifact
with:
name: azdo-task
path: ./output/devcontainers.devcontainer-build-run-${{ steps.build.outputs.version }}.vsix
path: ./output/devcontainers.ci-${{ steps.build.outputs.version }}.vsix
if-no-files-found: error

pr-checks:
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/clean_tags.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,23 @@ if [[ -z $tag ]]; then
fi

image_names=(
"devcontainer-build-run-devcontainer"
"devcontainer-build-run/tests/run-args"
"devcontainer-build-run/tests/build-args"
"devcontainer-build-run/tests/dockerfile-context"
"devcontainer-build-run/tests/feature-docker-from-docker"
"devcontainer-build-run/tests/docker-from-docker-non-root"
"devcontainer-build-run/tests/docker-from-docker-root"
"devcontainer-build-run/tests/skip-user-update"
"ci-devcontainer"
"ci/tests/run-args"
"ci/tests/build-args"
"ci/tests/dockerfile-context"
"ci/tests/feature-docker-from-docker"
"ci/tests/docker-from-docker-non-root"
"ci/tests/docker-from-docker-root"
"ci/tests/skip-user-update"
)

for image_name in ${image_names[@]};
do
escaped_image_name=$(echo ${image_name} | sed "s/\//%2f/g")
version_id=$( curl -s -H "Authorization: Bearer $GITHUB_TOKEN" -H "Accept: application/vnd.github.v3+json" "https://api.github.com/orgs/devcontainers/packages/container/$escaped_image_name/versions" | jq -r ".[] | select(.metadata.container.tags | index(\"${tag}\")) | .id")
version_id=$( curl -s -H "Authorization: Bearer $GITHUB_TOKEN" -H "Accept: application/vnd.github.v3+json" "https://api.github.com/users/stuartleeks/packages/container/$escaped_image_name/versions" | jq -r ".[] | select(.metadata.container.tags | index(\"${tag}\")) | .id")
if [[ -n $version_id ]]; then
echo "Found version '$version_id' for '$image_name:$tag' - deleting..."
curl -s -X DELETE -H "Authorization: Bearer $GITHUB_TOKEN" -H "Accept: application/vnd.github.v3+json" "https://api.github.com/orgs/devcontainers/packages/container/$escaped_image_name/versions/$version_id"
curl -s -X DELETE -H "Authorization: Bearer $GITHUB_TOKEN" -H "Accept: application/vnd.github.v3+json" "https://api.github.com/users/stuartleeks/packages/container/$escaped_image_name/versions/$version_id"
else
echo "Tag '$tag' not found for '$image_name:$tag' - skipping"
fi
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/clean_untagged.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ set -e


image_names=(
"devcontainer-build-run-devcontainer"
"devcontainer-build-run/tests/run-args"
"devcontainer-build-run/tests/build-args"
"devcontainer-build-run/tests/dockerfile-context"
"devcontainer-build-run/tests/feature-docker-from-docker"
"devcontainer-build-run/tests/docker-from-docker-non-root"
"devcontainer-build-run/tests/docker-from-docker-root"
"devcontainer-build-run/tests/skip-user-update"
"ci-devcontainer"
"ci/tests/run-args"
"ci/tests/build-args"
"ci/tests/dockerfile-context"
"ci/tests/feature-docker-from-docker"
"ci/tests/docker-from-docker-non-root"
"ci/tests/docker-from-docker-root"
"ci/tests/skip-user-update"
)

for image_name in ${image_names[@]};
Expand Down
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"--all",
"--watchAll"
],
"cwd": "${workspaceRoot}/azdo-task/DevContainerBuildRun",
"cwd": "${workspaceRoot}/azdo-task/DevcontainersCi",
"protocol": "inspector",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# devcontainer-build-run
# devcontainers/ci

devcontainer-build-run contains a GitHub action and Azure DevOps task aimed at making it easier to re-use a [Visual Studio Code dev container](https://code.visualstudio.com/) in a GitHub workflow or Azure DevOps pipeline.
devcontainers/ci contains a GitHub action and Azure DevOps task aimed at making it easier to re-use a [Visual Studio Code dev container](https://code.visualstudio.com/) in a GitHub workflow or Azure DevOps pipeline.

This project builds on top of [@devcontainers/cli](https://www.npmjs.com/package/@devcontainers/cli)

Expand All @@ -12,7 +12,7 @@ The example below shows usage of the GitHub Action - see the [GitHub Action docu

```yaml
- name: Build and run dev container task
uses: devcontainers/ci@v0.1
uses: devcontainers/ci@v0.2
with:
imageName: ghcr.io/example/example-devcontainer
runCmd: make ci-build
Expand All @@ -23,7 +23,7 @@ The example below shows usage of the GitHub Action - see the [GitHub Action docu
The example below shows usage of the Azure DevOps Task - see the [Azure DevOps Task documentation](./docs/azure-devops-task.md) for more details:
```yaml
- task: DevContainerBuildRun@0
- task: DevcontainersCI@0
inputs:
imageName: 'yourregistry.azurecr.io/example-dev-container'
runCmd: 'make ci-build'
Expand Down
1 change: 0 additions & 1 deletion azdo-task/DevContainerBuildRun/dist/index.js.map

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.pushImage = exports.runContainer = exports.buildImage = exports.isDockerBuildXInstalled = void 0;
const task = __importStar(__nccwpck_require__(347));
const docker = __importStar(__nccwpck_require__(2255));
const docker = __importStar(__nccwpck_require__(7332));
const exec_1 = __nccwpck_require__(7757);
function isDockerBuildXInstalled() {
return __awaiter(this, void 0, void 0, function* () {
Expand Down Expand Up @@ -17059,7 +17059,7 @@ const devcontainer = {

/***/ }),

/***/ 2255:
/***/ 7332:
/***/ ((__unused_webpack_module, __webpack_exports__, __nccwpck_require__) => {

"use strict";
Expand Down
1 change: 1 addition & 0 deletions azdo-task/DevcontainersCi/dist/index.js.map

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "devcontainer-build-run",
"name": "ci",
"version": "0.0.0",
"private": true,
"description": "Azure DevOps task for building and running VS Code dev containers",
Expand All @@ -16,7 +16,7 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/sdevcontainers/ci.git"
"url": "git+https://github.com/devcontainers/ci.git"
},
"keywords": [
"actions",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/azure-pipelines-task-lib/master/tasks.schema.json",
"id": "817c56dd-a5f4-44fd-8f57-281e727e4d9c",
"name": "DevContainerBuildRun",
"friendlyName": "Dev Container Build & Run Extension",
"id": "d784888b-f54b-4926-a8d1-3a159d2de8e0",
"name": "DevcontainersCi",
"friendlyName": "Devcontainers CI Task",
"description": "Build and run VS Code dev containers in Azure DevOps Pipelines",
"author": "Stuart Leeks",
"author": "Devcontainers",
"helpMarkDown": "",
"category": "Build",
"version": {
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions azdo-task/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ steps:
env:
ACR_TOKEN: $(ACR_TOKEN)

- task: DevContainerBuildRun@0
- task: DevcontainersCi@0
inputs:
# Change this to point to your image name
imageName: 'yourregistry.azurecr.io/example-dev-container'
Expand Down Expand Up @@ -76,7 +76,7 @@ Suppose your repo has the following structure:
To build and run the dev container from `folderB` you can specify the `subFolder` input as shown below.

```yaml
- task: DevContainerBuildRun@0
- task: DevcontainersCi@0
inputs:
imageName: 'yourregistry.azurecr.io/example-dev-container'
subFolder: folderB
Expand All @@ -89,7 +89,7 @@ If you want to pass additional environment variables to the dev container when i


```yaml
- task: DevContainerBuildRun@0
- task: DevcontainersCi@0
inputs:
imageName: 'yourregistry.azurecr.io/example-dev-container'
runCmd: echo "$HELLO - $WORLD"
Expand Down
10 changes: 5 additions & 5 deletions azdo-task/scripts/build-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ figlet Version

if [[ -n $set_patch_version ]]; then
echo "--set-patch-version specified. Setting task patch version to $set_patch_version"
sed -i "s/\"Patch\": 0/\"Patch\": $set_patch_version/g" DevContainerBuildRun/task.json
sed -i "s/\"Patch\": 0/\"Patch\": $set_patch_version/g" DevcontainersCi/task.json
else
echo "--set-patch-version not set"
fi

VERSION_MAJOR=$(cat DevContainerBuildRun/task.json |jq .version.Major)
VERSION_MINOR=$(cat DevContainerBuildRun/task.json |jq .version.Minor)
VERSION_PATCH=$(cat DevContainerBuildRun/task.json |jq .version.Patch)
VERSION_MAJOR=$(cat DevcontainersCi/task.json |jq .version.Major)
VERSION_MINOR=$(cat DevcontainersCi/task.json |jq .version.Minor)
VERSION_PATCH=$(cat DevcontainersCi/task.json |jq .version.Patch)

echo "VERSION_MAJOR=${VERSION_MAJOR}"
echo "VERSION_MINOR=${VERSION_MINOR}"
Expand All @@ -64,7 +64,7 @@ fi


figlet Build task
cd "$script_dir/../DevContainerBuildRun"
cd "$script_dir/../DevcontainersCi"
npm install
npm run all

Expand Down
10 changes: 5 additions & 5 deletions azdo-task/vss-extension.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifestVersion": 1,
"id": "devcontainer-build-run",
"name": "Dev Container Build & Run Task",
"id": "ci",
"name": "Devcontainers CI",
"version": "0.2.0",
"publisher": "devcontainers",
"targets": [
Expand Down Expand Up @@ -43,18 +43,18 @@
},
"files": [
{
"path": "DevContainerBuildRun"
"path": "DevcontainersCi"
}
],
"contributions": [
{
"id": "dev-container-build-run",
"id": "DevcontainersCi",
"type": "ms.vss-distributed-task.task",
"targets": [
"ms.vss-distributed-task.tasks"
],
"properties": {
"name": "DevContainerBuildRun"
"name": "DevcontainersCi"
}
}
]
Expand Down
6 changes: 3 additions & 3 deletions docs/azure-devops-task.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ steps:
env:
ACR_TOKEN: $(ACR_TOKEN)

- task: DevContainerBuildRun@0
- task: DevcontainersCi@0
inputs:
# Change this to point to your image name
imageName: 'yourregistry.azurecr.io/example-dev-container'
Expand Down Expand Up @@ -76,7 +76,7 @@ Suppose your repo has the following structure:
To build and run the dev container from `folderB` you can specify the `subFolder` input as shown below.

```yaml
- task: DevContainerBuildRun@0
- task: DevcontainersCi@0
inputs:
imageName: 'yourregistry.azurecr.io/example-dev-container'
subFolder: folderB
Expand All @@ -89,7 +89,7 @@ If you want to pass additional environment variables to the dev container when i


```yaml
- task: DevContainerBuildRun@0
- task: DevcontainersCi@0
inputs:
imageName: 'yourregistry.azurecr.io/example-dev-container'
runCmd: echo "$HELLO - $WORLD"
Expand Down
4 changes: 0 additions & 4 deletions docs/github-action.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

devcontainer-build-run is a GitHub action aimed at making it easier to re-use a [Visual Studio Code dev container](https://code.visualstudio.com/) in a GitHub workflow.

**Status: this is a pet project that I've been experimenting with. It is not supported and you should expect bugs :-)**

NOTE: Currently, the devcontainer-build-run action only supports Dockerfile-based dev containers

## Getting Started

The [`devcontainer-build-run` action](https://github.com/marketplace/actions/devcontainer-build-run) uses Docker BuildKit to perform the Docker builds as this has support for storing layer cache metadata with the image. You can use the [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) to install this (see example below).
Expand Down
4 changes: 2 additions & 2 deletions scripts/build-test-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ npm install
npm run all

figlet AzDO Task
cd "$script_dir/../azdo-task/DevContainerBuildRun"
cd "$script_dir/../azdo-task/DevcontainersCi"
cp "$script_dir/../docs/azure-devops-task.md" "$script_dir/../azdo-task/README.md"
cp "$script_dir/../LICENSE" "$script_dir/../azdo-task/LICENSE.md"
npm install
Expand All @@ -43,7 +43,7 @@ cd "$script_dir/.."
# vss-extension.json and task.json have their version info modified by the build
# reset these before checking for changes
git checkout azdo-task/vss-extension.json
git checkout azdo-task/DevContainerBuildRun/task.json
git checkout azdo-task/DevcontainersCi/task.json
# The GH action to generate the build number leaves a BUILD_NUMBER file behind
rm BUILD_NUMBER
if [[ -n $(git status --short) ]]; then
Expand Down

0 comments on commit fb66b7c

Please sign in to comment.