Skip to content

Commit

Permalink
Release v0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
willguibr committed Mar 28, 2024
0 parents commit 219a961
Show file tree
Hide file tree
Showing 865 changed files with 177,617 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .ci-mgmt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Required values:
provider: zia # substitute the name of your provider, without the pulumi- prefix
#env: # A map of required configuration for any integration tests, etc.
# AN_OPTION: value
# ANOTHER_OPTION: true
# etc.
lint: true # Linting should be true in most cases, unless failing rules in the upstream provider makes this impractical.

# Optional values:
#docker: true # Whether the provider's tests use Docker to run. If set to true, a file `testing/docker-compose.yml` must be present in the provider repository.
#setup-script: testing/setup.sh # Path to a script that's used for testing bootstraps
68 changes: 68 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
ARG UBUNTU_VERSION=latest
FROM ubuntu:${UBUNTU_VERSION}

# Update apt-get and install various needed utilities
RUN apt-get update && \
apt-get install -y curl && \
apt-get install -y wget && \
apt-get install -y xz-utils && \
apt-get install -y make && \
apt-get install -y gcc && \
apt-get install -y git

# Install bridged provider prerequisites
# See README.md

# Install go
ARG GO_VERSION=1.18.3
RUN rm -rf /usr/local/go && \
wget -O ${GO_VERSION}.tar.gz https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz && \
tar -C /usr/local -xzf ${GO_VERSION}.tar.gz && \
rm ${GO_VERSION}.tar.gz

ENV GOPATH=/root/go
ENV PATH=$PATH:/usr/local/go/bin

# Install go linter
RUN mkdir -p $GOPATH/bin && \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $GOPATH/bin v1.46.2

ENV PATH=$PATH:$GOPATH/bin

# Install pulumictl
ARG PULUMICTL_VERSION=v0.0.32
RUN rm -rf /usr/local/bin/pulumictl && \
wget -O pulumictl.${PULUMICTL_VERSION}.tar.gz https://github.com/pulumi/pulumictl/releases/download/${PULUMICTL_VERSION}/pulumictl-${PULUMICTL_VERSION}-linux-amd64.tar.gz && \
tar -C /usr/local/bin -xzf pulumictl.${PULUMICTL_VERSION}.tar.gz

# Install nodejs
ARG NODEJS_VERSION=v16.16.0
ARG NODEJS_PKG=node-${NODEJS_VERSION}-linux-x64
ARG NODEJS_TARBALL=${NODEJS_PKG}.tar.xz
RUN rm -rf /usr/local/node && \
wget -O ${NODEJS_TARBALL} https://nodejs.org/dist/${NODEJS_VERSION}/${NODEJS_TARBALL} && \
tar -C /usr/local -xf ${NODEJS_TARBALL} && \
mv /usr/local/${NODEJS_PKG} /usr/local/node

ENV PATH=$PATH:/usr/local/node/bin

# Install yarn
RUN npm install --global yarn

# Install python and related items
RUN apt-get install -y python3 && \
apt-get install -y python3-setuptools

# Install .NET
RUN wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && \
dpkg -i packages-microsoft-prod.deb && \
rm packages-microsoft-prod.deb

RUN apt-get update && \
apt-get install -y apt-transport-https && \
apt-get update && \
apt-get install -y dotnet-sdk-6.0

# Install Pulumi
RUN curl -fsSL https://get.pulumi.com | sh
ENV PATH=$PATH:/root/.pulumi/bin
8 changes: 8 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.202.3/containers/hugo
{
"name": "TFProvider",
"build": {
"dockerfile": "Dockerfile"
}
}
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.github/ @willguibr
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2
updates:
- package-ecosystem: gomod
directory: "/provider"
schedule:
interval: monthly
open-pull-requests-limit: 3
reviewers:
- willguibr
- package-ecosystem: gomod
directory: "/sdk"
schedule:
interval: monthly
open-pull-requests-limit: 3
reviewers:
- willguibr
18 changes: 18 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Affected Components
* [ ] Resources
* [ ] Test
* [ ] Docs
* [ ] Tooling
* [ ] Other

## Pre-Requisites
* [ ] Go code is formatted with `go fmt`

<!-- You can erase any parts of this template not applicable to your Pull Request. -->
## Notes for the Reviewer
<!-- Anything the reviewer should pay extra attention to. -->

> Resolves #[issue-number]
## New Dependency Submission
<!-- Please explain here why we need the new dependency. -->
21 changes: 21 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
daysUntilStale: 90
daysUntilClose: 7
exemptLabels:
- "status: confirmed"
- "type: question"

staleLabel: "status: stale"
issues:
markComment: >
This issue has been automatically marked as stale.
**If this issue is still affecting you, please leave any comment** (for example, "bump"), and we'll keep it open.
We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!
closeComment: >
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!
pulls:
markComment: >
This pull request has been automatically marked as stale.
**If this pull request is still relevant, please leave any comment** (for example, "bump"), and we'll keep it open.
We are sorry that we haven't been able to prioritize reviewing it yet. Your contribution is very much appreciated.
closeComment: >
Closing this pull request after a prolonged period of inactivity. If this issue is still present in the latest release, please ask for this pull request to be reopened. Thank you!
145 changes: 145 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
name: release

on:
push:
tags:
- v*.*.*

permissions:
contents: write
id-token: write

env:
PROVIDER: zia
DOTNETVERSION: |
6.0.x
3.1.301
GOVERSION: 1.21.x
JAVAVERSION: "11"
NODEVERSION: 20.x
PYTHONVERSION: "3.9"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }}
NUGET_FEED_URL: https://api.nuget.org/v3/index.json
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
PULUMI_API: https://api.pulumi.com
PULUMI_GO_DEP_ROOT: ${{ github.workspace }}/..
PULUMI_LOCAL_NUGET: ${{ github.workspace }}/nuget
PULUMI_TEST_OWNER: "zscaler"
PYPI_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
PYPI_USERNAME: __token__
PUBLISH_PYPI: true
PUBLISH_NPM: true
PUBLISH_NUGET: true
ZIA_USERNAME: ${{ secrets.ZIA_USERNAME }}
ZIA_PASSWORD: ${{ secrets.ZIA_PASSWORD }}
ZIA_API_KEY: ${{ secrets.ZIA_API_KEY }}
ZIA_CLOUD: ${{ secrets.ZIA_CLOUD }}
TRAVIS_OS_NAME: linux

jobs:
publish_binary:
name: publish
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/[email protected]
- name: Install Go
uses: actions/[email protected]
with:
go-version: ${{env.GOVERSION}}
- name: Install pulumictl
uses: jaxxstorm/[email protected]
with:
repo: pulumi/pulumictl
- name: Set PreRelease Version
run: echo "GORELEASER_CURRENT_TAG=v$(pulumictl get version --language generic)" >> $GITHUB_ENV
- name: Run GoReleaser
uses: goreleaser/[email protected]
with:
args: -p 3 release --rm-dist
version: latest
- name: Create tag
uses: actions/[email protected]
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/sdk/${{ github.ref_name }}',
sha: context.sha
})
strategy:
fail-fast: true

publish_sdk:
name: Publish SDKs
runs-on: ubuntu-latest
needs: publish_binary
steps:
- name: Checkout Repo
uses: actions/[email protected]
# - name: Unshallow clone for tags
# run: git fetch --prune --unshallow --tags
- name: Install Go
uses: actions/[email protected]
with:
go-version: ${{ env.GOVERSION }}
- name: Install pulumictl
uses: jaxxstorm/[email protected]
with:
repo: pulumi/pulumictl
- name: Install Pulumi CLI
uses: pulumi/actions@v4
- name: Setup Node
uses: actions/[email protected]
with:
node-version: ${{ env.NODEVERSION }}
- name: Setup DotNet
uses: actions/[email protected]
with:
dotnet-version: ${{ env.DOTNETVERSION }}
- name: Setup Python
uses: actions/[email protected]
with:
python-version: ${{ env.PYTHONVERSION }}
- name: Build SDK
run: make build_${{ matrix.language }}
# - name: Check worktree clean
# run: |
# git update-index -q --refresh
# if ! git diff-files --quiet; then
# >&2 echo "error: working tree is not clean, aborting!"
# git status
# git diff
# exit 1
# fi
- if: ${{ matrix.language == 'python' && env.PUBLISH_PYPI == 'true' }}
name: Publish package to PyPI
uses: pypa/[email protected]
with:
user: ${{ env.PYPI_USERNAME }}
password: ${{ env.PYPI_PASSWORD }}
packages_dir: ${{github.workspace}}/sdk/python/bin/dist
- if: ${{ matrix.language == 'nodejs' && env.PUBLISH_NPM == 'true' }}
uses: JS-DevTools/[email protected]
with:
access: "public"
token: ${{ env.NPM_TOKEN }}
package: ${{github.workspace}}/sdk/nodejs/bin/package.json
provenance: true
- if: ${{ matrix.language == 'dotnet' && env.PUBLISH_NUGET == 'true' }}
name: publish nuget package
run: |
dotnet nuget push ${{github.workspace}}/sdk/dotnet/bin/Debug/*.nupkg -s ${{ env.NUGET_FEED_URL }} -k ${{ env.NUGET_PUBLISH_KEY }}
echo "done publishing packages"
strategy:
fail-fast: true
matrix:
language:
- nodejs
- python
- dotnet
- go
20 changes: 20 additions & 0 deletions .github/workflows/upgrade.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Upgrade provider

on:
workflow_dispatch:
schedule:
- cron: 0 5 * * *

jobs:
upgrade_provider:
name: upgrade-provider
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
issues: write
steps:
- name: Call upgrade provider action
uses: pulumi/[email protected]
env:
GH_TOKEN: ${{ github.token }}
26 changes: 26 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.idea
.code
**/vendor/
.pulumi
**/bin/
**/obj/
Pulumi.*.yaml
**/node_modules/
.DS_Store

**/command-output/

.idea/
*.iml

yarn.lock
**/pulumiManifest.go

ci-scripts
provider/**/schema-embed.json
**/version.txt
**/nuget
**/dist
zia_all_together
local_dev
.trash
23 changes: 23 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
linters:
enable:
- deadcode
- errcheck
- goconst
- gofmt
- golint
- gosec
- govet
- ineffassign
- interfacer
- megacheck
- misspell
- nakedret
- structcheck
- unconvert
- varcheck
enable-all: false
run:
skip-files:
- schema.go
- pulumiManifest.go
timeout: 10m
Loading

0 comments on commit 219a961

Please sign in to comment.