Skip to content

Commit

Permalink
update: get env var and add ci/cd
Browse files Browse the repository at this point in the history
  • Loading branch information
th1460 committed May 10, 2021
1 parent a07d77f commit dcf6003
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 6 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/deploy-cf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Deploy to IBM Cloud Foundry
on:
push:
branches: [ master ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Deploy to IBM Cloud Foundry
# You may pin to the exact commit or the version.
uses: IBM/cloudfoundry-deploy@master
with:
IBM_CLOUD_API_KEY: ${{ secrets.IBM_CLOUD_API_KEY }}
IBM_CLOUD_CF_API: ${{ secrets.IBM_CLOUD_CF_API }}
IBM_CLOUD_CF_ORG: ${{ secrets.IBM_CLOUD_CF_ORG }}
IBM_CLOUD_CF_SPACE: ${{ secrets.IBM_CLOUD_CF_SPACE }}
3 changes: 0 additions & 3 deletions Dockerfile.app
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ EXPOSE 8080
# Copy further configuration files into the Docker image
COPY shiny-server.sh /usr/bin/shiny-server.sh

# Copy environment variables
COPY .Renviron /srv/shiny-server/

# Jar file
COPY jars /srv/shiny-server/jars

Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,9 @@ docker push th1460/dash-covid
# Deploy shiny
ibmcloud cf push dash-covid --docker-image th1460/dash-covid -k 2G
```

## CI/CD

Reference to CI/CD used here:

https://github.com/marketplace/actions/deploy-to-ibm-cloud-foundry
2 changes: 0 additions & 2 deletions app.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ require(shiny)
require(magrittr)
require(thematic)

readRenviron(".Renviron")

drv <-
RJDBC::JDBC("com.ibm.db2.jcc.DB2Driver", "jars/db2jcc4.jar")

Expand Down
2 changes: 1 addition & 1 deletion manifest.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
applications:
- name: dash-covid
memory: 256M
memory: 384M
random-route: true
4 changes: 4 additions & 0 deletions shiny-server.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/sh

# Get environment variables
env | grep 'DB2' > /home/shiny/.Renviron
chown shiny.shiny /home/shiny/.Renviron

# Make sure the directory for individual app logs exists
mkdir -p /var/log/shiny-server
chown shiny.shiny /var/log/shiny-server
Expand Down

0 comments on commit dcf6003

Please sign in to comment.