Skip to content

Commit

Permalink
Merge pull request #46 from udx/UAT-42
Browse files Browse the repository at this point in the history
cleanup before make repo public [UAT-42]
  • Loading branch information
fqjony authored Sep 4, 2024
2 parents ae6690f + 15299f7 commit abb388e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 95 deletions.
73 changes: 1 addition & 72 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,80 +47,9 @@ jobs:
echo "$CHANGELOG" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
google-release:
runs-on: ubuntu-latest
needs: test-pipeline
permissions:
contents: write
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Authenticate to Google Cloud
id: google_auth
uses: google-github-actions/auth@v2
with:
token_format: "access_token"
workload_identity_provider: ${{ vars.GCP_AUTH_PROVIDER }}
service_account: ${{ vars.GCP_SERVICE_ACCOUNT }}

- name: Set up Google Cloud SDK
uses: google-github-actions/setup-gcloud@v2

- name: Login to Google Artifact Registry
run: gcloud auth configure-docker ${{ vars.GCP_REGION }}-docker.pkg.dev

- name: Docker Login to Google Artifact Registry
run: docker login -u oauth2accesstoken -p "${{ steps.google_auth.outputs.access_token }}" ${{ vars.GCP_REGION }}-docker.pkg.dev

- name: Build and push to Google Artifact Registry
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
${{ vars.GCP_REGION }}-docker.pkg.dev/${{ vars.GCP_PROJECT }}/${{ vars.GCP_REGISTRY_REPO }}/${{ vars.DOCKER_IMAGE_NAME }}:${{ needs.test-pipeline.outputs.semVer }}
${{ vars.GCP_REGION }}-docker.pkg.dev/${{ vars.GCP_PROJECT }}/${{ vars.GCP_REGISTRY_REPO }}/${{ vars.DOCKER_IMAGE_NAME }}:latest
azure-release:
runs-on: ubuntu-latest
needs: test-pipeline
permissions:
id-token: write
contents: read
env:
ACR_REPO: udxmarketplace.azurecr.io
IMAGE_NAME: udx-worker

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Azure CLI Login
uses: azure/login@v2
with:
creds: ${{ secrets.AZURE_CREDS }}

- name: Login to Azure Container Registry
run: az acr login --name ${{ env.ACR_REPO }}

- name: Build and push to Azure Container Registry
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
${{ env.ACR_REPO }}/${{ env.IMAGE_NAME }}:${{ needs.test-pipeline.outputs.semVer }}
${{ env.ACR_REPO }}/${{ env.IMAGE_NAME }}:latest
github-release:
runs-on: ubuntu-latest
needs: [test-pipeline, google-release, azure-release]
needs: [test-pipeline]
permissions:
contents: write
steps:
Expand Down
9 changes: 1 addition & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,4 @@ make

## Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.


- worker.yml is used as config file for the environment.
- it should be handled by the container entryppoint logic.
- it should be graceful info message when there is no worker.yml found.
- it should be graceful info message when there are no workerActors.
- it should be graceful info message when there are no workerSecrets.
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
22 changes: 7 additions & 15 deletions src/configs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,14 @@ To use these configuration files, ensure that the `worker.yml` file is correctly
**worker.yml**

```yaml
kind: workerConfig
version: udx.io/worker-v1/config
config:
env:
AZURE_SUBSCRIPTION_ID: ${AZURE_SUBSCRIPTION_ID}
AZURE_TENANT_ID: ${AZURE_TENANT_ID}
AZURE_APPLICATION_ID: ${AZURE_APPLICATION_ID}
DOCKER_IMAGE_NAME: udx-worker
workerSecrets:
AZURE_SECRET: "https://kv-udx-worker-secrets.vault.azure.net/secrets/udx-worker-secret-one"
workerActors:
- type: azure-service-principal
subscription: ${AZURE_SUBSCRIPTION_ID}
tenant: ${AZURE_TENANT_ID}
application: ${AZURE_APPLICATION_ID}
password: ${AZURE_APPLICATION_PASSWORD}
variables:
DOCKER_IMAGE_NAME: "udx-worker"
secrets:
NEW_RELIC_API_KEY: "azure/kv-udx-worker/udx-worker-secret-one"
actors:
- type: azure
creds: "${AZURE_CREDS}"
```
## Local Environment Configuration
Expand Down
2 changes: 2 additions & 0 deletions src/configs/worker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ config:
variables:
DOCKER_IMAGE_NAME: "udx-worker"
secrets:
# supported
NEW_RELIC_API_KEY: "azure/kv-udx-worker/udx-worker-secret-one"
# for testing
OCTOPUS_API_KEY: "bitwarden/octetopus_api_key"
actors:
# supported
- type: azure
creds: "${AZURE_CREDS}"
# for testing
Expand Down

0 comments on commit abb388e

Please sign in to comment.