Compare commits

..

4 Commits

Author SHA1 Message Date
8e9a61bbb2 4.1.29 2024-05-23 21:47:07 +02:00
dc809a6023 fix(core): update 2024-05-23 21:47:06 +02:00
7eeca992b0 4.1.28 2024-05-17 16:23:48 +02:00
d018102014 fix(core): update 2024-05-17 16:23:47 +02:00
5 changed files with 28 additions and 32 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@ship.zone/npmci",
"version": "4.1.27",
"version": "4.1.29",
"private": false,
"description": "node and docker in gitlab ci on steroids",
"main": "dist_ts/index.js",

View File

@@ -0,0 +1,2 @@
FROM mygroup/myrepo:sometag2
RUN apt-get update

View File

@@ -19,26 +19,20 @@ process.cwd = () => {
return path.join(smartpath.get.dirnameFromImportMetaUrl(import.meta.url), 'assets/');
};
let npmci: typeof import('../ts/index.js');
type TNpmciTypes = typeof import('../ts/index.js');
tap.preTask('should import npmci', async () => {
npmci = await import('../ts/index.js');
});
import type * as npmciTypes from '../ts/index.js';
const npmci = await import('../ts/index.js');
// ======
// Docker
// ======
let dockerfile1: npmci.Dockerfile;
let dockerfile2: npmci.Dockerfile;
let sortableArray: npmci.Dockerfile[];
let dockerfile1: npmciTypes.Dockerfile;
let dockerfile2: npmciTypes.Dockerfile;
let sortableArray: npmciTypes.Dockerfile[];
tap.test('should return valid Dockerfiles', async () => {
const npmciInstance = new npmci.Npmci();
await npmciInstance.start();
await npmciInstance.start();
dockerfile1 = new npmci.Dockerfile(npmciInstance.dockerManager, {
filePath: './Dockerfile',
read: true,
@@ -55,7 +49,7 @@ tap.test('should read a directory of Dockerfiles', async () => {
const npmciInstance = new npmci.Npmci();
await npmciInstance.start();
return npmci.Dockerfile.readDockerfiles(npmciInstance.dockerManager).then(
async (readDockerfilesArrayArg: npmci.Dockerfile[]) => {
async (readDockerfilesArrayArg: npmciTypes.Dockerfile[]) => {
sortableArray = readDockerfilesArrayArg;
return expect(readDockerfilesArrayArg[1].version).toEqual('sometag1');
}
@@ -64,7 +58,7 @@ tap.test('should read a directory of Dockerfiles', async () => {
tap.test('should sort an array of Dockerfiles', async () => {
return npmci.Dockerfile.sortDockerfiles(sortableArray).then(
async (sortedArrayArg: npmci.Dockerfile[]) => {
async (sortedArrayArg: npmciTypes.Dockerfile[]) => {
console.log(sortedArrayArg);
}
);

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@ship.zone/npmci',
version: '4.1.27',
version: '4.1.29',
description: 'node and docker in gitlab ci on steroids'
}

View File

@@ -122,7 +122,7 @@ export class Dockerfile {
*/
public static dockerFileVersion(dockerfileInstanceArg: Dockerfile, dockerfileNameArg: string): string {
let versionString: string;
const versionRegex = /Dockerfile_([^:_]*)$/;
const versionRegex = /Dockerfile_(.+)$/;
const regexResultArray = versionRegex.exec(dockerfileNameArg);
if (regexResultArray && regexResultArray.length === 2) {
versionString = regexResultArray[1];