Skip to content

Commit d101000

Browse files
committed
Add example for deploy with revision
that deploys juju-qa-test --channel 2.0/stable --revision 22
1 parent 3098a08 commit d101000

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

examples/deploywithrevision.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
from juju import jasyncio
2+
from juju.model import Model
3+
4+
5+
async def main():
6+
charm = 'juju-qa-test'
7+
8+
model = Model()
9+
print('Connecting to model')
10+
# connect to current model with current user, per Juju CLI
11+
await model.connect()
12+
13+
try:
14+
print(f'Deploying {charm} --channel 2.0/stable --revision 22')
15+
application = await model.deploy(
16+
'juju-qa-test',
17+
application_name='test',
18+
channel='2.0/stable',
19+
revision=22,
20+
)
21+
22+
print('Waiting for active')
23+
await model.wait_for_idle(status='active')
24+
25+
print(f'Removing {charm}')
26+
await application.remove()
27+
finally:
28+
print('Disconnecting from model')
29+
await model.disconnect()
30+
31+
32+
if __name__ == '__main__':
33+
jasyncio.run(main())

0 commit comments

Comments
 (0)