Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
EUbOPEN Web
Manage
Activity
Members
Labels
Plan
Issues
15
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ChEMBL
EUbOPEN
EUbOPEN Web
Commits
37e8f5c8
Commit
37e8f5c8
authored
3 years ago
by
David Mendez
Browse files
Options
Downloads
Patches
Plain Diff
Debug Build
parent
895c2575
No related branches found
Branches containing commit
No related tags found
1 merge request
!50
Do npm build when creating container image
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+32
-34
32 additions, 34 deletions
.gitlab-ci.yml
with
32 additions
and
34 deletions
.gitlab-ci.yml
+
32
−
34
View file @
37e8f5c8
...
...
@@ -23,7 +23,7 @@ variables:
stages
:
-
prepare_config
-
build
#
- deploy
-
deploy
# ----------------------------------------------------------------------------------------------------------------------
# Prepare Configuration
...
...
@@ -107,39 +107,37 @@ build_staging:
# - echo 'Implement these tests!'
# # ----------------------------------------------------------------------------------------------------------------------
# # Deploy to staging
# # ----------------------------------------------------------------------------------------------------------------------
# deploy_to_staging:
# stage: deploy
# image:
# name: lachlanevenson/k8s-kubectl:latest
# entrypoint: ["/bin/sh", "-c"]
# only:
# - staging
# script:
# - set -x
# - echo "$KUBE_CA_PEM_HX" > "$(pwd)/kube.ca.pem"
# - kubectl config set-cluster ${KUBE_CLUS_NAME_HX} --server="${KUBE_URL_HX}" --certificate-authority="$(pwd)/kube.ca.pem"
# - kubectl config set-credentials ${KUBE_USER_HX} --token="${KUBE_TOKEN_HX}"
# - kubectl config set-context ${CHEMBL_NS_STAGING} --cluster=${KUBE_CLUS_NAME_HX} --user=${KUBE_USER_HX}
# - kubectl config use-context ${CHEMBL_NS_STAGING}
# - echo ${CHEMBL_NS_STAGING} ${KUBE_URL_HX} ${KUBE_CLUS_NAME_HX} ${KUBE_USER_HX}
# - kubectl get pods -n ${CHEMBL_NS_STAGING}
# - kubectl create secret generic ${ENV_SECRET_NAME_STAGING} --from-file=.env=${ENV_STAGING_FILE_PATH} -o yaml -n ${CHEMBL_NS_STAGING} --dry-run=client | kubectl replace -f -
# - cat ${ENV_STAGING_FILE_PATH}
# - sed -i "s~<NAMESPACE>~${CHEMBL_NS_STAGING}~g" k8s-deployment.yaml
# - sed -i "s~<HTTP_PROXY>~${HTTP_PROXY_HX}~g" k8s-deployment.yaml
# - sed -i "s~<HTTPS_PROXY>~${HTTPS_PROXY_HX}~g" k8s-deployment.yaml
# - sed -i "s~<NO_PROXY>~${NO_PROXY_HX_DEFAULT}~g" k8s-deployment.yaml
# - sed -i "s~<SERVER_IMAGE_TAG>~${SERVER_IMAGE_TAG}~g" k8s-deployment.yaml
# - sed -i "s~<ENV_SECRET_NAME>~${ENV_SECRET_NAME_STAGING}~g" k8s-deployment.yaml
# - sed -i "s~<NODE_PORT>~${EUBOPEN_WEB_PORT_STAGING}~" k8s-deployment.yaml
# - cat k8s-deployment.yaml
# - kubectl apply -n ${CHEMBL_NS_STAGING} -f k8s-deployment.yaml
# - kubectl get pods -n ${CHEMBL_NS_STAGING}
# ----------------------------------------------------------------------------------------------------------------------
# Deploy to staging
# ----------------------------------------------------------------------------------------------------------------------
deploy_to_staging
:
stage
:
deploy
image
:
name
:
lachlanevenson/k8s-kubectl:latest
entrypoint
:
[
"
/bin/sh"
,
"
-c"
]
only
:
-
staging
script
:
-
set -x
-
echo "$KUBE_CA_PEM_HX" > "$(pwd)/kube.ca.pem"
-
kubectl config set-cluster ${KUBE_CLUS_NAME_HX} --server="${KUBE_URL_HX}" --certificate-authority="$(pwd)/kube.ca.pem"
-
kubectl config set-credentials ${KUBE_USER_HX} --token="${KUBE_TOKEN_HX}"
-
kubectl config set-context ${CHEMBL_NS_STAGING} --cluster=${KUBE_CLUS_NAME_HX} --user=${KUBE_USER_HX}
-
kubectl config use-context ${CHEMBL_NS_STAGING}
-
echo ${CHEMBL_NS_STAGING} ${KUBE_URL_HX} ${KUBE_CLUS_NAME_HX} ${KUBE_USER_HX}
-
kubectl get pods -n ${CHEMBL_NS_STAGING}
-
kubectl create secret generic ${ENV_SECRET_NAME_STAGING} --from-file=.env=${ENV_STAGING_FILE_PATH} -o yaml -n ${CHEMBL_NS_STAGING} --dry-run=client | kubectl replace -f -
-
cat ${ENV_STAGING_FILE_PATH}
-
sed -i "s~<NAMESPACE>~${CHEMBL_NS_STAGING}~g" k8s-deployment.yaml
-
sed -i "s~<HTTP_PROXY>~${HTTP_PROXY_HX}~g" k8s-deployment.yaml
-
sed -i "s~<HTTPS_PROXY>~${HTTPS_PROXY_HX}~g" k8s-deployment.yaml
-
sed -i "s~<NO_PROXY>~${NO_PROXY_HX_DEFAULT}~g" k8s-deployment.yaml
-
sed -i "s~<SERVER_IMAGE_TAG>~${SERVER_IMAGE_TAG_LATEST_STAGING}~g" k8s-deployment.yaml
-
sed -i "s~<ENV_SECRET_NAME>~${ENV_SECRET_NAME_STAGING}~g" k8s-deployment.yaml
-
sed -i "s~<NODE_PORT>~${EUBOPEN_WEB_PORT_STAGING}~" k8s-deployment.yaml
-
cat k8s-deployment.yaml
-
kubectl apply -n ${CHEMBL_NS_STAGING} -f k8s-deployment.yaml
-
kubectl get pods -n ${CHEMBL_NS_STAGING}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment