Skip to content
This repository has been archived by the owner on Apr 21, 2022. It is now read-only.

Commit

Permalink
fix: fixes with pack:deb
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Apr 10, 2018
1 parent dc6acfb commit a5e65d5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .circleci/loadgpg
@@ -1,3 +1,3 @@
#!/usr/bin/env bash

echo "$DEB_KEY" | base64 -d | gpg --import
echo "$OCLIF_DEV_DEB_KEY" | base64 -d | gpg --import
2 changes: 1 addition & 1 deletion src/commands/pack/deb.ts
Expand Up @@ -52,7 +52,7 @@ export default class PackDeb extends Command {
const ftparchive = qq.join(buildConfig.tmp, 'apt', 'apt-ftparchive.conf')
await qq.write(ftparchive, scripts.ftparchive(config))
await qq.x(`apt-ftparchive -c "${ftparchive}" release . > Release`, {cwd: dist})
const gpgKey = config.scopedEnvVar('GPG_KEY')
const gpgKey = config.scopedEnvVar('DEB_KEY')
if (gpgKey) {
await qq.x(`gpg --digest-algo SHA512 --clearsign -u ${gpgKey} -o InRelease Release`)
await qq.x(`gpg --digest-algo SHA512 -abs -u ${gpgKey} -o Release.gpg Release`)
Expand Down
14 changes: 7 additions & 7 deletions src/commands/publish/deb.ts
Expand Up @@ -25,19 +25,19 @@ export default class PublishDeb extends Command {

const remoteBase = buildConfig.channel === 'stable' ? 'apt' : `channels/${buildConfig.channel}/apt`
const upload = (file: string) => {
return aws.s3.uploadFile(file, {...S3Options, CacheControl: 'max-age=86400', Key: [remoteBase, file].join('/')})
return aws.s3.uploadFile(dist(file), {...S3Options, CacheControl: 'max-age=86400', Key: [remoteBase, file].join('/')})
}
const debVersion = `${buildConfig.version.split('-')[0]}-1`
const uploadDeb = async (arch: 'amd64' | 'i386') => {
const deb = dist(`${config.bin}_${debVersion}_${arch}.deb`)
if (await qq.exists(deb)) await upload(deb)
const deb = `${config.bin}_${debVersion}_${arch}.deb`
if (await qq.exists(dist(deb))) await upload(deb)
}
await uploadDeb('amd64')
await uploadDeb('i386')
await upload(dist('Packages.gz'))
await upload(dist('Packages.xz'))
await upload(dist('Packages.bz2'))
await upload(dist('Release'))
await upload('Packages.gz')
await upload('Packages.xz')
await upload('Packages.bz2')
await upload('Release')
if (await qq.exists(dist('InRelease'))) await upload('InRelease')
if (await qq.exists(dist('Release.gpg'))) await upload('Release.gpg')

Expand Down

0 comments on commit a5e65d5

Please sign in to comment.