feat: Cloud init - Update submodules

Bu işleme şunda yer alıyor:
Maciej Krüger 2018-08-10 17:39:10 +02:00
ebeveyn f4bb39e13c
işleme 9949508cb3
Veri tabanında bu imza için bilinen anahtar bulunamadı
GPG Anahtar Kimliği: 0D948CE19CF49C5F
5 değiştirilmiş dosya ile 11 ekleme ve 5 silme

Dosyayı Görüntüle

@ -2,14 +2,14 @@ CHANNEL=stable
ENV=dev
clean:
rm -rf *.img *.model *.manifest
rm -rf *.img *.model *.manifest snaps
%.model: boards/%.yaml # sign a model file
cat definition.yaml $< | python -c "import sys, yaml, json; json.dump(yaml.load(sys.stdin), sys.stdout, indent=2)" | sed "s|TIMESTAMP|$(shell date -Iseconds --utc)|g" | snap sign -k default > $@
snaps/%:
node build-tool.js --env $(ENV) --channel $(CHANNEL) --board $*
%.img: %.model snaps/% # build an image
sudo ubuntu-image snap -o $@ -c $(CHANNEL) $<
sudo ubuntu-image snap -o $@ --cloud-init $(ENV).cloud-init.yaml -c $(CHANNEL) $<
# VM stuff

Dosyayı Görüntüle

@ -18,6 +18,7 @@ const isDev = env === 'dev'
const forceBuild = isDev
const deps = yaml.safeLoad(read('deps/' + board + '.yaml'))
const common = yaml.safeLoad(read('deps/common.yaml'))
const boardDef = yaml.safeLoad(read('boards/' + board + '.yaml'))
const exec = (cmd, dir, ...args) => new Promise((resolve, reject) => {
@ -48,20 +49,23 @@ async function snapcraft (folder, outFile, targetArch) {
async function pullOrClone (repo, dest, checkout) {
let currentCommit = ''
if (fs.existsSync(dest)) {
await exec('git', dest, 'remote', 'update', '--recurse-submodules=yes', '-p')
await exec('git', dest, 'remote', 'update', '-p')
} else {
await exec('git', process.cwd(), 'clone', '--recursive', repo, dest)
currentCommit = String(execWithOutput('git', '-C', dest, 'rev-parse', '--verify', 'HEAD').stdout)
}
await exec('git', dest, 'checkout', checkout)
await exec('git', dest, 'submodule', 'init', '.')
await exec('git', dest, 'submodule', 'update')
let newCommit = String(execWithOutput('git', '-C', dest, 'rev-parse', '--verify', 'HEAD').stdout)
return currentCommit !== newCommit // returns bool if snap need recompilation
}
async function main () {
for (const snapName in deps.snaps) { // eslint-disable-line guard-for-in
const snap = deps.snaps[snapName]
const snaps = Object.assign(deps.snaps, common.snaps)
for (const snapName in snaps) { // eslint-disable-line guard-for-in
const snap = snaps[snapName]
if (snap.mustBuild || forceBuild) {
console.log('Building %s...', snapName)

Dosyayı Görüntüle

@ -5,6 +5,7 @@ model: ppl-hub
# snaps to be preinstalled:
required-snaps:
- nextcloud # just for proof-of-concept
- snapweb
# authority meta
authority-id: 7xN2sMCILuFk10e6DxrTrQWprdmV0Vi9
brand-id: 7xN2sMCILuFk10e6DxrTrQWprdmV0Vi9

1
deps/common.yaml sağlanmış Normal dosya
Dosyayı Görüntüle

@ -0,0 +1 @@
snaps:

0
dev.cloud-init.yaml Normal dosya
Dosyayı Görüntüle