Compare commits
No commits in common. "install-fpm" and "master" have entirely different histories.
install-fp
...
master
27
.gitea/workflows/docker-build.yml
Normal file
27
.gitea/workflows/docker-build.yml
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
name: Docker Build
|
||||||
|
|
||||||
|
on: push
|
||||||
|
|
||||||
|
env:
|
||||||
|
ACTIONS_STEP_DEBUG: "true"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
docker-build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- uses: https://gitea.dhswt.de/actions/docker-fix-socket-perm@master
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- uses: https://gitea.dhswt.de/actions/docker@master
|
||||||
|
with:
|
||||||
|
ci_registry_password: ${{ secrets.RELEASE_TOKEN }}
|
||||||
|
docker_multiarch: false # re-enable after development is done
|
||||||
|
docker_context_dir: image/
|
||||||
2465
dist/index.js
vendored
2465
dist/index.js
vendored
File diff suppressed because it is too large
Load Diff
14
image/Dockerfile
Normal file
14
image/Dockerfile
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
FROM debian:bookworm
|
||||||
|
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y \
|
||||||
|
ruby \
|
||||||
|
build-essential \
|
||||||
|
rpm \
|
||||||
|
tar \
|
||||||
|
zip \
|
||||||
|
&& gem install --no-document fpm -v 1.15.1
|
||||||
|
|
||||||
|
ADD --chmod=755 entrypoint.sh /entrypoint.sh
|
||||||
|
|
||||||
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
5
image/entrypoint.sh
Normal file
5
image/entrypoint.sh
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
exec fpm "$@"
|
||||||
14
package-lock.json
generated
14
package-lock.json
generated
@ -10,7 +10,6 @@
|
|||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.10.1",
|
"@actions/core": "^1.10.1",
|
||||||
"@actions/exec": "^1.1.1",
|
|
||||||
"@actions/github": "^6.0.0",
|
"@actions/github": "^6.0.0",
|
||||||
"information": "file:../information",
|
"information": "file:../information",
|
||||||
"js-base64": "^3.7.5"
|
"js-base64": "^3.7.5"
|
||||||
@ -7340,14 +7339,6 @@
|
|||||||
"uuid": "^8.3.2"
|
"uuid": "^8.3.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/exec": {
|
|
||||||
"version": "1.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.1.tgz",
|
|
||||||
"integrity": "sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==",
|
|
||||||
"dependencies": {
|
|
||||||
"@actions/io": "^1.0.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@actions/github": {
|
"node_modules/@actions/github": {
|
||||||
"version": "6.0.0",
|
"version": "6.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/github/-/github-6.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/github/-/github-6.0.0.tgz",
|
||||||
@ -7368,11 +7359,6 @@
|
|||||||
"undici": "^5.25.4"
|
"undici": "^5.25.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/io": {
|
|
||||||
"version": "1.1.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.3.tgz",
|
|
||||||
"integrity": "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q=="
|
|
||||||
},
|
|
||||||
"node_modules/@ampproject/remapping": {
|
"node_modules/@ampproject/remapping": {
|
||||||
"version": "2.2.1",
|
"version": "2.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz",
|
||||||
|
|||||||
@ -18,7 +18,6 @@
|
|||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.10.1",
|
"@actions/core": "^1.10.1",
|
||||||
"@actions/exec": "^1.1.1",
|
|
||||||
"@actions/github": "^6.0.0",
|
"@actions/github": "^6.0.0",
|
||||||
"information": "file:../information",
|
"information": "file:../information",
|
||||||
"js-base64": "^3.7.5"
|
"js-base64": "^3.7.5"
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import * as github from '@actions/github';
|
import * as github from '@actions/github';
|
||||||
import * as action_information from 'information';
|
import * as action_information from 'information';
|
||||||
import {executeFpmBuild, installFpmViaRuby, isTrueString, prepareFpmArgs} from './lib';
|
import {executeFpmBuild, isTrueString, prepareFpmArgs} from './lib';
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -14,8 +14,6 @@ try {
|
|||||||
|
|
||||||
const fpmArgs = prepareFpmArgs();
|
const fpmArgs = prepareFpmArgs();
|
||||||
|
|
||||||
await installFpmViaRuby();
|
|
||||||
|
|
||||||
executeFpmBuild(fpmArgs, debug);
|
executeFpmBuild(fpmArgs, debug);
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
|
|||||||
40
src/lib.js
40
src/lib.js
@ -1,37 +1,37 @@
|
|||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import fs from 'fs';
|
import child_process from 'child_process';
|
||||||
|
|
||||||
const exec = require('@actions/exec');
|
|
||||||
|
|
||||||
export function prepareFpmArgs() {
|
export function prepareFpmArgs() {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function installFpmViaRuby(debug) {
|
export function executeFpmBuild(computedFpmArgs, debug) {
|
||||||
const aptCmd = 'sudo apt-get install -y ruby';
|
|
||||||
const gemCmd = 'sudo gem install fpm';
|
|
||||||
if (debug) {
|
|
||||||
console.log('ruby install command: ', rubyCmd);
|
|
||||||
}
|
|
||||||
|
|
||||||
await exec.exec(aptCmd);
|
|
||||||
await exec.exec(gemCmd);
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function executeFpmBuild(computedFpmArgs, debug) {
|
|
||||||
|
|
||||||
const userFpmArgs = core.getInput('fpm_args');
|
const userFpmArgs = core.getInput('fpm_args');
|
||||||
const fpmCmd = 'fpm'
|
const dockerCmd = 'docker run --rm -i'
|
||||||
|
+ ` -v "${process.cwd()}:/workspace/source"`
|
||||||
|
+ ' -w /workspace/source'
|
||||||
|
+ ' gitea.dhswt.de/actions/fpm:master'
|
||||||
+ ' ' + computedFpmArgs
|
+ ' ' + computedFpmArgs
|
||||||
+ ' ' + userFpmArgs;
|
+ ' ' + userFpmArgs;
|
||||||
|
|
||||||
fs.writeFileSync("/tmp/action-fpm-command-bash", fpmCmd);
|
|
||||||
|
|
||||||
if (debug) {
|
if (debug) {
|
||||||
console.log('fpm command: ', fpmCmd);
|
console.log('docker command: ', dockerCmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
await exec.exec("bash /tmp/action-fpm-command-bash");
|
const proc = child_process.spawnSync(dockerCmd, {
|
||||||
|
shell: true,
|
||||||
|
stdio: 'inherit',
|
||||||
|
cwd : process.cwd()
|
||||||
|
});
|
||||||
|
|
||||||
|
if (proc.status != null && proc.status > 0) {
|
||||||
|
throw new Error('fpm build failed');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (proc.error != null) {
|
||||||
|
throw proc.error;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function isNonEmptyStr(str) {
|
function isNonEmptyStr(str) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user