Skip to content

Created shared readme and adjusted publishing fields. #31

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

Merged
merged 3 commits into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 1 addition & 2 deletions .github/workflows/azure-pipeline-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@ jobs:
run: |
cd ./azure-pipeline/src
npm install
cd ..

- name: Install tfx-cli
run: |
npm install -g tfx-cli

- name: Create extension
run: |
tfx extension create --manifest-globs vss-extension.json
tfx extension create --manifest-globs ./azure-pipeline/vss-extension.json

- name: Upload VSIX file
uses: actions/upload-artifact@v2
Expand Down
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# NGINXaaS for Azure Configuration Automation

This repository hosts two essential projects that facilitate the management and deployment of NGINXaaS for Azure configurations. Both projects aim to automate the process of synchronizing NGINX configuration files, but they target different platforms and have unique features and notation. To learn more about NGINXaaS for Azure, please review the [product homepage](https://www.nginx.com/products/nginx/nginxaas-for-azure/).

## Projects

### 1. Azure Pipeline Task

This project provides a custom Azure pipeline task that automates the synchronization of NGINXaaS configuration files for Azure deployments. It supports both GitHub Action pipelines and Azure DevOps pipeline tasks. [Read more](./azure-pipeline/README.md).

### 2. GitHub Action Task

This GitHub Action enables continuous deployment through GitHub workflows to automatically update the NGINXaaS for Azure deployment when changes are made to the NGINX configuration files stored in the repository. It also supports updating NGINX certificates that are present in Azure key vault. [Read more](./github-action/README.md).

## Comparison

| Feature/Aspect | Azure Pipeline Task | GitHub Action Task |
|------------------------------------|------------------------------------|-------------------------------------|
| **CI/CD Automation** | Yes | Yes |
| **Configuration File Host** | GitHub Repos or Azure Repos | GitHub |
| **Security** | Pipelines in secured agents | Azure Login Action |
| **Authentication Methods** | Service Connection | Service Principal with Secrets, OIDC|
| **Certificate Handling** | No | Yes (Azure key vault) |
| **CI/CD Platform** | Azure DevOps | GitHub |

## Getting Started

To get started with either of these projects, please refer to the detailed README files linked above.

## License

These projects are licensed under the Apache-2.0 License - see the [LICENSE.md](LICENSE) file for details.
7 changes: 3 additions & 4 deletions azure-pipeline/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {
ClientSecretCredential,
AuthenticationError,
} from '@azure/identity';
import { info } from 'console';

/**
* Class ConfigUpdater is responsible for updating the Nginx configuration.
Expand Down Expand Up @@ -111,14 +110,14 @@ class ConfigUpdater {
* @throws {Error} If the Nginx configuration uploading fails.
*/
updateNginxConfig = async () => {
console.log('updateNginxConfig...')
console.log('updateNginxConfig... \n\tSubscription: ', validatedEnvVar(INPUT.subscription), '\n\tResource Group: ', validatedEnvVar(INPUT.resource), '\n\tDeployment: ', validatedEnvVar(INPUT.deployment), '\n\tSource: ', validatedEnvVar(INPUT.source), '\n\tTarget: ', validatedEnvVar(INPUT.target), '\n\tRoot File: ', validatedEnvVar(INPUT.rootFile));
try {
const res = await updateUserConfig(
await updateUserConfig(
this.getRequestResource(),
await this.getConvertedFileObject(),
await this.getRequestConfig(),
);
console.log('Nginx config successfully uploaded!');
console.log('Nginx config uploaded successfully!');
} catch (error) {
taskLib.setResult(taskLib.TaskResult.Failed, error as any);
throw new Error("Nginx config uploading failed!");
Expand Down
14 changes: 7 additions & 7 deletions azure-pipeline/src/task.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"$schema": "https://raw.githubusercontent.com/Microsoft/azure-pipelines-task-lib/master/tasks.schema.json",
"id": "4b016be0-afe8-4f76-ace3-d7f0355d9605",
"name": "nginx-for-azure-config-sync",
"friendlyName": "nginxconfigpush",
"description": "This task is designed to synchronize Nginx configurations from an Azure DevOps repository or GitHub repository to NGINXaaS for Azure deployments.",
"helpMarkDown": "Use this task to push Nginx configuration files from your repository to your NGINXaaS for Azure deployments",
"category": "Utility",
"author": "zaotest",
"name": "nginx-config-sync-for-azure",
"friendlyName": "NGINX Configuration Sync for Azure",
"description": "This task automates the synchronization of NGINX configuration files from an Azure DevOps repository or GitHub repository to NGINXaaS for Azure deployments.",
"helpMarkDown": "Use this task to seamlessly push NGINX configuration files from your repository to your NGINXaaS for Azure deployments, ensuring consistency and efficiency in your deployment management.",
"category": "Azure Pipelines",
"author": "F5 Networks, Inc.",
"version": {
"Major": 2,
"Major": 1,
"Minor": 0,
"Patch": 0
},
Expand Down
12 changes: 6 additions & 6 deletions azure-pipeline/vss-extension.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"manifestVersion": 1,
"id": "nginx-config-sync-for-azure",
"name": "nginx-config-sync-for-azure",
"version": "2.0.0",
"publisher": "ZaoWang",
"id": "nginxaas-for-azure-config-sync",
"name": "NGINX Configuration Sync for Azure",
"version": "1.0.0",
"publisher": "F5 Networks, Inc.",
"targets": [
{
"id": "Microsoft.VisualStudio.Services"
}
],
"description": "Zao's tool for uploading nginx config",
"description": "This extension provides a streamlined solution for synchronizing NGINX configuration files with Azure deployments. Designed to support Azure DevOps pipelines, it automates the process of packaging and uploading NGINX configurations to Azure, enhancing efficiency, version control, and security. Ideal for continuous integration and deployment workflows, it simplifies the management of NGINXaaS configurations within the Azure ecosystem.",
"categories": [
"Azure Pipelines"
],
Expand Down Expand Up @@ -41,7 +41,7 @@
"galleryFlags": [
"Public"
],
"public": false,
"public": true,
"tags":[
"Build task",
"Deploy task"
Expand Down