Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding devcontainer definition #1118

Merged
merged 25 commits into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
f31b702
Adding devcontainer definition - #1095
aaronpowell Nov 9, 2022
d209f2c
Update ext/devcontainer/devcontainer-feature.json
aaronpowell Nov 10, 2022
fc31aca
adding workflow to publish devcontainer image
aaronpowell Nov 10, 2022
af2416d
Update ext/devcontainer/devcontainer-feature.json
aaronpowell Nov 11, 2022
b13557d
Update ext/devcontainer/README.md
aaronpowell Nov 13, 2022
af2e87b
adding tests and supporting the expected folder structure
aaronpowell Nov 13, 2022
031080d
ensuring curl is available and fixing tests
aaronpowell Nov 13, 2022
d83de94
Update ext/devcontainer/src/azd/install.sh
aaronpowell Nov 23, 2022
0362197
combining devcontainer workflows into a single workflow
aaronpowell Nov 25, 2022
8ab490d
Merge branch 'main' of github.com:Azure/azure-dev into aaronpowell/is…
vhvb1989 Mar 21, 2023
0475953
Updating based on some feedback
aaronpowell Jun 13, 2023
a1ce72e
Apply suggestions from code review
aaronpowell Jun 21, 2023
786390a
Apply suggestions from code review
aaronpowell Jun 21, 2023
9e3f46c
Update ext/devcontainer/src/azd/README.md
hemarina Jun 27, 2023
5fdc8f2
Update ext/devcontainer/src/azd/install.sh
hemarina Jun 27, 2023
567a94e
Update ext/devcontainer/src/azd/install.sh
aaronpowell Jun 28, 2023
f1c055b
Apply suggestions from code review
aaronpowell Jun 29, 2023
0685264
Update ext/devcontainer/src/azd/devcontainer-feature.json
hemarina Jun 29, 2023
f3935bf
Update ext/devcontainer/src/azd/README.md
hemarina Jun 29, 2023
4979a83
add xdg-utils/version due to local test/feedback
hemarina Jun 30, 2023
6f2cf57
remove since vscode-node-azure-pack contains it
hemarina Jul 3, 2023
e07e302
add auto pr for documentation update
hemarina Jul 3, 2023
d81d007
separate release and test, add permission
hemarina Jul 6, 2023
a647878
add workflow test yml
hemarina Jul 6, 2023
b943911
add PAT for release tag
hemarina Jul 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/devcontainer-feature-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build dev container feature image

env:
IMAGE_NAME: ${{ github.repository }}
REGISTRY: ghcr.io

on:
danieljurek marked this conversation as resolved.
Show resolved Hide resolved
push:
aaronpowell marked this conversation as resolved.
Show resolved Hide resolved
paths:
- "ext/devcontainer/**"
branches:
- main
workflow_dispatch:

jobs:
deploy:
hemarina marked this conversation as resolved.
Show resolved Hide resolved
if: ${{ github.ref == 'refs/heads/main' }}
danieljurek marked this conversation as resolved.
Show resolved Hide resolved
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: "Publish Features"
uses: devcontainers/action@v1
with:
publish-features: "true"
base-path-to-features: "./ext/devcontainer"
generate-docs: "true"
hemarina marked this conversation as resolved.
Show resolved Hide resolved
60 changes: 60 additions & 0 deletions .github/workflows/devcontainer-feature-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Test dev container feature image
on:
push:
paths:
- "ext/devcontainer/**"
branches:
- main
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
baseImage:
[
"ubuntu:focal",
"ubuntu:jammy",
"ubuntu:bionic",
"debian:11",
"debian:10",
"mcr.microsoft.com/devcontainers/base:ubuntu",
"mcr.microsoft.com/devcontainers/base:debian",
]
steps:
- uses: actions/checkout@v2

- name: "Install latest devcontainer CLI"
run: npm install -g @devcontainers/cli

- name: "Generating tests for 'azd' against '${{ matrix.baseImage }}'"
run: devcontainer features test -f azd -i ${{ matrix.baseImage }} .
working-directory: ./ext/devcontainer

test-scenarios:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v2

- name: "Install latest devcontainer CLI"
run: npm install -g @devcontainers/cli

- name: "Testing 'azd' scenarios"
run: devcontainer features test -f azd --skip-autogenerated .
working-directory: ./ext/devcontainer

test-global:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v2

- name: "Install latest devcontainer CLI"
run: npm install -g @devcontainers/cli

- name: "Testing global scenarios"
run: devcontainer features test --global-scenarios-only .
working-directory: ./ext/devcontainer
19 changes: 19 additions & 0 deletions ext/devcontainer/src/azd/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Azure Developer CLI (azure-dev-cli)
aaronpowell marked this conversation as resolved.
Show resolved Hide resolved

Installs the [Azure Developer CLI](https://github.com/Azure/azure-dev) along with needed dependencies.

## Example Usage

```json
"features": {
"ghcr.io/azure/azure-dev/azd:1": {
aaronpowell marked this conversation as resolved.
Show resolved Hide resolved
"version": "latest"
}
}
```

## Options

| Options Id | Description | Type | Default Value |
|-----|-----|-----|-----|
| version | Select or enter an Azure Developer CLI version. (Available versions may vary by Linux distribution.) | string | latest |
hemarina marked this conversation as resolved.
Show resolved Hide resolved
25 changes: 25 additions & 0 deletions ext/devcontainer/src/azd/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"id": "azd",
"version": "1.0.0",
hemarina marked this conversation as resolved.
Show resolved Hide resolved
"name": "Azure Dev CLI",
aaronpowell marked this conversation as resolved.
Show resolved Hide resolved
"documentationURL": "https://github.com/azure/azure-dev/tree/main/ext/devcontainer/src/azd",
"description": "Installs the Azure Developer CLI along with needed dependencies.",
"options": {
"version": {
"type": "string",
"proposals": [
"latest"
hemarina marked this conversation as resolved.
Show resolved Hide resolved
hemarina marked this conversation as resolved.
Show resolved Hide resolved
],
"default": "latest",
aaronpowell marked this conversation as resolved.
Show resolved Hide resolved
"description": "Select or enter an Azure Developer CLI version. (Available versions may vary by Linux distribution.)"
}
},
"customizations": {
"vscode": {
"extensions": [
"ms-azuretools.vscode-bicep",
"ms-vscode.vscode-node-azure-pack"
aaronpowell marked this conversation as resolved.
Show resolved Hide resolved
]
}
}
}
22 changes: 22 additions & 0 deletions ext/devcontainer/src/azd/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
AZ_VERSION=${VERSION:-"latest"}
aaronpowell marked this conversation as resolved.
Show resolved Hide resolved
aaronpowell marked this conversation as resolved.
Show resolved Hide resolved

check_packages() {
if ! dpkg -s "$@" > /dev/null 2>&1; then
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
echo "Running apt-get update..."
apt-get update -y
fi
apt-get -y install --no-install-recommends "$@"
fi
}

echo "(*) Ensuring dependencies are installed"

check_packages apt-transport-https curl ca-certificates gnupg2 dirmngr
aaronpowell marked this conversation as resolved.
Show resolved Hide resolved

echo "(*) Installing Azure Dev CLI"
aaronpowell marked this conversation as resolved.
Show resolved Hide resolved

curl -fsSLO https://aka.ms/install-azd.sh
chmod +x ./install-azd.sh

./install-azd.sh --version $AZ_VERSION
aaronpowell marked this conversation as resolved.
Show resolved Hide resolved
12 changes: 12 additions & 0 deletions ext/devcontainer/test/azd/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

set -e

# Optional: Import test library
source dev-container-features-test-lib

# Definition specific tests
check "version" azd version

# Report result
reportResults