-
Notifications
You must be signed in to change notification settings - Fork 360
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2070 from pnp/dev
Release 1.11.0
- Loading branch information
Showing
562 changed files
with
11,290 additions
and
2,927 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Release to Docker Hub | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '30 3 * * *' | ||
jobs: | ||
publish-docker-windows-2022: | ||
runs-on: windows-2022 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Build and Publish All | ||
shell: pwsh | ||
run: | | ||
$securedPassword = ConvertTo-SecureString "${{ secrets.DOCKER_PASSWORD }}" -AsPlainText -Force | ||
./docker/Publish-UnpublishedImage.ps1 PnP.PowerShell ${{ secrets.DOCKER_USERNAME }} ${{ secrets.DOCKER_ORG }} powershell $securedPassword "ContainerAdministrator" $true "nanoserver-ltsc2022" | ||
publish-docker-windows-2019: | ||
runs-on: windows-2019 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Build and Publish All | ||
shell: pwsh | ||
run: | | ||
$securedPassword = ConvertTo-SecureString "${{ secrets.DOCKER_PASSWORD }}" -AsPlainText -Force | ||
./docker/Publish-UnpublishedImage.ps1 PnP.PowerShell ${{ secrets.DOCKER_USERNAME }} ${{ secrets.DOCKER_ORG }} powershell $securedPassword "ContainerAdministrator" $true "nanoserver-1809" | ||
publish-docker-linux: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Build and Publish All | ||
shell: pwsh | ||
run: | | ||
$securedPassword = ConvertTo-SecureString "${{ secrets.DOCKER_PASSWORD }}" -AsPlainText -Force | ||
./docker/Publish-UnpublishedImage.ps1 PnP.PowerShell ${{ secrets.DOCKER_USERNAME }} ${{ secrets.DOCKER_ORG }} powershell $securedPassword "root" $false "alpine-3.14" |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
Param( | ||
[Parameter(Position = 0, | ||
Mandatory = $true, | ||
ValueFromPipeline = $false)] | ||
[String] | ||
$PS_MODULE_NAME, | ||
[Parameter(Position = 1, | ||
Mandatory = $true, | ||
ValueFromPipeline = $false)] | ||
[String] | ||
$DOCKER_USERNAME, | ||
[Parameter(Position = 2, | ||
Mandatory = $true, | ||
ValueFromPipeline = $false)] | ||
[String] | ||
$DOCKER_ORG, | ||
[Parameter(Position = 3, | ||
Mandatory = $true, | ||
ValueFromPipeline = $false)] | ||
[String] | ||
$DOCKER_IMAGE_NAME, | ||
[Parameter(Position = 4, | ||
Mandatory = $true, | ||
ValueFromPipeline = $false)] | ||
[Security.SecureString] | ||
$DOCKER_PASSWORD, | ||
[Parameter(Position = 5, | ||
Mandatory = $false, | ||
ValueFromPipeline = $false)] | ||
[String] | ||
$DOCKER_INSTALL_USER = "ContainerAdministrator", | ||
[Parameter(Position = 6, | ||
Mandatory = $false, | ||
ValueFromPipeline = $false)] | ||
[bool] | ||
$SKIP_PUBLISHER_CHECK = $false, | ||
[Parameter(Position = 7, | ||
Mandatory = $false, | ||
ValueFromPipeline = $false)] | ||
[String] | ||
$DOCKER_IMAGE_SUFFIX_ARRAY = "nanoserver-ltsc2022" | ||
) | ||
$publishedImageVersions = (Invoke-RestMethod https://registry.hub.docker.com/v2/repositories/$DOCKER_ORG/$DOCKER_IMAGE_NAME/tags?page_size=10240).results | % { | ||
$_.name | ||
} | ||
$moduleVersions = Find-Module $PS_MODULE_NAME -AllVersions; | ||
[array]::Reverse($moduleVersions); | ||
$moduleVersions | % { | ||
$moduleVersion = $_.Version; | ||
$DOCKER_IMAGE_SUFFIX_ARRAY.Split( "," ) | % { | ||
$baseImageSuffix = $_; | ||
$imageVersion = "$moduleVersion-$baseImageSuffix"; | ||
Write-Host "Checking $imageVersion" | ||
if ( !( $publishedImageVersions -contains $imageVersion ) ) { | ||
docker build --build-arg "PNP_MODULE_VERSION=$moduleVersion" --build-arg "BASE_IMAGE_SUFFIX=$baseImageSuffix" --build-arg "INSTALL_USER=$DOCKER_INSTALL_USER" --build-arg "SKIP_PUBLISHER_CHECK=$SKIP_PUBLISHER_CHECK" ./docker -f ./docker/pnppowershell.dockerFile --tag $DOCKER_ORG/$DOCKER_IMAGE_NAME`:$imageVersion; | ||
$plainStringPassword = [System.Net.NetworkCredential]::new("", $DOCKER_PASSWORD).Password; | ||
docker login -u $DOCKER_USERNAME -p "$plainStringPassword"; | ||
docker push $DOCKER_ORG/$DOCKER_IMAGE_NAME`:$imageVersion; | ||
if ( $baseImageSuffix -eq "alpine-3.14") { | ||
docker image tag $DOCKER_ORG/$DOCKER_IMAGE_NAME`:$imageVersion $DOCKER_ORG/$DOCKER_IMAGE_NAME`:latest; | ||
docker push $DOCKER_ORG/$DOCKER_IMAGE_NAME`:latest; | ||
} | ||
} | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Publish manually in Windows | ||
|
||
1. Set `DOCKER_USERNAME`, `DOCKER_ORG` and `DOCKER_PASSWORD` variables | ||
|
||
2. Run | ||
|
||
```powershell | ||
$securedPassword = ConvertTo-SecureString $DOCKER_PASSWORD -AsPlainText -Force | ||
./docker/Publish-UnpublishedImage.ps1 PnP.PowerShell $DOCKER_USERNAME $DOCKER_ORG powershell $securedPassword "ContainerAdministrator" $true "nanoserver-1809" | ||
``` | ||
|
||
# Publish manually in Linux | ||
|
||
1. Set `DOCKER_USERNAME`, `DOCKER_ORG` and `DOCKER_PASSWORD` variables | ||
|
||
2. Run | ||
|
||
```powershell | ||
$securedPassword = ConvertTo-SecureString $DOCKER_PASSWORD -AsPlainText -Force | ||
./docker/Publish-UnpublishedImage.ps1 PnP.PowerShell $DOCKER_USERNAME $DOCKER_ORG powershell $securedPassword $false "root" "alpine-3.14" | ||
``` | ||
|
||
# Publish with prereleases manually in Windows | ||
|
||
1. Set `DOCKER_USERNAME`, `DOCKER_ORG` and `DOCKER_PASSWORD` variables | ||
|
||
2. Run | ||
|
||
```PowerShell | ||
$VERSION="$(cat ./version.txt)-nightly" | ||
docker build --build-arg "PNP_MODULE_VERSION=$VERSION" --build-arg "BASE_IMAGE_SUFFIX=nanoserver-ltsc2022" --build-arg "INSTALL_USER=ContainerAdministrator" --build-arg "SKIP_PUBLISHER_CHECK=True" ./docker -f ./docker/pnppowershell.dockerFile --tag "$DOCKER_ORG/powershell:$VERSION-nanoserver-ltsc2022"; | ||
$VERSION="$(cat ./version.txt)-nightly" | ||
docker login -u $DOCKER_USERNAME -p "$DOCKER_PASSWORD" | ||
docker push "$DOCKER_ORG/powershell:$VERSION-nanoserver-ltsc2022" | ||
``` | ||
|
||
or | ||
|
||
```PowerShell | ||
$VERSION="$(cat ./version.txt)-nightly" | ||
docker build --build-arg "PNP_MODULE_VERSION=$VERSION" --build-arg "BASE_IMAGE_SUFFIX=nanoserver-1809" --build-arg "INSTALL_USER=ContainerAdministrator" --build-arg "SKIP_PUBLISHER_CHECK=True" ./docker -f ./docker/pnppowershell.dockerFile --tag "$DOCKER_ORG/powershell:$VERSION-nanoserver-1809"; | ||
$VERSION="$(cat ./version.txt)-nightly" | ||
docker login -u $DOCKER_USERNAME -p "$DOCKER_PASSWORD" | ||
docker push "$DOCKER_ORG/powershell:$VERSION-nanoserver-1809" | ||
``` | ||
|
||
# Publish with prereleases manually in Linux | ||
|
||
1. Set `DOCKER_USERNAME`, `DOCKER_ORG` and `DOCKER_PASSWORD` variables | ||
|
||
2. Run | ||
|
||
```bash | ||
VERSION=$(cat ./version.txt)-nightly | ||
docker build --build-arg "PNP_MODULE_VERSION=$VERSION" --build-arg "BASE_IMAGE_SUFFIX=alpine-3.14" --build-arg "INSTALL_USER=root" --build-arg "SKIP_PUBLISHER_CHECK=False" ./docker -f ./docker/pnppowershell.dockerFile --tag $DOCKER_ORG/powershell:$VERSION-alpine-3.14; | ||
docker image tag $DOCKER_ORG/powershell:$VERSION-alpine-3.14 $DOCKER_ORG/powershell:nightly | ||
docker login -u $DOCKER_USERNAME -p "$DOCKER_PASSWORD" | ||
docker push $DOCKER_ORG/powershell:$VERSION-alpine-3.14 | ||
docker push $DOCKER_ORG/powershell:nightly | ||
``` | ||
|
||
# Publish automatically with Github Actions | ||
|
||
Set `DOCKER_USERNAME`, `DOCKER_ORG` and `DOCKER_PASSWORD` variables in Github Actions Secrets |
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# PnP.Powershell | ||
|
||
## Featured tags | ||
|
||
### Latest | ||
|
||
* latest: The latest stable image | ||
|
||
* alpine-3.14 | ||
* `docker pull m365pnp/powershell` or `docker pull m365pnp/powershell:latest` | ||
|
||
### Nightly | ||
|
||
* nightly: The latest night image | ||
|
||
* alpine-3.14 | ||
* `docker pull m365pnp/powershell:nightly` | ||
|
||
## About this image | ||
|
||
**PnP PowerShell** is a .NET Core 3.1 / .NET Framework 4.6.1 based PowerShell Module providing over 600 cmdlets that work with Microsoft 365 environments such as SharePoint Online, Microsoft Teams, Microsoft Project, Security & Compliance, Azure Active Directory, and more. | ||
|
||
## Usage examples | ||
|
||
### Windows-container | ||
|
||
Starting an isolated container with PnP.PowerShell module installed: | ||
|
||
``` | ||
docker run --rm -it m365pnp/powershell:1.10.0-nanoserver-1809 | ||
``` | ||
|
||
Starting a PnP.PowerShell container with the current directory mounted: | ||
|
||
```PowerShell | ||
docker run --rm -it -v ${PWD}:c:/app -w c:/app m365pnp/powershell:1.10.0-nanoserver-1809 | ||
``` | ||
|
||
### Linux-container | ||
|
||
Starting an isolated container with PnP.PowerShell module installed: | ||
|
||
``` | ||
docker run --rm -it m365pnp/powershell | ||
``` | ||
|
||
Starting a PnP.PowerShell container with the current directory mounted: | ||
|
||
```bash | ||
docker run --rm -it -v ${PWD}:/home -w /home m365pnp/powershell | ||
``` | ||
|
||
## Tag explanation | ||
|
||
Tags names mean the following: | ||
|
||
`<version>(-nightly)-<platform>` | ||
|
||
Currently supported platforms: | ||
|
||
* nanoserver-ltsc2022 | ||
* nanoserver-1809 | ||
* alpine-3.14 | ||
|
||
Tag name examples: | ||
|
||
* 1.8.0-nanoserver-ltsc2022 | ||
* 1.9.0-nanoserver-ltsc2022 | ||
* 1.10.0-nanoserver-1809 | ||
* 1.10.0-alpine-3.14 | ||
* 1.10.26-nightly-nanoserver-ltsc2022 | ||
|
||
To find the version numbers please visit https://www.powershellgallery.com/packages/PnP.PowerShell | ||
|
||
## Feedback | ||
|
||
* To give feedback for PnP.PowerShell or for how the images are built, file an issue at [PnP/PowerShell](https://github.com/pnp/powershell/issues/new/choose) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,15 @@ | ||
FROM mcr.microsoft.com/powershell:lts-debian-10 | ||
COPY ./powershell/ powershell | ||
RUN /usr/bin/pwsh -File ./powershell/installModules.ps1 && rm -rf ./powershell | ||
ARG BASE_IMAGE_SUFFIX=alpine-3.14 | ||
ARG BASE_IMAGE=mcr.microsoft.com/powershell:lts-7.2-$BASE_IMAGE_SUFFIX | ||
FROM $BASE_IMAGE | ||
|
||
SHELL ["pwsh", "-command"] | ||
ARG INSTALL_USER=ContainerAdministrator | ||
USER $INSTALL_USER | ||
ARG PNP_MODULE_VERSION | ||
ARG SKIP_PUBLISHER_CHECK=TRUE | ||
RUN if ( $env:SKIP_PUBLISHER_CHECK -eq $true ) { \ | ||
Write-Host "SKIP_PUBLISHER_CHECK"; \ | ||
Install-Module -Name PnP.PowerShell -RequiredVersion $env:PNP_MODULE_VERSION -Force -AllowPrerelease -Scope AllUsers -SkipPublisherCheck; \ | ||
} else { \ | ||
Install-Module -Name PnP.PowerShell -RequiredVersion $env:PNP_MODULE_VERSION -Force -AllowPrerelease -Scope AllUsers; \ | ||
} |
Oops, something went wrong.