Commit a6f33d72 authored by Martin Lowe's avatar Martin Lowe 🇨🇦
Browse files

Merge branch 'malowe/master/update-gl' into 'master'

Update Gitlab sync + import to be modern

See merge request !208
parents 18827fe3 69c3c69e
Pipeline #5592 passed with stage
in 0 seconds
{
"root": true,
"extends": [
"eslint:recommended",
"strongloop"
......@@ -8,11 +9,14 @@
"es2017": true,
"browser": false
},
"parser": "babel-eslint",
"parser": "@babel/eslint-parser",
"ignorePatterns": [
"test/*.js",
"**/vendor/*.js"
],
"parserOptions": {
"requireConfigFile": false
},
"rules": {
"max-len": [2, 140, 2],
"eqeqeq": 2,
......
......@@ -10,7 +10,7 @@
# docker run -i --rm -v <full path to a file folder>:/run/secrets eclipsefdn/gitlab-sync
#
###
FROM node:12
FROM node:fermium-alpine
WORKDIR /app
ARG VERBOSE_VAL=false
ENV VERBOSE_VAL ${VERBOSE_VAL:-false}
......
......@@ -10,7 +10,7 @@
# docker run -i --rm -v <full path to a file folder>:/run/secrets eclipsefdn/import-backup
#
###
FROM node:12
FROM node:fermium-alpine
WORKDIR /app
ARG VERBOSE_VAL=false
ENV VERBOSE_VAL ${VERBOSE_VAL:-false}
......
This diff is collapsed.
......@@ -60,6 +60,7 @@ module.exports = class EclipseAPI {
if (this.#testMode) {
return [{
project_id: 'spider.pig',
short_project_id: 'spider.pig',
name: 'Spider pig does what a spider pig does',
summary: 'Can he fly? No, hes a pig. Look out, here comes the spider pig',
logo: '',
......
......@@ -47,7 +47,7 @@ const ADMIN_PERMISSIONS_LEVEL = 50;
const uuid = require('uuid');
const { SecretReader, getBaseConfig } = require('./SecretReader.js');
const { Gitlab } = require('gitlab');
const { Gitlab } = require('@gitbeaker/node');
const EclipseAPI = require('./EclipseAPI.js');
const { getLogger } = require('./logger.js');
......@@ -390,8 +390,6 @@ async function getGroup(name, path, parent, visibility = 'public') {
if (g === undefined) {
logger.verbose(`Creating new group with name '${name}'`);
var opts = {
name: name,
path: sanitizeGroupName(path),
project_creation_level: 'maintainer',
visibility: visibility,
request_access_enabled: false,
......@@ -410,7 +408,7 @@ async function getGroup(name, path, parent, visibility = 'public') {
logger.debug(`Creating group with options: ${JSON.stringify(opts)}`);
}
try {
g = await api.Groups.create(opts);
g = await api.Groups.create(name, sanitizeGroupName(path), opts);
} catch (err) {
if (argv.V) {
logger.error(err);
......
const Wrapper = require('../GitWrapper.js');
const { Gitlab } = require('gitlab');
const { Gitlab } = require('@gitbeaker/node');
const { SecretReader, getBaseConfig } = require('../SecretReader.js');
const { ImportRunner } = require('./ImportRunner');
......
......@@ -130,9 +130,7 @@ class ImportRunner {
async createBackupGroup(config, name, parentID) {
log(config, `createBackupGroup(${name}, ${parentID})`);
try {
return await this.gitlab.Groups.create({
name: name,
path: name,
return await this.gitlab.Groups.create(name, name, {
parent_id: parentID,
});
} catch (e) {
......
......@@ -7,7 +7,7 @@ const expect = chai.expect;
// import test dependencies
const { ImportRunner } = require('../src/auto_backup/ImportRunner');
const Wrapper = require('../src/GitWrapper');
const { Gitlab } = require('gitlab');
const { Gitlab } = require('@gitbeaker/node');
// create reusable API wrapper bases
const GH_BASE_WRAPPER = new Wrapper();
const GL_BASE_WRAPPER = new Gitlab();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment