Change agent start command to use sg #7
Workflow file for this run
This file contains hidden or 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
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' | |
| env: | |
| REGISTRY: docker.io | |
| IMAGE_NAME: hypolas/azure-devops-agent | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Get Azure DevOps Agent Version | |
| id: agent-version | |
| run: | | |
| # Construire le stage temporaire pour extraire la version (Linux uniquement) | |
| docker build --target temp-version --platform linux/amd64 -t temp-version . | |
| AGENT_VERSION=$(docker run --rm temp-version cat /tmp/agent_version.txt) | |
| echo "agent-version=$AGENT_VERSION" >> $GITHUB_OUTPUT | |
| echo "Azure DevOps Agent Version: $AGENT_VERSION" | |
| - name: Generate Combined Version | |
| id: combined-version | |
| run: | | |
| # Extract tag version (e.g., v1.0.0-beta.05) | |
| TAG_VERSION="${GITHUB_REF#refs/tags/}" | |
| # Combined version: agent-version-tag | |
| COMBINED_VERSION="${{ steps.agent-version.outputs.agent-version }}-${TAG_VERSION}" | |
| echo "combined-version=$COMBINED_VERSION" >> $GITHUB_OUTPUT | |
| echo "Combined Version: $COMBINED_VERSION" | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Extract version from tag | |
| id: version | |
| run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | |
| - name: Extract metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| tags: | | |
| type=raw,value=latest | |
| type=raw,value=${{ steps.combined-version.outputs.combined-version }} | |
| type=raw,value=${{ steps.agent-version.outputs.agent-version }} | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| platforms: linux/amd64,linux/arm64,linux/arm/v7 | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| build-args: | | |
| INSTALL_AWS_SSM=true | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Generate release notes | |
| id: release_notes | |
| run: | | |
| cat > release_notes.md << EOF | |
| ## 🚀 Azure DevOps Docker Agent ${{ steps.version.outputs.VERSION }} | |
| ### 🎯 Agent Information | |
| - **Azure DevOps Agent Version**: \`${{ steps.agent-version.outputs.agent-version }}\` | |
| - **Release Tag**: \`${{ steps.version.outputs.VERSION }}\` | |
| - **Combined Version**: \`${{ steps.combined-version.outputs.combined-version }}\` | |
| ### 📦 Container Images | |
| - **Latest**: \`${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest\` | |
| - **Combined Version**: \`${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.combined-version.outputs.combined-version }}\` | |
| - **Agent Version**: \`${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.agent-version.outputs.agent-version }}\` | |
| - **Multi-arch support**: linux/amd64, linux/arm64, linux/arm/v7 | |
| ### ✨ Features | |
| - ✅ Azure DevOps Agent ${{ steps.agent-version.outputs.agent-version }} with container support | |
| - ⚡ Lightweight aws-ssm binary (~10MB vs ~100MB+ AWS CLI) | |
| - 🔐 AWS Secrets Manager integration | |
| - 🐳 Docker-in-Docker support | |
| - 🛡️ IMDSv2 security for AWS metadata | |
| ### 🔧 Usage | |
| \`\`\`bash | |
| # Latest image | |
| docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest | |
| # Combined version (recommended - agent + release tag) | |
| docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.combined-version.outputs.combined-version }} | |
| # Agent version only | |
| docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.agent-version.outputs.agent-version }} | |
| \`\`\` | |
| ### 📋 Quick Start | |
| \`\`\`bash | |
| docker run -d \\ | |
| --name azure-agent-1 \\ | |
| -v /var/run/docker.sock:/var/run/docker.sock \\ | |
| -e AZP_URL="https://dev.azure.com/your-org" \\ | |
| -e AZP_TOKEN="your-token" \\ | |
| -e AZP_POOL="your-pool" \\ | |
| -e AZP_AGENT_NAME="my-agent" \\ | |
| -e AGENT_NUMBER="1" \\ | |
| ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.combined-version.outputs.combined-version }} | |
| \`\`\` | |
| EOF | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| body_path: release_notes.md | |
| draft: false | |
| prerelease: false | |
| generate_release_notes: true |