Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
098b2db
Merge pull request #19 from overture-stack/master
rtisma Oct 15, 2020
e304d46
added overture-qa autodeploy
rtisma Oct 15, 2020
2c1e1ef
updated
rtisma Oct 15, 2020
0314eb9
Add custom api fetcher for Arranger, arranger_api config value
anncatton Oct 15, 2020
a111587
add publicConfig
anncatton Oct 15, 2020
55ae987
pr feedback
anncatton Oct 16, 2020
79223a6
test
rtisma Oct 16, 2020
eaeab0d
trigger jenkins
anncatton Oct 16, 2020
3955134
add Footer to main page layout
anncatton Oct 16, 2020
fbc302a
Merge pull request #22 from overture-stack/20-config
anncatton Oct 16, 2020
280ccc1
updated
rtisma Oct 19, 2020
19c4bfd
updated
rtisma Oct 19, 2020
a6558df
updated
rtisma Oct 19, 2020
453f60a
updated
rtisma Oct 19, 2020
949ad0b
updated
rtisma Oct 19, 2020
2183554
Merge pull request #25 from overture-stack/update-jenkinsfile
rtisma Oct 19, 2020
7e6d833
Consistent env var naming. Add getInitialProps to login, repository p…
anncatton Oct 27, 2020
e02df3b
Add createPage func
anncatton Oct 27, 2020
8c7833f
⬆️ Upgrade next to 9.5.4
anncatton Oct 27, 2020
502ce66
remove unused config values
anncatton Oct 29, 2020
1e6fd9d
Merge pull request #28 from overture-stack/27-upgrade-next
anncatton Oct 29, 2020
e72503f
trigger jenkins
anncatton Oct 29, 2020
3b1edef
trigger jenkins
anncatton Oct 29, 2020
91a56b6
Merge pull request #30 from overture-stack/20-fix-config
anncatton Oct 29, 2020
0ba7edb
Update Jenkinsfile.groovy
andricDu Oct 29, 2020
c7871eb
Merge pull request #31 from overture-stack/bug/jenkinsfile-set-image-tag
andricDu Oct 29, 2020
0b721a3
add commit param for staging
anncatton Oct 29, 2020
a8ed8b9
Merge pull request #33 from overture-stack/staging-image-tag
anncatton Nov 2, 2020
87f4b24
use version only for master deploy
anncatton Nov 2, 2020
36555b2
Merge pull request #36 from overture-stack/modify-master-deploy
anncatton Nov 3, 2020
a60841e
🔖 rc 0.3.0
anncatton Nov 3, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.env.local
.env.test
.env.schema
.next
node_modules
Dockerfile
3 changes: 2 additions & 1 deletion .env.schema
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ NEXT_PUBLIC_EGO_CLIENT_ID=dms-ui-dev
######### Arranger
NEXT_PUBLIC_ARRANGER_PROJECT_ID=
NEXT_PUBLIC_ARRANGER_GRAPHQL_FIELD=
NEXT_PUBLIC_ARRANGER_INDEX=
NEXT_PUBLIC_ARRANGER_INDEX=
NEXT_PUBLIC_ARRANGER_API_URL=
153 changes: 74 additions & 79 deletions Jenkinsfile.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -55,88 +55,83 @@ spec:
}
}

stage('Build & Publish Develop') {
when {
anyOf {
branch 'develop'
}
}
steps {
container('docker') {
withCredentials([usernamePassword(credentialsId:'OvertureDockerHub', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {
sh 'docker login -u $USERNAME -p $PASSWORD'
}
// DNS error if --network is default
sh "docker build --network=host -f Dockerfile . -t ${dockerHubRepo}:${version}-${commit} -t ${dockerHubRepo}:edge"
sh "docker push ${dockerHubRepo}:${version}-${commit}"
sh "docker push ${dockerHubRepo}:edge"
}
}
}
stage('Build & Publish Develop') {
when {
anyOf {
branch 'develop'
}
}
steps {
container('docker') {
withCredentials([usernamePassword(credentialsId:'OvertureDockerHub', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {
sh 'docker login -u $USERNAME -p $PASSWORD'
}
// DNS error if --network is default
sh "docker build --network=host -f Dockerfile . -t ${dockerHubRepo}:${version}-${commit} -t ${dockerHubRepo}:edge"
sh "docker push ${dockerHubRepo}:${version}-${commit}"
sh "docker push ${dockerHubRepo}:edge"
}
}
}

stage('Release & Tag') {
when {
anyOf {
branch 'master'
}
}
steps {
container('docker') {
withCredentials([usernamePassword(credentialsId: 'OvertureBioGithub', passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME')]) {
sh "git tag ${version}"
sh "git push https://${GIT_USERNAME}:${GIT_PASSWORD}@github.com/${githubRepo} --tags"
}
withCredentials([usernamePassword(credentialsId:'OvertureDockerHub', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {
sh 'docker login -u $USERNAME -p $PASSWORD'
}
// DNS error if --network is default
sh "docker build --network=host -f Dockerfile . -t ${dockerHubRepo}:${version} -t ${dockerHubRepo}:latest"
sh "docker push ${dockerHubRepo}:${version}"
sh "docker push ${dockerHubRepo}:latest"
}
}
}
stage('Release & Tag') {
when {
anyOf {
branch 'master'
}
}
steps {
container('docker') {
withCredentials([usernamePassword(credentialsId: 'OvertureBioGithub', passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME')]) {
sh "git tag ${version}"
sh "git push https://${GIT_USERNAME}:${GIT_PASSWORD}@github.com/${githubRepo} --tags"
}
withCredentials([usernamePassword(credentialsId:'OvertureDockerHub', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {
sh 'docker login -u $USERNAME -p $PASSWORD'
}
// DNS error if --network is default
sh "docker build --network=host -f Dockerfile . -t ${dockerHubRepo}:${version} -t ${dockerHubRepo}:latest"
sh "docker push ${dockerHubRepo}:${version}"
sh "docker push ${dockerHubRepo}:latest"
}
}
}

//stage('Deploy to overture-qa') {
//when {
//branch "develop"
//}
//steps {
//container('helm') {
//withCredentials([file(credentialsId:'4ed1e45c-b552-466b-8f86-729402993e3b', variable: 'KUBECONFIG')]) {
//sh 'env'
//sh 'helm init --client-only'
//sh "helm ls --kubeconfig $KUBECONFIG"
//sh "helm repo add overture https://overture-stack.github.io/charts-server/"
//sh """
//helm upgrade --kubeconfig $KUBECONFIG --install --namespace=overture-qa ego \\
//overture/ego --reuse-values --set-string image.tag=${version}-${commit}
//"""
//}
//}
//}
//}
stage('Deploy to overture-qa') {
when {
branch "develop"
}
steps {
build(job: "/Overture.bio/provision/helm", parameters: [
[$class: 'StringParameterValue', name: 'OVERTURE_ENV', value: 'qa' ],
[$class: 'StringParameterValue', name: 'OVERTURE_CHART_NAME', value: 'dms-ui'],
[$class: 'StringParameterValue', name: 'OVERTURE_RELEASE_NAME', value: 'dms-ui'],
[$class: 'StringParameterValue', name: 'OVERTURE_HELM_CHART_VERSION', value: ''], // use latest
[$class: 'StringParameterValue', name: 'OVERTURE_HELM_REPO_URL', value: "https://overture-stack.github.io/charts-server/"],
[$class: 'StringParameterValue', name: 'OVERTURE_HELM_REUSE_VALUES', value: "false" ],
[$class: 'StringParameterValue', name: 'OVERTURE_ARGS_LINE', value: "--set-string image.tag=${version}-${commit}"]
])
}
}

stage('Deploy to overture-staging') {
when {
branch "master"
}
steps {
build(job: "/Overture.bio/provision/helm", parameters: [
[$class: 'StringParameterValue', name: 'OVERTURE_ENV', value: 'staging' ],
[$class: 'StringParameterValue', name: 'OVERTURE_CHART_NAME', value: 'dms-ui'],
[$class: 'StringParameterValue', name: 'OVERTURE_RELEASE_NAME', value: 'dms-ui'],
[$class: 'StringParameterValue', name: 'OVERTURE_HELM_CHART_VERSION', value: ''], // use latest
[$class: 'StringParameterValue', name: 'OVERTURE_HELM_REPO_URL', value: "https://overture-stack.github.io/charts-server/"],
[$class: 'StringParameterValue', name: 'OVERTURE_HELM_REUSE_VALUES', value: "false" ],
[$class: 'StringParameterValue', name: 'OVERTURE_ARGS_LINE', value: "--set-string image.tag=${version}"]
])
}
}

//stage('Deploy to overture-staging') {
//when {
//branch "master"
//}
//steps {
//container('helm') {
//withCredentials([file(credentialsId:'4ed1e45c-b552-466b-8f86-729402993e3b', variable: 'KUBECONFIG')]) {
//sh 'env'
//sh 'helm init --client-only'
//sh "helm ls --kubeconfig $KUBECONFIG"
//sh "helm repo add overture https://overture-stack.github.io/charts-server/"
//sh """
//helm upgrade --kubeconfig $KUBECONFIG --install --namespace=overture-qa ego \\
//overture/ego --reuse-values --set-string image.tag=${version}
//"""
//}
//}
//}
//}
}
post {
unsuccessful {
Expand Down
2 changes: 2 additions & 0 deletions components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ const Footer = () => {
justify-content: flex-end;
align-items: center;
padding-right: 18px;
${theme.shadow.default};
z-index: 10;
`}
>
<StyledLink
Expand Down
2 changes: 2 additions & 0 deletions components/PageLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { css } from '@emotion/core';

import defaultTheme from './theme';
import NavBar from './NavBar';
import Footer from './Footer';

const PageLayout = ({ children }: { children: React.ReactNode }) => {
return (
Expand All @@ -18,6 +19,7 @@ const PageLayout = ({ children }: { children: React.ReactNode }) => {
>
<NavBar />
{children}
<Footer />
</div>
);
};
Expand Down
9 changes: 6 additions & 3 deletions components/pages/login/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@ const LoginButton = ({
title: string;
path: string;
}) => {
const { EGO_API_ROOT, EGO_CLIENT_ID } = getConfig();
const url = `${urlJoin(EGO_API_ROOT, '/oauth/login', path)}?client_id=${EGO_CLIENT_ID}`;
const { NEXT_PUBLIC_EGO_API_ROOT, NEXT_PUBLIC_EGO_CLIENT_ID } = getConfig();
const url = `${urlJoin(
NEXT_PUBLIC_EGO_API_ROOT,
'/oauth/login',
path,
)}?client_id=${NEXT_PUBLIC_EGO_CLIENT_ID}`;
const disabled = !path;
return (
<a
Expand Down Expand Up @@ -97,7 +101,6 @@ const LoginPage = () => {
flex: 1;
flex-direction: row;
position: relative;
min-width: 1440px;
`}
>
<div
Expand Down
3 changes: 1 addition & 2 deletions components/pages/repository/PageContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ const PageContent = (props: PageContentProps) => {
min-width: 250px;
max-width: 270px;
background-color: ${theme.colors.white};
${theme.shadow.default}
z-index: 1;
${theme.shadow.right};
`}
>
<Facets {...props} />
Expand All @@ -60,7 +60,6 @@ const PageContent = (props: PageContentProps) => {
<QueryBar {...props} />
<RepoTable {...props} />
</div>
<Footer />
</div>
</div>
</div>
Expand Down
30 changes: 21 additions & 9 deletions components/pages/repository/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import PageLayout from '../../PageLayout';
import { RepoFiltersType } from './sqonTypes';
import { getConfig } from '../../../global/config';
import { css } from '@emotion/core';
import createArrangerFetcher from '../../utils/arrangerFetcher';

const Arranger = dynamic(
() => import('@arranger/components/dist/Arranger').then((comp) => comp.Arranger),
Expand Down Expand Up @@ -33,13 +34,23 @@ export interface PageContentProps {
fetchData?: (projectId: string) => Promise<any>;
}

const arrangerFetcher = createArrangerFetcher({});

const RepositoryPage = () => {
const { ARRANGER_PROJECT_ID, ARRANGER_GRAPHQL_FIELD, ARRANGER_INDEX } = getConfig();
const {
NEXT_PUBLIC_ARRANGER_PROJECT_ID,
NEXT_PUBLIC_ARRANGER_GRAPHQL_FIELD,
NEXT_PUBLIC_ARRANGER_INDEX,
} = getConfig();

return (
<PageLayout>
{/* TODO: arranger config error handling tbd */}
{!(ARRANGER_PROJECT_ID && ARRANGER_GRAPHQL_FIELD && ARRANGER_INDEX) ? (
{!(
NEXT_PUBLIC_ARRANGER_PROJECT_ID &&
NEXT_PUBLIC_ARRANGER_GRAPHQL_FIELD &&
NEXT_PUBLIC_ARRANGER_INDEX
) ? (
<div
css={css`
display: flex;
Expand All @@ -56,19 +67,20 @@ const RepositoryPage = () => {
`
}
>
Arranger is missing configuration values. Please check your ".env.local" file.
Arranger is missing configuration values. Please check your ".env" file.
<ul>
<li>Project ID: {ARRANGER_PROJECT_ID || 'missing'}</li>
<li>GraphQL Field: {ARRANGER_GRAPHQL_FIELD || 'missing'}</li>
<li>Index: {ARRANGER_INDEX || 'missing'}</li>
<li>Project ID: {NEXT_PUBLIC_ARRANGER_PROJECT_ID || 'missing'}</li>
<li>GraphQL Field: {NEXT_PUBLIC_ARRANGER_GRAPHQL_FIELD || 'missing'}</li>
<li>Index: {NEXT_PUBLIC_ARRANGER_INDEX || 'missing'}</li>
</ul>
</div>
</div>
) : (
<Arranger
projectId={ARRANGER_PROJECT_ID}
graphqlField={ARRANGER_GRAPHQL_FIELD}
index={ARRANGER_INDEX}
api={arrangerFetcher}
projectId={NEXT_PUBLIC_ARRANGER_PROJECT_ID}
graphqlField={NEXT_PUBLIC_ARRANGER_GRAPHQL_FIELD}
index={NEXT_PUBLIC_ARRANGER_INDEX}
render={(props: PageContentProps) => {
return <PageContent {...props} />;
}}
Expand Down
5 changes: 5 additions & 0 deletions components/theme/shadow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ const defaultShadow = `
box-shadow: 0 1px 6px 0 rgba(0, 0, 0, 0.1), 0 1px 5px 0 rgba(0, 0, 0, 0.08);
`;

const rightShadow = `
box-shadow: 3px 0 5px -2px rgba(0, 0, 0, 0.1), 3px 0 5px -2px rgba(0, 0, 0, 0.08);
`;

export default {
default: defaultShadow,
right: rightShadow,
};
25 changes: 25 additions & 0 deletions components/utils/ajax.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/***************
Arranger does not work with fetch lib right out of the box, so using this implementation from
https://github.com/IHCC-cohorts/ihcc-ui/blob/develop/src/pages/cohortRepo/arrangerFetcher/ajax.ts
for now
***************/

import axios from 'axios';

const ajax = axios.create();

ajax.interceptors.request.use(
(config) => {
// set Authorization headers on a per request basis
// setting headers on axios get/put/post or common seems to be shared accross all axios instances
config.headers = {
...config.headers,
};
return config;
},
(err) => {
return Promise.reject(err);
},
);

export default ajax;
27 changes: 27 additions & 0 deletions components/utils/arrangerFetcher.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import urlJoin from 'url-join';
import { getConfig } from '../../global/config';
import ajax from './ajax';

const createArrangerFetcher = ({
onError = (err: any) => Promise.reject(err),
defaultHeaders = {},
} = {}) => ({ method = 'post', body = {}, headers = {} }) => {
const { NEXT_PUBLIC_ARRANGER_API, NEXT_PUBLIC_ARRANGER_PROJECT_ID } = getConfig();
const uri = urlJoin(NEXT_PUBLIC_ARRANGER_API, NEXT_PUBLIC_ARRANGER_PROJECT_ID, '/graphql');
return ajax
.post(uri, body, {
headers: {
'Content-Type': 'application/json',
...(defaultHeaders || {}),
...headers,
},
})
.then((response: { data: any }) => {
return response.data;
})
.catch((err: { response: any }) => {
return onError(err);
});
};

export default createArrangerFetcher;
Loading