-
Notifications
You must be signed in to change notification settings - Fork 5
/
debootstrap_architecture_template.yml
67 lines (52 loc) · 1.51 KB
/
debootstrap_architecture_template.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
jobs:
- job: startAgent
pool:
vmImage: ubuntu-latest
variables:
AWS_INSTANCE_ID: ${{ parameters.aws_instance_id }}
steps:
- task: DownloadSecureFile@1
name: awsCredentials
inputs:
secureFile: 'credentials'
- task: DownloadSecureFile@1
name: awsConfig
inputs:
secureFile: 'config'
- script: |
mkdir -p "${HOME}/.aws"
cp "$(awsCredentials.secureFilePath)" "${HOME}/.aws/credentials"
cp "$(awsConfig.secureFilePath)" "${HOME}/.aws/config"
displayName: 'Copy credentials'
- script: |
aws ec2 start-instances --instance-ids $(AWS_INSTANCE_ID)
displayName: 'Start instance'
- job: ${{ parameters.arch }}
dependsOn: [ startAgent ]
workspace:
clean: all
pool:
name: Fedora
demands:
- Agent.OSArchitecture -equals ${{ parameters.agent_arch }}
variables:
ARCH: ${{ parameters.arch }}
ARCHDIR: ${{ parameters.arch_dir }}
steps:
- script: |
sudo rm -rf rootfs
mkdir rootfs
displayName: 'Creating rootfs folder'
- script: sudo bash create-targz.sh $(ARCH) "$PWD/rootfs" 41
displayName: 'Build image'
- script: |
cp $(ARCHDIR)/install.tar.gz $(Build.ArtifactStagingDirectory)/install_$(ARCHDIR)_rootfs.tar.gz
sudo rm -rf $(ARCHDIR)/install.tar.gz
displayName: 'Copy for publishing'
- task: PublishBuildArtifacts@1
- script: |
sudo rm -rf /home/fedora/myagent/_work/*
sudo rm -rf /tmp/rootfs
sudo shutdown -r 1
condition: always()
displayName: Clean up