Skip to content

Instantly share code, notes, and snippets.

View dbenchi's full-sized avatar
😎
JS everywhere

David BENCHI dbenchi

😎
JS everywhere
View GitHub Profile
@dbenchi
dbenchi / cloudSettings
Last active November 26, 2018 17:56
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-11-26T17:56:33.842Z","extensionVersion":"v3.2.2"}
axios.request({
method: 'post',
url: `${GITLAB_URL}/api/v4/projects/${encodeURIComponent(GITLAB_PROJECT)}/issues`,
// the GitLab issue that we have just created
data: GITLAB_ISSUE
headers: {
'PRIVATE-TOKEN': GITLAB_TOKEN
}
})
{
title: JIRAIssue.fields.summary,
description: JIRAIssue.fields.description,
labels: [JIRAIssue.fields.issuetype.name],
created_at: JIRAIssue.fields.created,
updated_at: JIRAIssue.fields.updated,
done: issue.fields.status.statusCategory.name === 'Done' ? true : false,
assignee: jiraToGitlabUser(JIRAIssue.fields.assignee ),
reporter: jiraToGitlabUser(JIRAIssue.fields.reporter),
comments: JIRAComments.map(JIRAComment => ({
function jiraToGitlabUser(JIRAUser) {
// GitLabUsers = the list of GitLab users we get from the last call
return JIRAUser ? _.find(GitLabUsers, { email: JIRAUser.emailAddress }) : null
}
axios.request({
method: 'get',
// 10000 users, should be enough to get them all
url: `${GITLAB_URL}/api/v4/users?active=true&search=&per_page=10000`,
headers: {
'PRIVATE-TOKEN': GITLAB_TOKEN
}
})
// the base url to your GitLab
const GITLAB_URL = 'http://your-gitlab-url.com/';
// the project in gitlab that you are importing issues to
const GITLAB_PROJECT = 'namespaced/project/name';
// GitLab username and password used to login
const GITLAB_ACCOUNT = {
username,
password
// the base url to your JIRA
const JIRA_URL = 'https://your-jira-url.com/';
// the JIRA project ID (short)
const JIRA_PROJECT = 'PRO';
// JIRA username and password used to login
const JIRA_ACCOUNT = {
username,
password
axios.request({
method: 'get',
/*
* JIRA_ISSUE = the JIRA issue that we get from the previous call
*/
url: `${JIRA_URL}/rest/api/2/issue/${JIRA_ISSUE.id}/?fields=attachment,comment`,
auth: {
username: JIRA_ACCOUNT.username,
password: JIRA_ACCOUNT.password
}
axios.request({
method: 'get',
url: `${JIRA_URL}/rest/api/2/search?jql=project=${JIRA_PROJECT}+order+by+id+asc&startAt=${offset}&maxResults=${limit}`,
auth: {
username: JIRA_ACCOUNT.username,
password: JIRA_ACCOUNT.password
}
})
FROM php:5.6.30
MAINTAINER Linagora Folks <lgs-openpaas-dev@linagora.com>
RUN apt-get update && \
apt-get -y install unzip git php5-curl php5-dev php-amqplib && \
docker-php-ext-install bcmath && \
pecl install mongo && \
docker-php-ext-enable mongo && \
curl https://getcomposer.org/installer | php && \