Skip to content

Commit

Permalink
Refactoring the ADO pipeline (#204)
Browse files Browse the repository at this point in the history
  • Loading branch information
magodo authored Aug 29, 2022
1 parent 9259577 commit 58a1ab3
Show file tree
Hide file tree
Showing 13 changed files with 882 additions and 59 deletions.
648 changes: 617 additions & 31 deletions azure-pipelines.yml

Large diffs are not rendered by default.

28 changes: 0 additions & 28 deletions scripts/build.sh

This file was deleted.

6 changes: 6 additions & 0 deletions scripts/package/linux/build/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM ubuntu:22.04
ARG version
RUN apt update && apt install -y ruby-dev build-essential squashfs-tools
RUN apt install -y rpm
RUN gem i fpm
CMD ["fpm", "--help"]
24 changes: 24 additions & 0 deletions scripts/package/linux/verify/centos-8.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
set -e

version=${1:?"version not specified"}

sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
rpm --import https://packages.microsoft.com/keys/microsoft.asc
dnf install -y https://packages.microsoft.com/config/centos/8/packages-microsoft-prod.rpm

total=60
count=1
while ((count <= total)); do
echo "Try ($count/$total)"
# See: https://access.redhat.com/solutions/2779441
dnf check-update --refresh || [[ $? == 100 ]]
dnf install -y aztfy && break

sleep 1m
((count++))
done
(( count <= total ))

grep $version <(aztfy -v)
23 changes: 23 additions & 0 deletions scripts/package/linux/verify/debian-bullseye.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
set -e

version=${1:?"version not specified"}

apt-get update
apt-get install -y curl software-properties-common gpg
curl -sSL https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
apt-add-repository https://packages.microsoft.com/debian/11/prod

total=60
count=1
while ((count <= total)); do
echo "Try ($count/$total)"
apt-get update
apt-get install -y aztfy && break

sleep 1m
((count++))
done
(( count <= total ))

grep $version <(aztfy -v)
23 changes: 23 additions & 0 deletions scripts/package/linux/verify/debian-buster.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
set -e

version=${1:?"version not specified"}

apt-get update
apt-get install -y curl software-properties-common gpg
curl -sSL https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
apt-add-repository https://packages.microsoft.com/debian/10/prod

total=60
count=1
while ((count <= total)); do
echo "Try ($count/$total)"
apt-get update
apt-get install -y aztfy && break

sleep 1m
((count++))
done
(( count <= total ))

grep $version <(aztfy -v)
26 changes: 26 additions & 0 deletions scripts/package/linux/verify/fedora-34.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
set -e

version=${1:?"version not specified"}

rpm --import https://packages.microsoft.com/keys/microsoft.asc

# To accelarate syncing the repo metadatas
rm -f /etc/yum.repos.d/*

dnf install -y https://packages.microsoft.com/config/fedora/34/packages-microsoft-prod.rpm

total=60
count=1
while ((count <= total)); do
echo "Try ($count/$total)"
# See: https://access.redhat.com/solutions/2779441
dnf check-update --refresh || [[ $? == 100 ]]
dnf install -y aztfy && break

sleep 1m
((count++))
done
(( count <= total ))

grep $version <(aztfy -v)
26 changes: 26 additions & 0 deletions scripts/package/linux/verify/fedora-35.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
set -e

version=${1:?"version not specified"}

rpm --import https://packages.microsoft.com/keys/microsoft.asc

# To accelarate syncing the repo metadatas
rm -f /etc/yum.repos.d/*

dnf install -y https://packages.microsoft.com/config/fedora/35/packages-microsoft-prod.rpm

total=60
count=1
while ((count <= total)); do
echo "Try ($count/$total)"
# See: https://access.redhat.com/solutions/2779441
dnf check-update --refresh || [[ $? == 100 ]]
dnf install -y aztfy && break

sleep 1m
((count++))
done
(( count <= total ))

grep $version <(aztfy -v)
26 changes: 26 additions & 0 deletions scripts/package/linux/verify/fedora-36.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
set -e

version=${1:?"version not specified"}

rpm --import https://packages.microsoft.com/keys/microsoft.asc

# To accelarate syncing the repo metadatas
rm -f /etc/yum.repos.d/*

dnf install -y https://packages.microsoft.com/config/fedora/36/packages-microsoft-prod.rpm

total=60
count=1
while ((count <= total)); do
echo "Try ($count/$total)"
# See: https://access.redhat.com/solutions/2779441
dnf check-update --refresh || [[ $? == 100 ]]
dnf install -y aztfy && break

sleep 1m
((count++))
done
(( count <= total ))

grep $version <(aztfy -v)
23 changes: 23 additions & 0 deletions scripts/package/linux/verify/ubuntu-bionic.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
set -e

version=${1:?"version not specified"}

apt-get update
apt-get install -y curl software-properties-common gpg
curl -sSL https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
apt-add-repository https://packages.microsoft.com/ubuntu/18.04/multiarch/prod

total=60
count=1
while ((count <= total)); do
echo "Try ($count/$total)"
apt-get update
apt-get install -y aztfy && break

sleep 1m
((count++))
done
(( count <= total ))

grep $version <(aztfy -v)
23 changes: 23 additions & 0 deletions scripts/package/linux/verify/ubuntu-focal.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
set -e

version=${1:?"version not specified"}

apt-get update
apt-get install -y curl software-properties-common gpg
curl -sSL https://packages.microsoft.com/keys/microsoft.asc > /etc/apt/trusted.gpg.d/microsoft.asc
apt-add-repository https://packages.microsoft.com/ubuntu/20.04/prod

total=60
count=1
while ((count <= total)); do
echo "Try ($count/$total)"
apt-get update
apt-get install -y aztfy && break

sleep 1m
((count++))
done
(( count <= total ))

grep $version <(aztfy -v)
22 changes: 22 additions & 0 deletions scripts/package/linux/verify/ubuntu-jammy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
set -e

version=${1:?"version not specified"}

apt-get update
apt-get install -y curl software-properties-common gpg
curl -sSL https://packages.microsoft.com/keys/microsoft.asc > /etc/apt/trusted.gpg.d/microsoft.asc
apt-add-repository https://packages.microsoft.com/ubuntu/22.04/prod

total=60
count=1
while ((count <= total)); do
echo "Try ($count/$total)"
apt-get update
apt-get install -y aztfy && break

sleep 1m
((count++))
done

grep $version <(aztfy -v)
43 changes: 43 additions & 0 deletions scripts/package/windows/build/setup.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<Wix xmlns="http://schemas.microsoft.com/wix/2007/wi">

<?if $(sys.BUILDARCH) = x64 ?>
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
<?else ?>
<?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
<?endif ?>

<Product Id="*" Name="aztfy" Language="1033" Version="$(env.VERSION)" Manufacturer="Microsoft" UpgradeCode="64fec5fc-2cad-4ec0-95ed-bdf283f6f36d">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />

<MajorUpgrade DowngradeErrorMessage="A newer version of aztfy is already installed." />
<MediaTemplate EmbedCab="yes" />

<Feature Id="ProductFeature" Title="aztfy" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
</Product>

<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="$(var.PlatformProgramFilesFolder)">
<Directory Id="INSTALLFOLDER" Name="aztfy" />
</Directory>
</Directory>
</Fragment>

<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="ProductComponent">
<File Id="FILE_aztfyEXE" Source="aztfy.exe" KeyPath="yes" />
<Environment
Id = "EnvPath"
Action = "set"
Name = "PATH"
Value = "[INSTALLFOLDER]"
Part = "last"
Permanent = "no"
System = "no" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>

0 comments on commit 58a1ab3

Please sign in to comment.