Skip to content

Commit 11303d1

Browse files
TravisEz13AndrewRDIL
authored
Merge 7.0.0 release changes (PowerShell#382)
Co-authored-by: Andrew <anmenaga@microsoft.com> Co-authored-by: Reece Dunham <me@rdil.rocks>
1 parent fdaef2d commit 11303d1

86 files changed

Lines changed: 1336 additions & 224 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dependabot/config.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,40 +5,44 @@ version: 1
55
update_configs:
66
- package_manager: "docker"
77
directory: "/release/preview/alpine39/dependabot"
8-
update_schedule: "daily"
8+
update_schedule: "weekly"
9+
10+
- package_manager: "docker"
11+
directory: "/release/preview/alpine311/dependabot"
12+
update_schedule: "weekly"
913

1014
- package_manager: "docker"
1115
directory: "/release/preview/centos8/dependabot"
12-
update_schedule: "daily"
16+
update_schedule: "weekly"
1317

1418
- package_manager: "docker"
1519
directory: "/release/preview/debian10/dependabot"
16-
update_schedule: "daily"
20+
update_schedule: "weekly"
1721

1822
- package_manager: "docker"
1923
directory: "/release/preview/debian11/dependabot"
20-
update_schedule: "daily"
24+
update_schedule: "weekly"
2125

2226
- package_manager: "docker"
2327
directory: "/release/preview/fedora/dependabot"
24-
update_schedule: "daily"
28+
update_schedule: "weekly"
2529

2630
- package_manager: "docker"
2731
directory: "/release/preview/nanoserver1809/dependabot"
28-
update_schedule: "daily"
32+
update_schedule: "weekly"
2933

3034
- package_manager: "docker"
3135
directory: "/release/preview/opensuse423/dependabot"
32-
update_schedule: "daily"
36+
update_schedule: "weekly"
3337

3438
- package_manager: "docker"
3539
directory: "/release/preview/ubuntu18.04/dependabot"
36-
update_schedule: "daily"
40+
update_schedule: "weekly"
3741

3842
- package_manager: "docker"
3943
directory: "/release/preview/windowsservercore/dependabot"
40-
update_schedule: "daily"
44+
update_schedule: "weekly"
4145

4246
- package_manager: "docker"
4347
directory: "/release/preview/alpine38/dependabot"
44-
update_schedule: "daily"
48+
update_schedule: "weekly"

.vsts-ci/releasebuild.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ stages:
8080
displayName: 'Install Pester'
8181

8282
- powershell: |
83-
$yaml = ./build.ps1 -GenerateTagsYaml -Channel stable, preview -StableVersion $(StableVersion) -PreviewVersion $(PreviewVersion) -LtsVersion $(LtsVersion)
83+
$yaml = ./build.ps1 -GenerateTagsYaml -Channel stable, preview, lts -StableVersion $(StableVersion) -PreviewVersion $(PreviewVersion) -LtsVersion $(LtsVersion)
8484
$yaml | Out-File -Encoding ascii -Path ./tagsmetadata.yaml
8585
Get-ChildItem -Path ./tagsmetadata.yaml | Select-Object -ExpandProperty FullName | ForEach-Object {
8686
Write-Host "##vso[artifact.upload containerfolder=artifacts;artifactname=artifacts]$_"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
3+
4+
# Dummy docker image to trigger dependabot PRs
5+
6+
FROM alpine:3.11.3
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
3+
4+
# Docker image file that describes an Alpine3.11 image with PowerShell installed from .tar.gz file(s)
5+
6+
# Define arg(s) needed for the From statement
7+
ARG fromTag=3.11
8+
ARG imageRepo=alpine
9+
10+
FROM ${imageRepo}:${fromTag} AS installer-env
11+
12+
# Define Args for the needed to add the package
13+
ARG PS_VERSION=7.0.0-preview.1
14+
ARG PS_PACKAGE=powershell-${PS_VERSION}-linux-alpine-x64.tar.gz
15+
ARG PS_PACKAGE_URL=https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/${PS_PACKAGE}
16+
ARG PS_INSTALL_VERSION=7-preview
17+
18+
# Download the Linux tar.gz and save it
19+
ADD ${PS_PACKAGE_URL} /tmp/linux.tar.gz
20+
21+
# define the folder we will be installing PowerShell to
22+
ENV PS_INSTALL_FOLDER=/opt/microsoft/powershell/$PS_INSTALL_VERSION
23+
24+
# Create the install folder
25+
RUN mkdir -p ${PS_INSTALL_FOLDER}
26+
27+
# Unzip the Linux tar.gz
28+
RUN tar zxf /tmp/linux.tar.gz -C ${PS_INSTALL_FOLDER} -v
29+
30+
# Start a new stage so we lose all the tar.gz layers from the final image
31+
FROM ${imageRepo}:${fromTag}
32+
33+
ARG fromTag=3.11
34+
35+
# Copy only the files we need from the previous stage
36+
COPY --from=installer-env ["/opt/microsoft/powershell", "/opt/microsoft/powershell"]
37+
38+
# Define Args and Env needed to create links
39+
ARG PS_INSTALL_VERSION=7-preview
40+
ENV PS_INSTALL_FOLDER=/opt/microsoft/powershell/$PS_INSTALL_VERSION \
41+
\
42+
# Define ENVs for Localization/Globalization
43+
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
44+
LC_ALL=en_US.UTF-8 \
45+
LANG=en_US.UTF-8 \
46+
# set a fixed location for the Module analysis cache
47+
PSModuleAnalysisCachePath=/var/cache/microsoft/powershell/PSModuleAnalysisCache/ModuleAnalysisCache \
48+
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-Alpine-${fromTag}
49+
50+
# Install dotnet dependencies and ca-certificates
51+
RUN apk add --no-cache \
52+
ca-certificates \
53+
less \
54+
\
55+
# PSReadline/console dependencies
56+
ncurses-terminfo-base \
57+
\
58+
# .NET Core dependencies
59+
krb5-libs \
60+
libgcc \
61+
libintl \
62+
libssl1.1 \
63+
libstdc++ \
64+
tzdata \
65+
userspace-rcu \
66+
zlib \
67+
icu-libs \
68+
&& apk -X https://dl-cdn.alpinelinux.org/alpine/edge/main add --no-cache \
69+
lttng-ust \
70+
\
71+
# Create the pwsh symbolic link that points to powershell
72+
&& ln -s ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh \
73+
\
74+
# Create the pwsh-preview symbolic link that points to powershell
75+
&& ln -s ${PS_INSTALL_FOLDER}/pwsh /usr/bin/pwsh-preview \
76+
# Give all user execute permissions and remove write permissions for others
77+
&& chmod a+x,o-w ${PS_INSTALL_FOLDER}/pwsh \
78+
# intialize powershell module cache
79+
&& pwsh \
80+
-NoLogo \
81+
-NoProfile \
82+
-Command " \
83+
\$ErrorActionPreference = 'Stop' ; \
84+
\$ProgressPreference = 'SilentlyContinue' ; \
85+
while(!(Test-Path -Path \$env:PSModuleAnalysisCachePath)) { \
86+
Write-Host "'Waiting for $env:PSModuleAnalysisCachePath'" ; \
87+
Start-Sleep -Seconds 6 ; \
88+
}"
89+
90+
# Define args needed only for the labels
91+
ARG PS_VERSION=7.0.0-preview.1
92+
ARG IMAGE_NAME=mcr.microsoft.com/powershell:preview-alpine-3.11
93+
ARG VCS_REF="none"
94+
95+
# Add label last as it's just metadata and uses a lot of parameters
96+
LABEL maintainer="PowerShell Team <powershellteam@hotmail.com>" \
97+
readme.md="https://github.com/PowerShell/PowerShell/blob/master/docker/README.md" \
98+
description="This Dockerfile will install the latest release of PowerShell." \
99+
org.label-schema.usage="https://github.com/PowerShell/PowerShell/tree/master/docker#run-the-docker-image-you-built" \
100+
org.label-schema.url="https://github.com/PowerShell/PowerShell/blob/master/docker/README.md" \
101+
org.label-schema.vcs-url="https://github.com/PowerShell/PowerShell-Docker" \
102+
org.label-schema.name="powershell" \
103+
org.label-schema.vendor="PowerShell" \
104+
org.label-schema.vcs-ref=${VCS_REF} \
105+
org.label-schema.version=${PS_VERSION} \
106+
org.label-schema.schema-version="1.0" \
107+
org.label-schema.docker.cmd="docker run ${IMAGE_NAME} pwsh -c '$psversiontable'" \
108+
org.label-schema.docker.cmd.devel="docker run ${IMAGE_NAME}" \
109+
org.label-schema.docker.cmd.test="docker run ${IMAGE_NAME} pwsh -c Invoke-Pester" \
110+
org.label-schema.docker.cmd.help="docker run ${IMAGE_NAME} pwsh -c Get-Help"
111+
112+
CMD [ "pwsh" ]
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
3+
4+
# return objects representing the tags we need to base the Alpine image on
5+
6+
# The versions of Alpine we care about, for this dockerfile
7+
$shortTags = @('3.11')
8+
9+
$parent = Join-Path -Path $PSScriptRoot -ChildPath '..'
10+
$repoRoot = Join-Path -path (Join-Path -Path $parent -ChildPath '..') -ChildPath '..'
11+
$modulePath = Join-Path -Path $repoRoot -ChildPath 'tools\getDockerTags'
12+
Import-Module $modulePath
13+
14+
Get-DockerTags -ShortTags $shortTags -Image "alpine" -FullTagFilter '^3.\d\d?$' -OnlyShortTags
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"IsLinux" : true,
3+
"UseLinuxVersion": false,
4+
"PackageFormat": "powershell-${PS_VERSION}-linux-alpine-x64.tar.gz",
5+
"osVersion": "Alpine",
6+
"tagTemplates": [
7+
"#psversion#-alpine-#tag#",
8+
"preview-alpine-#shorttag#"
9+
],
10+
"SkipGssNtlmSspTests": true,
11+
"SubImage": "test-deps",
12+
"TestProperties": {
13+
"size": 165
14+
}
15+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Docker image file that describes an Alpine image with PowerShell and test dependencies
2+
3+
ARG BaseImage=mcr.microsoft.com/powershell:alpine-3.11
4+
5+
FROM node:10.18.1-alpine as node
6+
7+
# Do nothing, just added to borrow the already built node files.
8+
9+
FROM ${BaseImage}
10+
11+
ARG fromTag=3.11
12+
13+
ENV NODE_VERSION=10.18.1 \
14+
YARN_VERSION=1.21.1 \
15+
NVM_DIR="/root/.nvm" \
16+
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-TestDeps-Alpine-${fromTag}
17+
18+
# workaround for Alpine to run in Azure DevOps
19+
ENV NODE_NO_WARNINGS=1
20+
21+
# Copy node and yarn into image
22+
COPY --from=node /usr/local/bin/node /usr/local/bin/node
23+
COPY --from=node /opt/yarn-v${YARN_VERSION} /opt/yarn-v${YARN_VERSION}
24+
25+
RUN apk add --no-cache --virtual .pipeline-deps readline linux-pam \
26+
&& apk add \
27+
bash \
28+
sudo \
29+
shadow \
30+
openssl \
31+
curl \
32+
&& apk del .pipeline-deps \
33+
&& ln -s /opt/yarn-v$YARN_VERSION/bin/yarn /usr/local/bin/yarn \
34+
&& ln -s /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg
35+
36+
# Define args needed only for the labels
37+
ARG VCS_REF="none"
38+
ARG IMAGE_NAME=mcr.microsoft.com/powershell/test-deps:alpine-3.11
39+
ARG PS_VERSION=6.2.3
40+
41+
LABEL maintainer="PowerShell Team <powershellteam@hotmail.com>" \
42+
readme.md="https://github.com/PowerShell/PowerShell/blob/master/docker/README.md" \
43+
description="This Dockerfile will install the latest release of PowerShell and tools needed for runing CI/CD container jobs." \
44+
org.label-schema.usage="https://github.com/PowerShell/PowerShell/tree/master/docker#run-the-docker-image-you-built" \
45+
org.label-schema.url="https://github.com/PowerShell/PowerShell/blob/master/docker/README.md" \
46+
org.label-schema.vcs-url="https://github.com/PowerShell/PowerShell-Docker" \
47+
org.label-schema.name="powershell" \
48+
org.label-schema.vendor="PowerShell" \
49+
org.label-schema.version=${PS_VERSION} \
50+
org.label-schema.schema-version="1.0" \
51+
org.label-schema.vcs-ref=${VCS_REF} \
52+
org.label-schema.docker.cmd="docker run ${IMAGE_NAME} pwsh -c '$psversiontable'" \
53+
org.label-schema.docker.cmd.devel="docker run ${IMAGE_NAME}" \
54+
org.label-schema.docker.cmd.test="docker run ${IMAGE_NAME} pwsh -c Invoke-Pester" \
55+
org.label-schema.docker.cmd.help="docker run ${IMAGE_NAME} pwsh -c Get-Help" \
56+
com.azure.dev.pipelines.agent.handler.node.path="/usr/local/bin/node"
57+
58+
# Use PowerShell as the default shell
59+
# Use array to avoid Docker prepending /bin/sh -c
60+
CMD [ "pwsh" ]
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"IsLinux" : true,
3+
"UseLinuxVersion": false,
4+
"SkipGssNtlmSspTests": true,
5+
"osVersion": "Alpine ${fromTag}",
6+
"tagTemplates": [
7+
"#tag#"
8+
],
9+
"OptionalTests": [
10+
"test-deps",
11+
"test-deps-musl"
12+
],
13+
"TestProperties": {
14+
"size": 212
15+
},
16+
"TagMapping": {
17+
"^.*-alpine-3.11$" : "preview-alpine-3.11"
18+
}
19+
}

release/preview/alpine38/test-deps/docker/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
ARG BaseImage=mcr.microsoft.com/powershell:alpine-3.8
44

5-
FROM node:10.15.3-alpine as node
5+
FROM node:10.18.1-alpine as node
66

77
# Do nothing, just added to borrow the already built node files.
88

99
FROM ${BaseImage}
1010

11-
ENV NODE_VERSION=10.15.3 \
12-
YARN_VERSION=1.13.0 \
11+
ENV NODE_VERSION=10.18.1 \
12+
YARN_VERSION=1.21.1 \
1313
NVM_DIR="/root/.nvm" \
1414
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-TestDeps-Alpine-3.8
1515

release/preview/alpine39/test-deps/docker/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
ARG BaseImage=mcr.microsoft.com/powershell:alpine-3.9
44

5-
FROM node:10.15.3-alpine as node
5+
FROM node:10.18.1-alpine as node
66

77
# Do nothing, just added to borrow the already built node files.
88

99
FROM ${BaseImage}
1010

1111
ARG fromTag=3.9
1212

13-
ENV NODE_VERSION=10.15.3 \
14-
YARN_VERSION=1.13.0 \
13+
ENV NODE_VERSION=10.18.1 \
14+
YARN_VERSION=1.21.1 \
1515
NVM_DIR="/root/.nvm" \
1616
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-TestDeps-Alpine-${fromTag}
1717

0 commit comments

Comments
 (0)