gitlab

Python 一键转化代码为流程图

早过忘川 提交于 2021-02-11 19:10:28
Graphviz是一个可以对图进行自动布局的绘图工具,由贝尔实验室开源。我们在上次 Python 快速绘制画出漂亮的系统架构图 提到的diagrams,其内部的编排逻辑就用到了这个开源工具包。 而今天我们要介绍的项目,就是基于Python和Graphviz开发的,能将源代码转化为流程图的工具:pycallgraph。 1.准备 开始之前,你要确保Python和pip已经成功安装在电脑上噢,如果没有,请访问这篇文章: 超详细Python安装指南 进行安装。如果你用Python的目的是数据分析,可以直接安装Anaconda: Python数据分析与挖掘好帮手—Anaconda Windows环境下打开Cmd(开始—运行—CMD),苹果系统环境下请打开Terminal(command+空格输入Terminal),准备开始输入命令安装依赖。 当然,我更推荐大家用VSCode编辑器,把本文代码Copy下来,在编辑器下方的终端运行命令安装 依赖模块 ,多舒服的一件事啊: Python 编程的最好搭档—VSCode 详细指南 。 在终端输入以下命令安装我们所需要的依赖模块: pip install pycallgraph 看到 Successfully installed xxx 则说明安装成功。 macOS用户请使用brew安装: brew install graphviz

gitlab: how can i programatically download the artifacts issued at end of CI pipeline

五迷三道 提交于 2021-02-10 18:52:54
问题 In Gitlab, how can i programatically download the artefacts issued at end of a CI pipeline. It is easy to download it via the UI but how can I get it through API. In other words, is it possible to access it via a token or similar? 回答1: It is possible through the API as in https://docs.gitlab.com/ee/api/jobs.html#get-job-artifacts GET /projects/:id/jobs/:job_id/artifacts Example requests: Using the PRIVATE-TOKEN header: curl --location --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https:/

gitlab: how can i programatically download the artifacts issued at end of CI pipeline

拈花ヽ惹草 提交于 2021-02-10 18:50:41
问题 In Gitlab, how can i programatically download the artefacts issued at end of a CI pipeline. It is easy to download it via the UI but how can I get it through API. In other words, is it possible to access it via a token or similar? 回答1: It is possible through the API as in https://docs.gitlab.com/ee/api/jobs.html#get-job-artifacts GET /projects/:id/jobs/:job_id/artifacts Example requests: Using the PRIVATE-TOKEN header: curl --location --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https:/

How to run Gitlab CI jobs in the same instance

无人久伴 提交于 2021-02-10 14:20:58
问题 I have autoscaled the gitlab-runner on AWS spot instances. And it works fine. And I have an issue when running the jobs. Below is my .gitlab-ci.yml and it has two stages. stages: - build - dev1:build build: stage: build script: - docker build --rm -t broker-connect-dev1-${CI_COMMIT_SHORT_SHA} -f BrokerConnect/Dockerfile . only: - dev1/release tags: - itela-spot-runner build-dev1: stage: dev1:build script: - docker tag broker-connect-dev1-${CI_COMMIT_SHORT_SHA}:latest 19950818/broker-connect:$

GIT: Unable to delete file from repo

时间秒杀一切 提交于 2021-02-10 06:57:12
问题 Currently, we are forced to migrate our repository from Gitlab to Github. When we want to push our repo to Github with "git push -u origin master". Unfortunately, this results in the following errors (Copied Output 1): remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com. remote: error: File Data/Setup/Database.2.7.0.1.accdb is 426.50 MB; this exceeds GitHub Enterprise's file size limit of 200.00 MB remote: error: File Data/DPM

GitLab: Composer Install private repository with ssh key (still get error failed to download)

故事扮演 提交于 2021-02-10 05:13:19
问题 I have no issue to clone from my local machine of the private repository, however, when I want to download the file via composer it asks me to create an auth.json file (I don't want this and I don't want to use a token). Do you have an idea why this happens? composer.json "require": { .. "myname/my-app": "*", .. }, "repositories": [ { "type": "vcs", "url": "git@gitlab.com:myname/my-app.git", }, ] I tried to add "no-api": true , I tried to set dev-master but failed. To test it out, I created a

GitLab: Composer Install private repository with ssh key (still get error failed to download)

两盒软妹~` 提交于 2021-02-10 05:12:42
问题 I have no issue to clone from my local machine of the private repository, however, when I want to download the file via composer it asks me to create an auth.json file (I don't want this and I don't want to use a token). Do you have an idea why this happens? composer.json "require": { .. "myname/my-app": "*", .. }, "repositories": [ { "type": "vcs", "url": "git@gitlab.com:myname/my-app.git", }, ] I tried to add "no-api": true , I tried to set dev-master but failed. To test it out, I created a

GitLab: Composer Install private repository with ssh key (still get error failed to download)

好久不见. 提交于 2021-02-10 05:12:33
问题 I have no issue to clone from my local machine of the private repository, however, when I want to download the file via composer it asks me to create an auth.json file (I don't want this and I don't want to use a token). Do you have an idea why this happens? composer.json "require": { .. "myname/my-app": "*", .. }, "repositories": [ { "type": "vcs", "url": "git@gitlab.com:myname/my-app.git", }, ] I tried to add "no-api": true , I tried to set dev-master but failed. To test it out, I created a

GitLab: Composer Install private repository with ssh key (still get error failed to download)

旧巷老猫 提交于 2021-02-10 05:12:31
问题 I have no issue to clone from my local machine of the private repository, however, when I want to download the file via composer it asks me to create an auth.json file (I don't want this and I don't want to use a token). Do you have an idea why this happens? composer.json "require": { .. "myname/my-app": "*", .. }, "repositories": [ { "type": "vcs", "url": "git@gitlab.com:myname/my-app.git", }, ] I tried to add "no-api": true , I tried to set dev-master but failed. To test it out, I created a

GitLab备份与恢复

时光怂恿深爱的人放手 提交于 2021-02-09 20:20:24
一、 备份gitlab gitlab的备份比较简单,我们直接使用gitlab本身提供的命令进行备份即可。 1.1 通过gitlab-rake命令备份gitlab gitlab提供的备份命令为gitlab-rake,备份命令使用如下: gitlab-rake gitlab:backup:create 该命令会备份gitlab仓库、数据库、用户、用户组、用户密钥、权限等信息。 备份完成后备份文件会出现在 /var/opt/gitlab/backups/ 当然备份的位置可以更换,使用如下命令: vim /etc/gitlab/gitlab.rb 修改上图 backup_path 的值即可,之后使用 gitlab-ctl reconfigure 使得配置生效 ps:备份文件的名称中1537261122_2018_09_18_9.2.5是此次备份的编号。该编号我们会在后续恢复gitlab数据使用到。 1.2 定时备份gitlab 如果要使gitlab自动进行备份的话,我们可以通过crontab命令来实现自动备份。强烈建议使用系统crontab命令,而不是用户crontab。 以实现每天凌晨4点进行一次自动备份为例,系统的crontab配置如下: vim /etc/crontab 0 4 * * * root /opt/gitlab/bin/gitlab-rake gitlab:backup