Skip to content
Snippets Groups Projects
Commit ce33884d authored by michael.minelli's avatar michael.minelli
Browse files

Exercises / Assignments => Add image option on yml files

parent 67b27aec
No related branches found
No related tags found
No related merge requests found
Pipeline #34765 passed
......@@ -20,7 +20,7 @@ dojo:
services:
- docker:24.0.6-dind
image:
name: dojohesso/dojo_assignment_checker:latest
name: {{DOCKERHUB_REPO_ASSIGNMENT_CHECKER}}:latest
script:
- dojo_assignment_checker
allow_failure: false
\ No newline at end of file
......@@ -20,7 +20,7 @@ dojo:
services:
- docker:24.0.6-dind
image:
name: dojohesso/dojo_exercise_checker:latest
name: {{DOCKERHUB_REPO_EXERCISE_CHECKER}}:latest
script:
- dojo_exercise_checker
artifacts:
......
......@@ -164,7 +164,7 @@ class AssignmentRoutes implements RoutesManager {
await repoCreationFnExec(() => GitlabManager.protectBranch(repository.id, '*', true, Gitlab.AccessLevel.DEVELOPER, Gitlab.AccessLevel.DEVELOPER, Gitlab.AccessLevel.ADMIN), 'Branch protection modification error');
await repoCreationFnExec(() => GitlabManager.addRepositoryBadge(repository.id, Config.gitlab.badges.pipeline.link, Config.gitlab.badges.pipeline.imageUrl, 'Pipeline Status'), 'Pipeline badge addition error');
await repoCreationFnExec(() => GitlabManager.deleteFile(repository.id, '.gitlab-ci.yml', 'Remove .gitlab-ci.yml'));
await repoCreationFnExec(() => GitlabManager.createFile(repository.id, '.gitlab-ci.yml', fs.readFileSync(path.join(__dirname, '../../assets/assignment_gitlab_ci.yml'), 'base64'), 'Add .gitlab-ci.yml (DO NOT MODIFY THIS FILE)'), 'CI/CD file creation error');
await repoCreationFnExec(() => GitlabManager.createFile(repository.id, '.gitlab-ci.yml', Buffer.from(fs.readFileSync(path.join(__dirname, '../../assets/assignment_gitlab_ci.yml'), 'utf8').replace('{{DOCKERHUB_REPO_ASSIGNMENT_CHECKER}}', Config.dockerhub.repositories.assignmentChecker)).toString('base64'), 'Add .gitlab-ci.yml (DO NOT MODIFY THIS FILE)'), 'CI/CD file creation error');
await repoCreationFnExec(() => Promise.all(params.members.map(member => member.id).map(GlobalHelper.addRepoMember(repository.id))), 'Add repository members error');
......
......@@ -212,7 +212,7 @@ class ExerciseRoutes implements RoutesManager {
await GitlabManager.addRepositoryVariable(repository.id, 'DOJO_RESULTS_FOLDER', Config.exercise.pipelineResultsFolder, false, false);
}, 'Pipeline variables addition error');
await repoCreationFnExec(() => GitlabManager.updateFile(repository.id, '.gitlab-ci.yml', fs.readFileSync(path.join(__dirname, '../../assets/exercise_gitlab_ci.yml'), 'base64'), 'Add .gitlab-ci.yml (DO NOT MODIFY THIS FILE)'), 'CI/CD file update error');
await repoCreationFnExec(() => GitlabManager.updateFile(repository.id, '.gitlab-ci.yml', Buffer.from(fs.readFileSync(path.join(__dirname, '../../assets/exercise_gitlab_ci.yml'), 'utf8').replace('{{DOCKERHUB_REPO_EXERCISE_CHECKER}}', Config.dockerhub.repositories.exerciseChecker)).toString('base64'), 'Add .gitlab-ci.yml (DO NOT MODIFY THIS FILE)'), 'CI/CD file update error');
await repoCreationFnExec(async () => Promise.all([ ...new Set([ ...assignment.staff, ...params.members ].map(member => member.id)) ].map(GlobalHelper.addRepoMember(repository.id))), 'Add repository members error');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment