Skip to content

Commit

Permalink
always use latest version in ado pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
colbylwilliams committed Jan 6, 2023
1 parent bcb5299 commit daab9bd
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 54 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Microsoft Azure CLI Extension for creating (or _"baking"_) custom virtual machin
To install the Azure CLI Custom Image Helper extension, simply run the following command:

```sh
az extension add --source https://github.com/colbylwilliams/az-bake/releases/latest/download/bake-0.3.6-py3-none-any.whl -y
az extension add --source https://github.com/colbylwilliams/az-bake/releases/latest/download/bake-0.3.7-py3-none-any.whl -y
```

### Update
Expand Down
70 changes: 37 additions & 33 deletions bake/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
Release History
===============

0.3.7
++++++
* Always use latest version of az bake in Azure DevOps pipelines

0.3.6
++++++
* Added az bake image bump
Expand All @@ -12,7 +16,7 @@ Release History
0.3.5
++++++
* Added az bake image bump
* Bug fixes and minor improvements.
* Bug fixes and minor improvements

0.3.4
++++++
Expand All @@ -28,23 +32,23 @@ Release History

0.3.1
++++++
* Bug fixes and minor improvements.
* Bug fixes and minor improvements

0.3.0
++++++
* Overhaul to use python dataclasses

0.2.9
++++++
* Bug fixes and minor improvements.
* Bug fixes and minor improvements

0.2.8
++++++
* Bug fixes and minor improvements.
* Bug fixes and minor improvements

0.2.7
++++++
* Bug fixes and minor improvements.
* Bug fixes and minor improvements

0.2.6
++++++
Expand All @@ -56,11 +60,11 @@ Release History

0.2.4
++++++
* Bug fixes and minor improvements.
* Bug fixes and minor improvements

0.2.3
++++++
* Bug fixes and minor improvements.
* Bug fixes and minor improvements

0.2.2
++++++
Expand All @@ -76,31 +80,31 @@ Release History

0.1.19
++++++
* Bug fixes and minor improvements.
* Bug fixes and minor improvements

0.1.18
++++++
* Add support for powershell scripts

0.1.17
++++++
* Bug fixes and minor improvements.
* Bug fixes and minor improvements

0.1.16
++++++
* Fix update inject bug

0.1.15
++++++
* Bug fixes and minor improvements.
* Bug fixes and minor improvements

0.1.14
++++++
* Bug fixes and minor improvements.
* Bug fixes and minor improvements

0.1.13
++++++
* Bug fixes and minor improvements.
* Bug fixes and minor improvements

0.1.12
++++++
Expand All @@ -118,19 +122,19 @@ Release History

0.1.9
++++++
* Bug fixes and minor improvements.
* Bug fixes and minor improvements

0.1.8
++++++
* Generate sandbox resource names in CLI

0.1.7
++++++
* Bug fixes and minor improvements.
* Bug fixes and minor improvements

0.1.6
++++++
* Bug fixes and minor improvements.
* Bug fixes and minor improvements

0.1.5
++++++
Expand All @@ -157,15 +161,15 @@ Release History

0.1.0
++++++
* Bug fixes and minor improvements.
* Bug fixes and minor improvements

0.0.35
++++++
* Bug fixes and minor improvements.
* Bug fixes and minor improvements

0.0.34
++++++
* Bug fixes and minor improvements.
* Bug fixes and minor improvements

0.0.33
++++++
Expand Down Expand Up @@ -242,63 +246,63 @@ Release History

0.0.16
++++++
* Bug fixes and minor improvements.
* Bug fixes and minor improvements

0.0.15
++++++
* Bug fixes and minor improvements.
* Bug fixes and minor improvements

0.0.14
++++++
* Bug fixes and minor improvements.
* Bug fixes and minor improvements

0.0.13
++++++
* Bug fixes and minor improvements.
* Bug fixes and minor improvements

0.0.12
++++++
* Bug fixes and minor improvements.
* Bug fixes and minor improvements

0.0.11
++++++
* Bug fixes and minor improvements.
* Bug fixes and minor improvements

0.0.10
++++++
* Bug fixes and minor improvements.
* Bug fixes and minor improvements

0.0.9
++++++
* Bug fixes and minor improvements.
* Bug fixes and minor improvements

0.0.8
++++++
* Bug fixes and minor improvements.
* Bug fixes and minor improvements

0.0.7
++++++
* Bug fixes and minor improvements.
* Bug fixes and minor improvements

0.0.6
++++++
* Bug fixes and minor improvements.
* Bug fixes and minor improvements

0.0.5
++++++
* Bug fixes and minor improvements.
* Bug fixes and minor improvements

0.0.4
++++++
* Bug fixes and minor improvements.
* Bug fixes and minor improvements

0.0.3
++++++
* Bug fixes and minor improvements.
* Bug fixes and minor improvements

0.0.2
++++++
* Bug fixes and minor improvements.
* Bug fixes and minor improvements

0.0.1
++++++
Expand Down
7 changes: 3 additions & 4 deletions bake/azext_bake/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,11 @@ def tag_key(key):
AZURE_CLIENT_SECRET: $(AZURE_CLIENT_SECRET)
AZURE_TENANT_ID: $(AZURE_TENANT_ID)
- script: az extension add --source https://github.com/colbylwilliams/az-bake/releases/latest/download/bake-0.3.6-py3-none-any.whl -y
- script: | # get the latest version of az bake from the github releases and install it
curl -L https://github.com/colbylwilliams/az-bake/releases/latest/download/index.json > $AGENT_TEMPDIRECTORY/index.json
az extension add --yes --source $(jq -r '.extensions.bake[0].downloadUrl' $AGENT_TEMPDIRECTORY/index.json)
displayName: Install az bake
- script: az bake upgrade
displayName: Update az bake
- script: az bake repo build --verbose --repo .
displayName: Run az bake
env:
Expand Down
2 changes: 1 addition & 1 deletion bake/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
logger.warn("Wheel is not available, disabling bdist_wheel hook")

# Must match a HISTORY.rst entry.
VERSION = '0.3.6'
VERSION = '0.3.7'

# The full list of classifiers is available at
# https://pypi.python.org/pypi?%3Aaction=list_classifiers
Expand Down
2 changes: 1 addition & 1 deletion builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ LABEL maintainer="Microsoft" \
RUN apk add --no-cache packer --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community

# install az-bake
RUN az extension add --source https://github.com/colbylwilliams/az-bake/releases/latest/download/bake-0.3.6-py3-none-any.whl -y
RUN az extension add --source https://github.com/colbylwilliams/az-bake/releases/latest/download/bake-0.3.7-py3-none-any.whl -y

# Terminate container on stop
STOPSIGNAL SIGTERM
Expand Down
28 changes: 14 additions & 14 deletions tools/bump-version.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
from pathlib import Path
from re import search

from packaging.version import parse # pylint: disable=unresolved-import
from packaging.version import parse as parse_version # pylint: disable=unresolved-import

parser = argparse.ArgumentParser()
parser.add_argument('--major', action='store_true', help='bump major version')
parser.add_argument('--minor', action='store_true', help='bump minor version')
parser.add_argument('--notes', nargs='*', default=['Bug fixes and minor improvements.'], help='space seperated strings with release notes')
parser.add_argument('--notes', nargs='*', default=['Bug fixes and minor improvements'], help='space seperated strings with release notes')

args = parser.parse_args()

Expand Down Expand Up @@ -43,21 +43,21 @@
if not version:
raise ValueError('no version found in setup.py')

version_old = parse(version)
version_old = parse_version(version)

n_major = version_old.major + 1 if major else version_old.major
n_minor = 0 if major else version_old.minor + 1 if minor else version_old.minor
n_patch = 0 if major or minor else version_old.micro + 1

version_new = parse('{}.{}.{}'.format(n_major, n_minor, n_patch))
version_new = parse_version(f'{n_major}.{n_minor}.{n_patch}')


print('bumping version: {} -> {}'.format(version_old.public, version_new.public))
print(f'bumping version: {version_old.public} -> {version_new.public}')

fmt_setup = 'VERSION = \'{}\''
fmt_readme = 'https://github.com/colbylwilliams/az-bake/releases/latest/download/bake-{}-py3-none-any.whl'
fmt_docker = 'https://github.com/colbylwilliams/az-bake/releases/latest/download/bake-{}-py3-none-any.whl'
fmt_consts = 'https://github.com/colbylwilliams/az-bake/releases/latest/download/bake-{}-py3-none-any.whl'
# fmt_consts = 'https://github.com/colbylwilliams/az-bake/releases/latest/download/bake-{}-py3-none-any.whl'
fmt_history = '{}\n++++++\n{}\n\n{}'


Expand Down Expand Up @@ -117,15 +117,15 @@
f.write(readme)


print('..updating _constants.py')
# print('..updating _constants.py')

with open(path_bake / 'azext_bake' / '_constants.py', 'r') as f:
constants = f.read()
# with open(path_bake / 'azext_bake' / '_constants.py', 'r') as f:
# constants = f.read()

if fmt_consts.format(version_old.public) not in constants:
raise ValueError('version string not found in _constants.py')
# if fmt_consts.format(version_old.public) not in constants:
# raise ValueError('version string not found in _constants.py')

constants = constants.replace(fmt_consts.format(version_old.public), fmt_consts.format(version_new.public))
# constants = constants.replace(fmt_consts.format(version_old.public), fmt_consts.format(version_new.public))

with open(path_bake / 'azext_bake' / '_constants.py', 'w') as f:
f.write(constants)
# with open(path_bake / 'azext_bake' / '_constants.py', 'w') as f:
# f.write(constants)

0 comments on commit daab9bd

Please sign in to comment.