Inspect CI

Change-type: patch
This commit is contained in:
Paulo Castro 2021-06-11 13:03:33 +01:00
parent aeec52fb8f
commit fc88c7678b
5 changed files with 89 additions and 5 deletions

View File

@ -1,4 +1,47 @@
---
docker:
builds:
- path: .
dockerfile: ./automation/caxa/Dockerfile
args:
- BUILD_BASE=balenalib/amd64-debian-node:12.22.1-build-20210506
- GITHUB_TOKEN
docker_repo: repo-name-not-used-because-not-published
publish: false
# caxa does not currently produce 32-bit x86/ia32/i386 stubs
# - path: .
# dockerfile: ./automation/caxa/Dockerfile
# args:
# - BUILD_BASE=balenalib/i386-debian-node:12.16.3-build-20200518
# - GITHUB_TOKEN
# docker_repo: repo-name-not-used-because-not-published
# publish: false
- path: .
dockerfile: ./automation/caxa/Dockerfile
args:
- BUILD_BASE=balenalib/aarch64-debian-node:12.20.1-build-20210119
- GITHUB_TOKEN
docker_repo: repo-name-not-used-because-not-published
publish: false
- path: .
dockerfile: ./automation/caxa/Dockerfile
args:
- BUILD_BASE=balenalib/armv7hf-debian-node:12.22.1-build-20210603
- GITHUB_TOKEN
docker_repo: repo-name-not-used-because-not-published
publish: false
- path: .
dockerfile: ./automation/caxa/Dockerfile
args:
- BUILD_BASE=balenalib/rpi-debian-node:12.20.1-build-20210201
- GITHUB_TOKEN
docker_repo: repo-name-not-used-because-not-published
publish: false
npm:
platforms:
- name: linux

View File

@ -503,10 +503,10 @@ export async function buildOclifInstaller() {
}
export async function buildInstallers() {
if (process.platform !== 'win32') {
const { makeCaxaInstaller } = await import('./make-caxa-installer');
await makeCaxaInstaller();
}
// if (process.platform !== 'win32') {
// const { makeCaxaInstaller } = await import('./make-caxa-installer');
// await makeCaxaInstaller();
// }
await buildOclifInstaller();
}

View File

@ -0,0 +1,32 @@
ARG BUILD_BASE=balenalib/amd64-debian-node:12.22.1-build
FROM ${BUILD_BASE}
SHELL ["/bin/bash", "-c"]
WORKDIR /usr/src/app
COPY . .
RUN npm install --unsafe-perm && npm run build:fast
RUN mkdir -p dist && npm run build:caxa
# test the installer
# file will be something like balena-cli-v12.45.20-linux-x64-installer
RUN ls -la dist; file=$(ls -t dist/balena-cli-v* | head -n 1); echo "$file"; "$file"
# fail early if balena binary won't run
RUN balena --version
# install resinci-deploy
ARG GITHUB_TOKEN
RUN cd /usr/src && \
git clone https://product-os:${GITHUB_TOKEN}@github.com/product-os/resinci-deploy.git && \
cd resinci-deploy && \
npm install --unsafe-perm && npm link --force
RUN unset IFS; read branch owner repo version <<<$(node automation/caxa/parse-version.js); \
echo "branch=${branch}" "owner=${owner}" "repo=${repo}" "version=${version}"
RUN unset IFS; read branch owner repo version <<<$(node automation/caxa/parse-version.js) && \
echo "branch=${branch}" "owner=${owner}" "repo=${repo}" "version=${version}" && \
resinci-deploy store github-release dist/* --branch=$branch --owner=$owner --repo=$repo --version=$version
CMD /bin/bash

View File

@ -0,0 +1,9 @@
const { promises: fs } = require('fs');
async function parseVersion() {
const fields = ['head_branch', 'base_org', 'base_repo', 'componentVersion'];
const ver = JSON.parse(await fs.readFile('.git/.version'));
console.log(fields.map((f) => ver[f]).join(' '));
}
parseVersion();

View File

@ -60,7 +60,7 @@
"package": "npm run build:fast && npm run build:standalone && npm run build:installer",
"release": "ts-node --transpile-only automation/run.ts release",
"pretest": "npm run build",
"test": "npm run test:shrinkwrap && npm run test:source && npm run test:standalone",
"test": "false && npm run test:shrinkwrap && npm run test:source && npm run test:standalone",
"test:shrinkwrap": "ts-node --transpile-only automation/run.ts test-shrinkwrap",
"test:source": "cross-env BALENA_CLI_TEST_TYPE=source mocha",
"test:standalone": "npm run build:standalone && npm run test:standalone:fast",