From 824f563e79113d17fc039d9ff3b3a5c758537ec2 Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Wed, 15 Jul 2020 13:06:20 +0200 Subject: [PATCH 01/46] login to az --- .github/workflows/main.yaml | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index cd93a48..1092a02 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -48,26 +48,10 @@ jobs: tags: ${{ github.sha }} add_git_labels: true push: ${{ github.event_name != 'pull_request' }} - - name: Setup GCP Cloud SDK - uses: GoogleCloudPlatform/github-actions/setup-gcloud@master + - name: Login to Azure + uses: azure/login@v1.1 with: - project_id: ${{ secrets.GCP_PROJECT_ID }} - service_account_key: ${{ secrets.GCP_SA_KEY }} - export_default_credentials: true - - run: gcloud info - shell: bash - - name: Deploy Shiny Application to shinyapps.io ref - env: - SHINYAPPS_TOKEN: ${{ secrets.SHINYAPPS_TOKEN }} - SHINYAPPS_SECRET: ${{ secrets.SHINYAPPS_SECRET }} - GITHUB_REF: ${{ github.ref }} - if: github.event_name != 'pull_request' - run: | - remotes::install_github(repo = "subugoe/hoad", ref = "master", force = TRUE, dependencies = TRUE) - rsconnect::setAccountInfo(name = 'subugoe', token = Sys.getenv('SHINYAPPS_TOKEN'), secret = Sys.getenv('SHINYAPPS_SECRET')) - app_name <- paste0("hoad-", gsub("/", "-", Sys.getenv('GITHUB_REF'))) - rsconnect::deployDoc(doc = "inst/app/dashboard.Rmd", appName = app_name) - shell: Rscript {0} + creds: ${{ secrets.AZURE_CREDENTIALS }} - name: Deploy to GitHub Pages if: github.ref == 'refs/heads/master' uses: maxheld83/ghpages@github-token From 0e4985610de9cfd55fdd84dcea6a4931072720a7 Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Wed, 15 Jul 2020 16:44:11 +0200 Subject: [PATCH 02/46] first install az --- .github/workflows/main.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 1092a02..cd0118a 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -48,7 +48,13 @@ jobs: tags: ${{ github.sha }} add_git_labels: true push: ${{ github.event_name != 'pull_request' }} - - name: Login to Azure + # here are instructions for minimally scoped auth https://github.com/Azure/webapps-container-deploy + - name: Install Azure CLI + uses: azure/CLI@v1 + with: + inlineScript: | + which az + - name: Log-in to Azure uses: azure/login@v1.1 with: creds: ${{ secrets.AZURE_CREDENTIALS }} From 1cb456c70f87e8de471341859abbc5ac95b8b02e Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Wed, 15 Jul 2020 17:04:16 +0200 Subject: [PATCH 03/46] auth in separate job --- .github/workflows/main.yaml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index cd0118a..1caa4c0 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -48,19 +48,19 @@ jobs: tags: ${{ github.sha }} add_git_labels: true push: ${{ github.event_name != 'pull_request' }} - # here are instructions for minimally scoped auth https://github.com/Azure/webapps-container-deploy - - name: Install Azure CLI - uses: azure/CLI@v1 - with: - inlineScript: | - which az - - name: Log-in to Azure - uses: azure/login@v1.1 - with: - creds: ${{ secrets.AZURE_CREDENTIALS }} - name: Deploy to GitHub Pages if: github.ref == 'refs/heads/master' uses: maxheld83/ghpages@github-token env: BUILD_DIR: docs GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + azure: + needs: CICD + runs-on: ubuntu-latest + if: ${{ github.event_name != 'pull_request' }} + steps: + # here are instructions for minimally scoped auth https://github.com/Azure/webapps-container-deploy + - name: Log-in to Azure + uses: azure/login@v1.1 + with: + creds: ${{ secrets.AZURE_CREDENTIALS }} From 4cea5a92a03f9826ccbc40bb87404b13e138203c Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Wed, 15 Jul 2020 17:19:41 +0200 Subject: [PATCH 04/46] also deploy --- .github/workflows/main.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 1caa4c0..5ae784a 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -64,3 +64,9 @@ jobs: uses: azure/login@v1.1 with: creds: ${{ secrets.AZURE_CREDENTIALS }} + - name: Deploy to Azure Web Apps for Containers + uses: azure/webapps-deploy@v2 + with: + app-name: hoad + uses: azure/webapps-deploy@v2 + images: docker.pkg.github.com/${{ github.repository }}/hoad-dev:${{ github.ref }} From cbefae36f0dfc94c70c5752e7bbfade6291bda27 Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Wed, 15 Jul 2020 17:22:24 +0200 Subject: [PATCH 05/46] first log in to github pkg registry --- .github/workflows/main.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 5ae784a..e40075e 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -60,10 +60,16 @@ jobs: if: ${{ github.event_name != 'pull_request' }} steps: # here are instructions for minimally scoped auth https://github.com/Azure/webapps-container-deploy - - name: Log-in to Azure + - name: Log in to Azure uses: azure/login@v1.1 with: creds: ${{ secrets.AZURE_CREDENTIALS }} + - name: Log in to GitHub Package Registry + uses: azure/docker-login@v1 + with: + login-server: docker.pkg.github.com + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Deploy to Azure Web Apps for Containers uses: azure/webapps-deploy@v2 with: From 4856123f866fc5f7182af1e002c3fd3cea4a896c Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Wed, 15 Jul 2020 17:26:16 +0200 Subject: [PATCH 06/46] poke ghactions --- .github/workflows/main.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index e40075e..09e0ddc 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -1,5 +1,4 @@ -on: - push: +on: push jobs: CICD: From d5d06447d37af30d5298d8a77ae9b6089b7ab7e2 Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Thu, 16 Jul 2020 18:42:02 +0200 Subject: [PATCH 07/46] fix yaml --- .github/workflows/main.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 09e0ddc..f2f749c 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -73,5 +73,4 @@ jobs: uses: azure/webapps-deploy@v2 with: app-name: hoad - uses: azure/webapps-deploy@v2 images: docker.pkg.github.com/${{ github.repository }}/hoad-dev:${{ github.ref }} From 5a9e368db02060c68feb13cfbaed4d663f9b1516 Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Thu, 16 Jul 2020 19:16:58 +0200 Subject: [PATCH 08/46] fix tag --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index f2f749c..4abb4f0 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -73,4 +73,4 @@ jobs: uses: azure/webapps-deploy@v2 with: app-name: hoad - images: docker.pkg.github.com/${{ github.repository }}/hoad-dev:${{ github.ref }} + images: docker.pkg.github.com/${{ github.repository }}/hoad-dev:azure From 5e60c1570ca196ce1ec5fe05ff1650f3077a35da Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Thu, 16 Jul 2020 19:43:00 +0200 Subject: [PATCH 09/46] set entrypoint and pkg.github.com creds #245 --- .github/workflows/main.yaml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 4abb4f0..e1f8689 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -69,8 +69,31 @@ jobs: login-server: docker.pkg.github.com username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Auth Azure for GitHub Package Registry + uses: azure/appservice-settings@v1 + with: + app-name: hoad + general-settings-json: | + [ + { + "name": "DOCKER_REGISTRY_SERVER_PASSWORD", + "value": "${{ secrets.GITHUB_TOKEN }}", + "slotSetting": false + }, + { + "name": "DOCKER_REGISTRY_SERVER_URL", + "value": "https://docker.pkg.github.com", + "slotSetting": false + }, + { + "name": "DOCKER_REGISTRY_SERVER_USERNAME", + "value": "${{ github.actor }}", + "slotSetting": false + } + ] - name: Deploy to Azure Web Apps for Containers uses: azure/webapps-deploy@v2 with: app-name: hoad images: docker.pkg.github.com/${{ github.repository }}/hoad-dev:azure + startup-command: Rscript -e "hoad::runHOAD(shiny_args = list(port = 80, host = '0.0.0.0'))" From 13efdcc5436989e64ba7b2120b3d69374761b7db Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Thu, 16 Jul 2020 19:56:42 +0200 Subject: [PATCH 10/46] just update app settings #245 --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index e1f8689..6a46c2b 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -73,7 +73,7 @@ jobs: uses: azure/appservice-settings@v1 with: app-name: hoad - general-settings-json: | + app-settings-json: | [ { "name": "DOCKER_REGISTRY_SERVER_PASSWORD", From 00ba9abd53624a3945bceb4dbf029cce2b6a2512 Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Thu, 16 Jul 2020 20:18:37 +0200 Subject: [PATCH 11/46] fix image name --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 6a46c2b..fbddab0 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -95,5 +95,5 @@ jobs: uses: azure/webapps-deploy@v2 with: app-name: hoad - images: docker.pkg.github.com/${{ github.repository }}/hoad-dev:azure + images: ${{ github.repository }}/hoad-dev:azure startup-command: Rscript -e "hoad::runHOAD(shiny_args = list(port = 80, host = '0.0.0.0'))" From 2385b720743832942c5f2e98aa9e5561bd2bda46 Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Thu, 16 Jul 2020 22:32:49 +0200 Subject: [PATCH 12/46] try out deploy --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index fbddab0..22c3355 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -48,7 +48,7 @@ jobs: add_git_labels: true push: ${{ github.event_name != 'pull_request' }} - name: Deploy to GitHub Pages - if: github.ref == 'refs/heads/master' + # if: github.ref == 'refs/heads/master' uses: maxheld83/ghpages@github-token env: BUILD_DIR: docs From d80acb7346dfb7263c1f6d4a34a12b578f039454 Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Fri, 17 Jul 2020 18:18:22 +0200 Subject: [PATCH 13/46] add init.sh for azure #245 --- .Rbuildignore | 1 + .dockerignore | 1 + Dockerfile | 4 ++++ init.sh | 4 ++++ 4 files changed, 10 insertions(+) create mode 100755 init.sh diff --git a/.Rbuildignore b/.Rbuildignore index a7a8699..ed262cf 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -17,3 +17,4 @@ hoad.code-workspace ^R/.scoap\.R$ ^R/.unpaywall_integration\.R$ .vscode +init.sh diff --git a/.dockerignore b/.dockerignore index 9226438..3dc2e48 100644 --- a/.dockerignore +++ b/.dockerignore @@ -6,3 +6,4 @@ !/NAMESPACE !/LICENSE.md !/.Rbuildignore +!/init.sh diff --git a/Dockerfile b/Dockerfile index 5ea4d89..a9985d3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1 +1,5 @@ FROM subugoe/muggle-onbuild:f60004c31979947dab53fbf9cfbb0e7f1c4bea55 +COPY init.sh /usr/local/bin/ +# TODO this can move inside of the copy command once that feature goes mainline in docker +RUN ["sh", "-c", "chmod u+x /usr/local/bin/init.sh"] +EXPOSE 80 diff --git a/init.sh b/init.sh new file mode 100755 index 0000000..4f8c311 --- /dev/null +++ b/init.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -e + +Rscript -e "hoad::runHOAD(shiny_args = list(port = 80, host = '0.0.0.0'))" From 6b4f5c55ca8b5188d2ea8eef402f445a950312bc Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Mon, 20 Jul 2020 15:52:04 +0200 Subject: [PATCH 14/46] auth against azure --- .Rbuildignore | 2 +- .azure/azure.sh | 11 +++++++++++ init.sh => .azure/init.sh | 0 .dockerignore | 2 +- .github/workflows/main.yaml | 38 +++---------------------------------- Dockerfile | 2 +- man/path_extdat.Rd | 2 +- 7 files changed, 18 insertions(+), 39 deletions(-) create mode 100644 .azure/azure.sh rename init.sh => .azure/init.sh (100%) diff --git a/.Rbuildignore b/.Rbuildignore index ed262cf..1971e5e 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -17,4 +17,4 @@ hoad.code-workspace ^R/.scoap\.R$ ^R/.unpaywall_integration\.R$ .vscode -init.sh +.azure diff --git a/.azure/azure.sh b/.azure/azure.sh new file mode 100644 index 0000000..d1381fe --- /dev/null +++ b/.azure/azure.sh @@ -0,0 +1,11 @@ +SUBSCRIPTION_ID="f0dd3a37-0a4e-4e7f-9c9b-cb9f60146edc" +RESOURCE_GROUP="hoad" + +# script to set up privilege json, stored on GitHub as a AZURE_CREDENTIALS secret +# https://github.com/Azure/login +# here are instructions for minimally scoped auth https://github.com/Azure/webapps-container-deploy +az ad sp create-for-rbac \ + --name "https://github.com/subugoe/hoad" \ + --role contributor \ + --scopes /subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCE_GROUP \ + --sdk-auth diff --git a/init.sh b/.azure/init.sh similarity index 100% rename from init.sh rename to .azure/init.sh diff --git a/.dockerignore b/.dockerignore index 3dc2e48..03ea293 100644 --- a/.dockerignore +++ b/.dockerignore @@ -6,4 +6,4 @@ !/NAMESPACE !/LICENSE.md !/.Rbuildignore -!/init.sh +!/.azure/init.sh diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 22c3355..69dbfb9 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -58,42 +58,10 @@ jobs: runs-on: ubuntu-latest if: ${{ github.event_name != 'pull_request' }} steps: - # here are instructions for minimally scoped auth https://github.com/Azure/webapps-container-deploy - name: Log in to Azure uses: azure/login@v1.1 with: creds: ${{ secrets.AZURE_CREDENTIALS }} - - name: Log in to GitHub Package Registry - uses: azure/docker-login@v1 - with: - login-server: docker.pkg.github.com - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Auth Azure for GitHub Package Registry - uses: azure/appservice-settings@v1 - with: - app-name: hoad - app-settings-json: | - [ - { - "name": "DOCKER_REGISTRY_SERVER_PASSWORD", - "value": "${{ secrets.GITHUB_TOKEN }}", - "slotSetting": false - }, - { - "name": "DOCKER_REGISTRY_SERVER_URL", - "value": "https://docker.pkg.github.com", - "slotSetting": false - }, - { - "name": "DOCKER_REGISTRY_SERVER_USERNAME", - "value": "${{ github.actor }}", - "slotSetting": false - } - ] - - name: Deploy to Azure Web Apps for Containers - uses: azure/webapps-deploy@v2 - with: - app-name: hoad - images: ${{ github.repository }}/hoad-dev:azure - startup-command: Rscript -e "hoad::runHOAD(shiny_args = list(port = 80, host = '0.0.0.0'))" + - name: test + run: | + az webapp list --query "[?state=='Running']" diff --git a/Dockerfile b/Dockerfile index a9985d3..b216aaf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM subugoe/muggle-onbuild:f60004c31979947dab53fbf9cfbb0e7f1c4bea55 -COPY init.sh /usr/local/bin/ +COPY .azure/init.sh /usr/local/bin/ # TODO this can move inside of the copy command once that feature goes mainline in docker RUN ["sh", "-c", "chmod u+x /usr/local/bin/init.sh"] EXPOSE 80 diff --git a/man/path_extdat.Rd b/man/path_extdat.Rd index 6a35761..e62cc76 100644 --- a/man/path_extdat.Rd +++ b/man/path_extdat.Rd @@ -10,7 +10,7 @@ path_extdat(x) \item{x}{\verb{[character(1)]} giving the filename or path to the file from \verb{inst/extdata/}} } \value{ -\verb{[character(1)]} giving the absolute path to \code{x}, as returned by \code{\link[fs:path_abs]{fs::path_abs()}}. +\verb{[character(1)]} giving the absolute path to \code{x}, as returned by \code{\link[fs:path_math]{fs::path_abs()}}. } \description{ Looks for \verb{inst/} in the working directory, otherwise wraps \code{\link[fs:path_package]{fs::path_package()}} with appropriate defaults for this package. From b2cb999c8271e10301a9d3100a503397feff69df Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Mon, 20 Jul 2020 21:30:28 +0200 Subject: [PATCH 15/46] deploy to azure programmatically #245 --- .azure/azure.sh | 11 -------- .azure/deploy.sh | 51 +++++++++++++++++++++++++++++++++++++ .github/workflows/main.yaml | 5 ++-- 3 files changed, 53 insertions(+), 14 deletions(-) delete mode 100644 .azure/azure.sh create mode 100755 .azure/deploy.sh diff --git a/.azure/azure.sh b/.azure/azure.sh deleted file mode 100644 index d1381fe..0000000 --- a/.azure/azure.sh +++ /dev/null @@ -1,11 +0,0 @@ -SUBSCRIPTION_ID="f0dd3a37-0a4e-4e7f-9c9b-cb9f60146edc" -RESOURCE_GROUP="hoad" - -# script to set up privilege json, stored on GitHub as a AZURE_CREDENTIALS secret -# https://github.com/Azure/login -# here are instructions for minimally scoped auth https://github.com/Azure/webapps-container-deploy -az ad sp create-for-rbac \ - --name "https://github.com/subugoe/hoad" \ - --role contributor \ - --scopes /subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCE_GROUP \ - --sdk-auth diff --git a/.azure/deploy.sh b/.azure/deploy.sh new file mode 100755 index 0000000..b937acf --- /dev/null +++ b/.azure/deploy.sh @@ -0,0 +1,51 @@ +#!/usr/bin/env bash +set -e + +SUBSCRIPTION_ID="f0dd3a37-0a4e-4e7f-9c9b-cb9f60146edc" +RESOURCE_GROUP="hoad" +WEBAPP_NAME="hoad" +IMAGE_TAG="azure" + +# script to set up privilege json, stored on GitHub as a AZURE_CREDENTIALS secret +# https://github.com/Azure/login +# here are instructions for minimally scoped auth https://github.com/Azure/webapps-container-deploy +# az ad sp create-for-rbac \ +# --name "https://github.com/subugoe/hoad" \ +# --role contributor \ +# --scopes /subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCE_GROUP \ +# --sdk-auth + +echo "Setting defaults ..." +az account set --subscription $SUBSCRIPTION_ID +az configure \ + --defaults group=$RESOURCE_GROUP web=$WEBAPP_NAME + +echo "Enabling arr client affinity ..." +# for some reason, this is not part of the webapp config, though it is on portal.azure.com +az webapp update \ + --client-affinity-enabled true + +echo "Setting web app configuration ..." +az webapp config set \ + --always-on true \ + --ftps-state disabled \ + --web-sockets-enabled true \ + --http20-enabled false \ + --startup-file init.sh + +echo "Setting container configuration ..." +az webapp config container set \ + --docker-custom-image-name docker.pkg.github.com/subugoe/hoad/hoad-dev:$IMAGE_TAG \ + --docker-registry-server-url https://docker.pkg.github.com \ + --docker-registry-server-user maxheld83 \ + --enable-app-service-storage false +# DOCKER_REGISTRY_SERVER_PASSWORD is a GH PAT set on portal.azure.com + +echo "Disable Docker CI ..." +# weirdly this cannot be set in the above +az webapp config appsettings set \ + --settings DOCKER_ENABLE_CI=false + +# TODO might not be necessary +echo "Restarting web app ..." +az webapp restart diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 69dbfb9..ce45557 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -62,6 +62,5 @@ jobs: uses: azure/login@v1.1 with: creds: ${{ secrets.AZURE_CREDENTIALS }} - - name: test - run: | - az webapp list --query "[?state=='Running']" + - name: Deploy to Azure + run: .azure/deploy.sh From dc1af997723390bfd7763d06898e08ce58030afc Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Mon, 20 Jul 2020 21:42:19 +0200 Subject: [PATCH 16/46] checkout for azure #245 --- .github/workflows/main.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index ce45557..e1f4a4e 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -58,6 +58,7 @@ jobs: runs-on: ubuntu-latest if: ${{ github.event_name != 'pull_request' }} steps: + - uses: actions/checkout@v2 - name: Log in to Azure uses: azure/login@v1.1 with: From 362d1685492b4876482662b30963457951cd573f Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Tue, 21 Jul 2020 09:21:11 +0200 Subject: [PATCH 17/46] test changes to dashboard on azure #245 --- inst/app/dashboard.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/app/dashboard.Rmd b/inst/app/dashboard.Rmd index bc6e64f..10badd0 100644 --- a/inst/app/dashboard.Rmd +++ b/inst/app/dashboard.Rmd @@ -124,7 +124,7 @@ if (length(unique(jn_f()$publisher)) > 1) { # }) ``` -Notice that only those hybrid open access journals were included where +Notice we here only include those hybrid open access journals were included where academic institutions sponsored the open access publication according to the [Open APC initiative](https://github.com/openapc/openapc-de) and where publishers shared license information about immediate open access with [Crossref](https://github.com/CrossRef/rest-api-doc). From caa5c925db1e2fb307219c03457ce0d60ce83032 Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Tue, 21 Jul 2020 09:28:18 +0200 Subject: [PATCH 18/46] embed shiny on azure in pkgdown #245 --- vignettes/interactive.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vignettes/interactive.Rmd b/vignettes/interactive.Rmd index 57a2213..30ab994 100644 --- a/vignettes/interactive.Rmd +++ b/vignettes/interactive.Rmd @@ -29,6 +29,6 @@ footer{
-
From 9278766eb994b9a84f6ed35c751287b6810e582a Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Tue, 21 Jul 2020 18:39:31 +0200 Subject: [PATCH 19/46] only push to ghpages from master --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index e1f4a4e..e294499 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -48,7 +48,7 @@ jobs: add_git_labels: true push: ${{ github.event_name != 'pull_request' }} - name: Deploy to GitHub Pages - # if: github.ref == 'refs/heads/master' + if: github.ref == 'refs/heads/master' uses: maxheld83/ghpages@github-token env: BUILD_DIR: docs From 502e2c388dc21abfc7ae49dc3305fefcf05d0804 Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Mon, 17 Aug 2020 23:43:35 +0200 Subject: [PATCH 20/46] upgrade hoad to shinycaas and muggle --- .azure/deploy.sh | 51 ------------------------------------- .azure/init.sh | 4 --- .github/workflows/main.yaml | 51 ++++++++++++++++++++++++------------- Dockerfile | 9 +++---- pkgdown/_pkgdown.yml | 1 + vignettes/interactive.Rmd | 33 +++--------------------- 6 files changed, 42 insertions(+), 107 deletions(-) delete mode 100755 .azure/deploy.sh delete mode 100755 .azure/init.sh diff --git a/.azure/deploy.sh b/.azure/deploy.sh deleted file mode 100755 index b937acf..0000000 --- a/.azure/deploy.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env bash -set -e - -SUBSCRIPTION_ID="f0dd3a37-0a4e-4e7f-9c9b-cb9f60146edc" -RESOURCE_GROUP="hoad" -WEBAPP_NAME="hoad" -IMAGE_TAG="azure" - -# script to set up privilege json, stored on GitHub as a AZURE_CREDENTIALS secret -# https://github.com/Azure/login -# here are instructions for minimally scoped auth https://github.com/Azure/webapps-container-deploy -# az ad sp create-for-rbac \ -# --name "https://github.com/subugoe/hoad" \ -# --role contributor \ -# --scopes /subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCE_GROUP \ -# --sdk-auth - -echo "Setting defaults ..." -az account set --subscription $SUBSCRIPTION_ID -az configure \ - --defaults group=$RESOURCE_GROUP web=$WEBAPP_NAME - -echo "Enabling arr client affinity ..." -# for some reason, this is not part of the webapp config, though it is on portal.azure.com -az webapp update \ - --client-affinity-enabled true - -echo "Setting web app configuration ..." -az webapp config set \ - --always-on true \ - --ftps-state disabled \ - --web-sockets-enabled true \ - --http20-enabled false \ - --startup-file init.sh - -echo "Setting container configuration ..." -az webapp config container set \ - --docker-custom-image-name docker.pkg.github.com/subugoe/hoad/hoad-dev:$IMAGE_TAG \ - --docker-registry-server-url https://docker.pkg.github.com \ - --docker-registry-server-user maxheld83 \ - --enable-app-service-storage false -# DOCKER_REGISTRY_SERVER_PASSWORD is a GH PAT set on portal.azure.com - -echo "Disable Docker CI ..." -# weirdly this cannot be set in the above -az webapp config appsettings set \ - --settings DOCKER_ENABLE_CI=false - -# TODO might not be necessary -echo "Restarting web app ..." -az webapp restart diff --git a/.azure/init.sh b/.azure/init.sh deleted file mode 100755 index 4f8c311..0000000 --- a/.azure/init.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash -set -e - -Rscript -e "hoad::runHOAD(shiny_args = list(port = 80, host = '0.0.0.0'))" diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 4730c7d..780a3b2 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -8,7 +8,7 @@ jobs: shell: Rscript {0} container: # this needs to be the same as in Dockerfile - image: subugoe/muggle-onbuild:f60004c31979947dab53fbf9cfbb0e7f1c4bea55 + image: subugoe/muggle-runtime-onbuild:9acfa4d9633250bdb85de69a803d426ecb7a14a1 steps: - uses: actions/checkout@v2 - name: Cache R Packages @@ -22,7 +22,7 @@ jobs: - name: Install R Dependencies env: # see builder.Dockerfile for explanation, this resets after this step - R_LIBS_SITE: $R_LIBS_APP_GH + R_LIBS_SITE: $R_LIBS_RUNTIME_GH run: remotes::install_deps(dependencies = TRUE) - name: Check run: muggle::rcmdcheck2() @@ -33,10 +33,11 @@ jobs: # extra step is necessary to build index.md to integrate readme and landing page rmarkdown::render("pkgdown/index.Rmd") pkgdown::build_site(override = list(new_process = FALSE)) - - uses: docker/build-push-action@v1 - name: Build Dev Image + - name: Build Buildtime Image + uses: docker/build-push-action@v1 with: - repository: ${{ github.repository }}/hoad-dev + repository: ${{ github.repository }}/hoad-buildtime + target: buildtime username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} registry: docker.pkg.github.com @@ -47,21 +48,37 @@ jobs: tags: ${{ github.sha }} add_git_labels: true push: ${{ github.event_name != 'pull_request' }} + - name: Build Runtime Image + uses: docker/build-push-action@v1 + with: + repository: ${{ github.repository }}/hoad-runtime + target: buildtime + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + registry: docker.pkg.github.com + # this will set "latest" if master as per https://github.com/docker/build-push-action + tag_with_ref: true + # we're relying on long shas only to keep things easy + tag_with_sha: false + tags: ${{ github.sha }} + add_git_labels: true + push: ${{ github.event_name != 'pull_request' }} + - name: Log in to Azure + uses: azure/login@v1.1 + with: + creds: ${{ secrets.AZURE_CREDENTIALS }} + - name: Deploy to Azure + run: | + shinycaas::az_webapp_config( + name = "hoad", + deployment_container_image_name = "docker.pkg.github.com/subugoe/shinycaas/oldfaithful:${{ github.sha }}", + plan = "hoad", + resource_group = "hoad", + subscription = "f0dd3a37-0a4e-4e7f-9c9b-cb9f60146edc" + ) - name: Deploy to GitHub Pages if: github.ref == 'refs/heads/master' uses: maxheld83/ghpages@github-token env: BUILD_DIR: docs GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - azure: - needs: CICD - runs-on: ubuntu-latest - if: ${{ github.event_name != 'pull_request' }} - steps: - - uses: actions/checkout@v2 - - name: Log in to Azure - uses: azure/login@v1.1 - with: - creds: ${{ secrets.AZURE_CREDENTIALS }} - - name: Deploy to Azure - run: .azure/deploy.sh diff --git a/Dockerfile b/Dockerfile index b216aaf..5db956d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,4 @@ -FROM subugoe/muggle-onbuild:f60004c31979947dab53fbf9cfbb0e7f1c4bea55 -COPY .azure/init.sh /usr/local/bin/ -# TODO this can move inside of the copy command once that feature goes mainline in docker -RUN ["sh", "-c", "chmod u+x /usr/local/bin/init.sh"] -EXPOSE 80 +ARG MUGGLE_TAG=9acfa4d9633250bdb85de69a803d426ecb7a14a1 +FROM subugoe/muggle-buildtime-onbuild:${MUGGLE_TAG} as buildtime +FROM subugoe/muggle-runtime-onbuild:${MUGGLE_TAG} as runtime +CMD shinycaas::az_webapp_shiny_opts(); hoad::runHOAD() diff --git a/pkgdown/_pkgdown.yml b/pkgdown/_pkgdown.yml index 0acde19..305051b 100644 --- a/pkgdown/_pkgdown.yml +++ b/pkgdown/_pkgdown.yml @@ -1,3 +1,4 @@ +url: https://subugoe.github.io/hoad/ authors: Najko Jahn: href: https://www.sub.uni-goettingen.de/kontakt/personen-a-z/personendetails/person/najko-jahn/ diff --git a/vignettes/interactive.Rmd b/vignettes/interactive.Rmd index 30ab994..f32617f 100644 --- a/vignettes/interactive.Rmd +++ b/vignettes/interactive.Rmd @@ -2,33 +2,6 @@ title: "Interactive Dashboard" --- - - - - - -
- -
+```{r echo=FALSE} +shinycaas::include_app2("https://hoad.azurewebsites.net") +``` From 31314c0c91dc24ec7636821b3c88a902e34fbc47 Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Mon, 17 Aug 2020 23:53:18 +0200 Subject: [PATCH 21/46] fix container --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 780a3b2..1774260 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -8,7 +8,7 @@ jobs: shell: Rscript {0} container: # this needs to be the same as in Dockerfile - image: subugoe/muggle-runtime-onbuild:9acfa4d9633250bdb85de69a803d426ecb7a14a1 + image: subugoe/muggle-buildtime-onbuild:9acfa4d9633250bdb85de69a803d426ecb7a14a1 steps: - uses: actions/checkout@v2 - name: Cache R Packages From 09177df3e10a42db7b9aad39cf7ec16458e801b2 Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Thu, 20 Aug 2020 18:55:56 +0200 Subject: [PATCH 22/46] factor out more deploy stuff --- .github/workflows/main.yaml | 18 ++++++++++++------ Dockerfile | 2 +- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 1774260..aab0425 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -8,7 +8,7 @@ jobs: shell: Rscript {0} container: # this needs to be the same as in Dockerfile - image: subugoe/muggle-buildtime-onbuild:9acfa4d9633250bdb85de69a803d426ecb7a14a1 + image: subugoe/muggle-buildtime-onbuild:a7876ed9ad79909bcf8ff04d1d8c30503bdb8b0a steps: - uses: actions/checkout@v2 - name: Cache R Packages @@ -52,7 +52,7 @@ jobs: uses: docker/build-push-action@v1 with: repository: ${{ github.repository }}/hoad-runtime - target: buildtime + target: runtime username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} registry: docker.pkg.github.com @@ -67,11 +67,11 @@ jobs: uses: azure/login@v1.1 with: creds: ${{ secrets.AZURE_CREDENTIALS }} - - name: Deploy to Azure + - name: Deploy to Azure Webapps + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - shinycaas::az_webapp_config( - name = "hoad", - deployment_container_image_name = "docker.pkg.github.com/subugoe/shinycaas/oldfaithful:${{ github.sha }}", + muggle::az_webapp_config_muggle( plan = "hoad", resource_group = "hoad", subscription = "f0dd3a37-0a4e-4e7f-9c9b-cb9f60146edc" @@ -82,3 +82,9 @@ jobs: env: BUILD_DIR: docs GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + sleep: + name: Sleep to let GITHUB_TOKEN persist + needs: CICD + runs-on: ubuntu-20.04 + steps: + - run: sleep 3m diff --git a/Dockerfile b/Dockerfile index 5db956d..85cf412 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG MUGGLE_TAG=9acfa4d9633250bdb85de69a803d426ecb7a14a1 +ARG MUGGLE_TAG=a7876ed9ad79909bcf8ff04d1d8c30503bdb8b0a FROM subugoe/muggle-buildtime-onbuild:${MUGGLE_TAG} as buildtime FROM subugoe/muggle-runtime-onbuild:${MUGGLE_TAG} as runtime CMD shinycaas::az_webapp_shiny_opts(); hoad::runHOAD() From e981ac24a3e48b2dc48fbd30a70f3088f752d84a Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Thu, 20 Aug 2020 19:35:21 +0200 Subject: [PATCH 23/46] invalidate cache and remove rsconnect --- DESCRIPTION | 1 - 1 file changed, 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index c8dfe49..64b2290 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -69,7 +69,6 @@ Suggests: lubridate, modelr, reprex, - rsconnect, rvest, selectr, httr, From c9c7ecc873ffd882b957b197256cf908c495e14c Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Thu, 20 Aug 2020 19:41:04 +0200 Subject: [PATCH 24/46] migrate to subugoetheme --- DESCRIPTION | 6 +++--- pkgdown/_pkgdown.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 64b2290..b41f685 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -62,7 +62,6 @@ Suggests: DT, writexl, echarts4r, - metar, DBI, dbplyr, haven, @@ -74,7 +73,8 @@ Suggests: httr, purrr, covr, - testthat + testthat, + subugoetheme URL: https://subugoe.github.io/hoad, https://github.com/subugoe/hoad/ BugReports: https://github.com/subugoe/hoad/issues RoxygenNote: 7.1.1 @@ -87,4 +87,4 @@ Imports: ggplot2, rlang Remotes: - subugoe/metar@7ccc2a0 + subugoe/subugoetheme@1.0.0 diff --git a/pkgdown/_pkgdown.yml b/pkgdown/_pkgdown.yml index 305051b..c8f472c 100644 --- a/pkgdown/_pkgdown.yml +++ b/pkgdown/_pkgdown.yml @@ -18,7 +18,7 @@ authors: href: https://github.com/openapc html: template: - package: metar + package: subugoetheme opengraph: twitter: site: "@subugoe" From 2eb6c7596726ab9c95f6fa31b80514874317170b Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Thu, 20 Aug 2020 20:19:38 +0200 Subject: [PATCH 25/46] hard-code hoad --- .github/workflows/main.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index aab0425..9f12ed9 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -72,6 +72,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | muggle::az_webapp_config_muggle( + name = "hoad", plan = "hoad", resource_group = "hoad", subscription = "f0dd3a37-0a4e-4e7f-9c9b-cb9f60146edc" From b531ec48a771f405b49a1cb444a2b7c384961695 Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Thu, 20 Aug 2020 20:57:59 +0200 Subject: [PATCH 26/46] try fresh run --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 9f12ed9..d54a9e9 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -88,4 +88,4 @@ jobs: needs: CICD runs-on: ubuntu-20.04 steps: - - run: sleep 3m + - run: sleep 2m From 3f53e3e7fde41c9d83f6471c46a06de0f531dc8a Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Fri, 21 Aug 2020 14:01:59 +0200 Subject: [PATCH 27/46] upgrade muggle --- .github/workflows/main.yaml | 26 +++++++++++--------------- Dockerfile | 2 +- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index d54a9e9..8cb094e 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -6,9 +6,13 @@ jobs: defaults: run: shell: Rscript {0} + env: + # update muggle here + MUGGLE_TAG: "9ee02c2d9b32cab07681288de9995dc3d4124e4d" + MUGGLE_PKG_NAME: ${{ github.event.repository.name }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} container: - # this needs to be the same as in Dockerfile - image: subugoe/muggle-buildtime-onbuild:a7876ed9ad79909bcf8ff04d1d8c30503bdb8b0a + image: subugoe/muggle-buildtime-onbuild:{{ env.MUGGLE_TAG }} steps: - uses: actions/checkout@v2 - name: Cache R Packages @@ -25,7 +29,7 @@ jobs: R_LIBS_SITE: $R_LIBS_RUNTIME_GH run: remotes::install_deps(dependencies = TRUE) - name: Check - run: muggle::rcmdcheck2() + run: devtools::check() - name: Test Coverage run: covr::codecov() - name: Build Package Website @@ -36,8 +40,9 @@ jobs: - name: Build Buildtime Image uses: docker/build-push-action@v1 with: - repository: ${{ github.repository }}/hoad-buildtime + repository: ${{ github.repository }}/{{ env.MUGGLE_PKG_NAME }}-buildtime target: buildtime + build_args: MUGGLE_TAG=${{ env.MUGGLE_TAG }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} registry: docker.pkg.github.com @@ -51,8 +56,9 @@ jobs: - name: Build Runtime Image uses: docker/build-push-action@v1 with: - repository: ${{ github.repository }}/hoad-runtime + repository: ${{ github.repository }}/{{ env.MUGGLE_PKG_NAME }}-runtime target: runtime + build_args: MUGGLE_TAG=${{ env.MUGGLE_TAG }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} registry: docker.pkg.github.com @@ -68,11 +74,8 @@ jobs: with: creds: ${{ secrets.AZURE_CREDENTIALS }} - name: Deploy to Azure Webapps - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | muggle::az_webapp_config_muggle( - name = "hoad", plan = "hoad", resource_group = "hoad", subscription = "f0dd3a37-0a4e-4e7f-9c9b-cb9f60146edc" @@ -82,10 +85,3 @@ jobs: uses: maxheld83/ghpages@github-token env: BUILD_DIR: docs - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - sleep: - name: Sleep to let GITHUB_TOKEN persist - needs: CICD - runs-on: ubuntu-20.04 - steps: - - run: sleep 2m diff --git a/Dockerfile b/Dockerfile index 85cf412..365cda6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG MUGGLE_TAG=a7876ed9ad79909bcf8ff04d1d8c30503bdb8b0a +ARG MUGGLE_TAG=latest FROM subugoe/muggle-buildtime-onbuild:${MUGGLE_TAG} as buildtime FROM subugoe/muggle-runtime-onbuild:${MUGGLE_TAG} as runtime CMD shinycaas::az_webapp_shiny_opts(); hoad::runHOAD() From c1ab907e10bf4751a63bb3def70af4a2b9088603 Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Fri, 21 Aug 2020 14:08:06 +0200 Subject: [PATCH 28/46] try with bare string --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 8cb094e..04cd9d4 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -8,7 +8,7 @@ jobs: shell: Rscript {0} env: # update muggle here - MUGGLE_TAG: "9ee02c2d9b32cab07681288de9995dc3d4124e4d" + MUGGLE_TAG: 9ee02c2d9b32cab07681288de9995dc3d4124e4d MUGGLE_PKG_NAME: ${{ github.event.repository.name }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} container: From 85cf576eeffe9e662e8026fb2d988c939b044e07 Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Fri, 21 Aug 2020 14:10:39 +0200 Subject: [PATCH 29/46] set env one level higher --- .github/workflows/main.yaml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 04cd9d4..c654ff8 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -1,18 +1,19 @@ on: push +env: + # update muggle here + MUGGLE_TAG: 9ee02c2d9b32cab07681288de9995dc3d4124e4d + MUGGLE_PKG_NAME: ${{ github.event.repository.name }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + jobs: CICD: runs-on: ubuntu-20.04 defaults: run: shell: Rscript {0} - env: - # update muggle here - MUGGLE_TAG: 9ee02c2d9b32cab07681288de9995dc3d4124e4d - MUGGLE_PKG_NAME: ${{ github.event.repository.name }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} container: - image: subugoe/muggle-buildtime-onbuild:{{ env.MUGGLE_TAG }} + image: subugoe/muggle-buildtime-onbuild:${{ env.MUGGLE_TAG }} steps: - uses: actions/checkout@v2 - name: Cache R Packages From 4bdf513f0d27cf229506aeee633400c15be3a986 Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Fri, 21 Aug 2020 14:32:59 +0200 Subject: [PATCH 30/46] set tag twice --- .github/workflows/main.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index c654ff8..7cd3582 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -1,11 +1,5 @@ on: push -env: - # update muggle here - MUGGLE_TAG: 9ee02c2d9b32cab07681288de9995dc3d4124e4d - MUGGLE_PKG_NAME: ${{ github.event.repository.name }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - jobs: CICD: runs-on: ubuntu-20.04 @@ -13,7 +7,13 @@ jobs: run: shell: Rscript {0} container: - image: subugoe/muggle-buildtime-onbuild:${{ env.MUGGLE_TAG }} + # update muggle here, and 2 lines below (!) + image: subugoe/muggle-buildtime-onbuild:9ee02c2d9b32cab07681288de9995dc3d4124e4d + env: + # update muggle here too (!) + MUGGLE_TAG: 9ee02c2d9b32cab07681288de9995dc3d4124e4d + MUGGLE_PKG_NAME: ${{ github.event.repository.name }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - uses: actions/checkout@v2 - name: Cache R Packages From 925e49bf382ebf31f20a27253a52a3bb869ddf31 Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Fri, 21 Aug 2020 14:34:53 +0200 Subject: [PATCH 31/46] revert passing on MUGGLE_TAG --- .github/workflows/main.yaml | 6 +----- Dockerfile | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 7cd3582..82ef012 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -7,11 +7,9 @@ jobs: run: shell: Rscript {0} container: - # update muggle here, and 2 lines below (!) + # update muggle here and in Dockerfile image: subugoe/muggle-buildtime-onbuild:9ee02c2d9b32cab07681288de9995dc3d4124e4d env: - # update muggle here too (!) - MUGGLE_TAG: 9ee02c2d9b32cab07681288de9995dc3d4124e4d MUGGLE_PKG_NAME: ${{ github.event.repository.name }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: @@ -43,7 +41,6 @@ jobs: with: repository: ${{ github.repository }}/{{ env.MUGGLE_PKG_NAME }}-buildtime target: buildtime - build_args: MUGGLE_TAG=${{ env.MUGGLE_TAG }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} registry: docker.pkg.github.com @@ -59,7 +56,6 @@ jobs: with: repository: ${{ github.repository }}/{{ env.MUGGLE_PKG_NAME }}-runtime target: runtime - build_args: MUGGLE_TAG=${{ env.MUGGLE_TAG }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} registry: docker.pkg.github.com diff --git a/Dockerfile b/Dockerfile index 365cda6..bbceab6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG MUGGLE_TAG=latest +ARG MUGGLE_TAG=9ee02c2d9b32cab07681288de9995dc3d4124e4d FROM subugoe/muggle-buildtime-onbuild:${MUGGLE_TAG} as buildtime FROM subugoe/muggle-runtime-onbuild:${MUGGLE_TAG} as runtime CMD shinycaas::az_webapp_shiny_opts(); hoad::runHOAD() From 315bb201f8c1b333d972faf632d5ffbc02ce19c4 Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Fri, 21 Aug 2020 14:43:16 +0200 Subject: [PATCH 32/46] fix lingering metar refs --- .github/workflows/main.yaml | 3 ++- R/plots.R | 2 +- inst/app/dashboard.Rmd | 2 +- man/colors.Rd | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 82ef012..2147eee 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -28,7 +28,8 @@ jobs: R_LIBS_SITE: $R_LIBS_RUNTIME_GH run: remotes::install_deps(dependencies = TRUE) - name: Check - run: devtools::check() + # TODO error out on all but note again https://github.com/subugoe/hoad/issues/194 + run: devtools::check(error_on = "error") - name: Test Coverage run: covr::codecov() - name: Build Package Website diff --git a/R/plots.R b/R/plots.R index b8d9f84..cae5241 100644 --- a/R/plots.R +++ b/R/plots.R @@ -1,5 +1,5 @@ #' Color palettes -#' Colors used in the hybrid open access dashboard, based on [metar::ugoe_pal()] +#' Colors used in the hybrid open access dashboard, based on [subugoetheme::ugoe_pal()] #' @family visualisation functions #' @name colors NULL diff --git a/inst/app/dashboard.Rmd b/inst/app/dashboard.Rmd index 70595e7..075d4d3 100644 --- a/inst/app/dashboard.Rmd +++ b/inst/app/dashboard.Rmd @@ -4,7 +4,7 @@ output: flexdashboard::flex_dashboard: orientation: rows vertical_layout: fill - css: !expr metar::subugoe_template()$assets$css + css: !expr subugoetheme::subugoe_template()$assets$css runtime: shiny --- diff --git a/man/colors.Rd b/man/colors.Rd index c84793a..809110c 100644 --- a/man/colors.Rd +++ b/man/colors.Rd @@ -7,7 +7,7 @@ \alias{colors_license_unpaywall} \alias{colors_source_disclosure} \title{Color palettes -Colors used in the hybrid open access dashboard, based on \code{\link[metar:ugoe_pal]{metar::ugoe_pal()}}} +Colors used in the hybrid open access dashboard, based on \code{\link[subugoetheme:ugoe_pal]{subugoetheme::ugoe_pal()}}} \format{ An object of class \code{character} of length 6. @@ -24,7 +24,7 @@ colors_source_disclosure } \description{ Color palettes -Colors used in the hybrid open access dashboard, based on \code{\link[metar:ugoe_pal]{metar::ugoe_pal()}} +Colors used in the hybrid open access dashboard, based on \code{\link[subugoetheme:ugoe_pal]{subugoetheme::ugoe_pal()}} } \section{Functions}{ \itemize{ From 7085e870ea6a2921dc8dc95fa2906a62a18a3821 Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Fri, 21 Aug 2020 14:49:47 +0200 Subject: [PATCH 33/46] fix bad yaml --- .github/workflows/main.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 2147eee..11fd00a 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -40,7 +40,7 @@ jobs: - name: Build Buildtime Image uses: docker/build-push-action@v1 with: - repository: ${{ github.repository }}/{{ env.MUGGLE_PKG_NAME }}-buildtime + repository: ${{ github.repository }}/${{ env.MUGGLE_PKG_NAME }}-buildtime target: buildtime username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} @@ -55,7 +55,7 @@ jobs: - name: Build Runtime Image uses: docker/build-push-action@v1 with: - repository: ${{ github.repository }}/{{ env.MUGGLE_PKG_NAME }}-runtime + repository: ${{ github.repository }}/${{ env.MUGGLE_PKG_NAME }}-runtime target: runtime username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} From 4cac09326a681960581b661c2453dee84a3dd4cd Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Fri, 21 Aug 2020 16:14:20 +0200 Subject: [PATCH 34/46] try with restart --- .github/workflows/main.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 11fd00a..42805f6 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -76,7 +76,8 @@ jobs: muggle::az_webapp_config_muggle( plan = "hoad", resource_group = "hoad", - subscription = "f0dd3a37-0a4e-4e7f-9c9b-cb9f60146edc" + subscription = "f0dd3a37-0a4e-4e7f-9c9b-cb9f60146edc", + restart = TRUE ) - name: Deploy to GitHub Pages if: github.ref == 'refs/heads/master' From 0ffbcc4177b19edcc9c229c129c421f26981a069 Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Fri, 21 Aug 2020 16:45:16 +0200 Subject: [PATCH 35/46] add sleep --- .github/workflows/main.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 42805f6..8aa64c8 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -84,3 +84,9 @@ jobs: uses: maxheld83/ghpages@github-token env: BUILD_DIR: docs + sleep: + name: Sleep to let GITHUB_TOKEN persist + needs: CICD + runs-on: ubuntu-20.04 + steps: + - run: sleep 3m From c7c69940357ac69d9bae79669adf2e8c4652bab6 Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Mon, 24 Aug 2020 16:55:44 +0200 Subject: [PATCH 36/46] add shinycaas --- DESCRIPTION | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index b41f685..b957dbe 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -74,7 +74,8 @@ Suggests: purrr, covr, testthat, - subugoetheme + subugoetheme, + shinycaas URL: https://subugoe.github.io/hoad, https://github.com/subugoe/hoad/ BugReports: https://github.com/subugoe/hoad/issues RoxygenNote: 7.1.1 @@ -87,4 +88,5 @@ Imports: ggplot2, rlang Remotes: - subugoe/subugoetheme@1.0.0 + subugoe/subugoetheme@1.0.0, + subugoe/shinycaas From 7d8e7f275851869816f1f9e82d96e3d47017c054 Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Mon, 24 Aug 2020 18:23:05 +0200 Subject: [PATCH 37/46] fix bad template call --- inst/app/dashboard.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/app/dashboard.Rmd b/inst/app/dashboard.Rmd index 075d4d3..f9be5e0 100644 --- a/inst/app/dashboard.Rmd +++ b/inst/app/dashboard.Rmd @@ -4,7 +4,7 @@ output: flexdashboard::flex_dashboard: orientation: rows vertical_layout: fill - css: !expr subugoetheme::subugoe_template()$assets$css + css: !expr subugoetheme::pkgdown_template()$assets$css runtime: shiny --- From 157987a356df99e9b556d968ee169f374d517a27 Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Mon, 24 Aug 2020 18:47:41 +0200 Subject: [PATCH 38/46] add sleep in same job --- .github/workflows/main.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 8aa64c8..33b0118 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -84,6 +84,8 @@ jobs: uses: maxheld83/ghpages@github-token env: BUILD_DIR: docs + - name: Sleep to let GITHUB_TOKEN persist + run: Sys.sleep(1200) sleep: name: Sleep to let GITHUB_TOKEN persist needs: CICD From 228ec1b0501f3076e16309955d2894354794b836 Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Mon, 24 Aug 2020 19:30:07 +0200 Subject: [PATCH 39/46] reduce sleep and hardcode deps --- .github/workflows/main.yaml | 14 +++++++------- DESCRIPTION | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 33b0118..4534b3b 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -85,10 +85,10 @@ jobs: env: BUILD_DIR: docs - name: Sleep to let GITHUB_TOKEN persist - run: Sys.sleep(1200) - sleep: - name: Sleep to let GITHUB_TOKEN persist - needs: CICD - runs-on: ubuntu-20.04 - steps: - - run: sleep 3m + run: Sys.sleep(600) + # sleep: + # name: Sleep to let GITHUB_TOKEN persist + # needs: CICD + # runs-on: ubuntu-20.04 + # steps: + # - run: sleep 3m diff --git a/DESCRIPTION b/DESCRIPTION index b957dbe..178fa86 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -89,4 +89,4 @@ Imports: rlang Remotes: subugoe/subugoetheme@1.0.0, - subugoe/shinycaas + subugoe/shinycaas@31684600b286d5da5639a430a4b83a04de36bd34 From 4f2e957b23ebb1ccc48165f0355e8c05e11bbc30 Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Mon, 24 Aug 2020 20:00:03 +0200 Subject: [PATCH 40/46] try sleeping in separate process --- .github/workflows/main.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 4534b3b..5971b54 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -84,11 +84,11 @@ jobs: uses: maxheld83/ghpages@github-token env: BUILD_DIR: docs - - name: Sleep to let GITHUB_TOKEN persist - run: Sys.sleep(600) - # sleep: - # name: Sleep to let GITHUB_TOKEN persist - # needs: CICD - # runs-on: ubuntu-20.04 - # steps: - # - run: sleep 3m + # - name: Sleep to let GITHUB_TOKEN persist + # run: Sys.sleep(600) + sleep: + name: Sleep to let GITHUB_TOKEN persist + needs: CICD + runs-on: ubuntu-20.04 + steps: + - run: sleep 10m From 56376b058630cb5fcf889a864d0e350c579860fa Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Mon, 24 Aug 2020 21:22:56 +0200 Subject: [PATCH 41/46] reduce sleep --- .github/workflows/main.yaml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 5971b54..56a208a 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -84,11 +84,5 @@ jobs: uses: maxheld83/ghpages@github-token env: BUILD_DIR: docs - # - name: Sleep to let GITHUB_TOKEN persist - # run: Sys.sleep(600) - sleep: - name: Sleep to let GITHUB_TOKEN persist - needs: CICD - runs-on: ubuntu-20.04 - steps: - - run: sleep 10m + - name: Sleep to let GITHUB_TOKEN persist + run: Sys.sleep(1) From 4e4a11e91b8eca663857d3473b394fde22ad05f5 Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Mon, 24 Aug 2020 21:39:30 +0200 Subject: [PATCH 42/46] increase sleep --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 56a208a..7e43506 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -85,4 +85,4 @@ jobs: env: BUILD_DIR: docs - name: Sleep to let GITHUB_TOKEN persist - run: Sys.sleep(1) + run: Sys.sleep(60) From 7cadb91a861ff2829877946d637592e81faa0077 Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Mon, 24 Aug 2020 21:52:08 +0200 Subject: [PATCH 43/46] increase sleep --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 7e43506..07d4608 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -85,4 +85,4 @@ jobs: env: BUILD_DIR: docs - name: Sleep to let GITHUB_TOKEN persist - run: Sys.sleep(60) + run: Sys.sleep(120) From 74c872509c7ea53d15e3a93c629d8635c5209b79 Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Mon, 24 Aug 2020 22:04:43 +0200 Subject: [PATCH 44/46] increase sleep --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 07d4608..cf5178e 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -85,4 +85,4 @@ jobs: env: BUILD_DIR: docs - name: Sleep to let GITHUB_TOKEN persist - run: Sys.sleep(120) + run: Sys.sleep(240) From a92d94a647df1374c5f8caa5d1ed98f07263b993 Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Wed, 18 Nov 2020 16:55:15 +0100 Subject: [PATCH 45/46] remove obsolete workspace --- hoad.code-workspace | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 hoad.code-workspace diff --git a/hoad.code-workspace b/hoad.code-workspace deleted file mode 100644 index 5709732..0000000 --- a/hoad.code-workspace +++ /dev/null @@ -1,8 +0,0 @@ -{ - "folders": [ - { - "path": "." - } - ], - "settings": {} -} From f6f3c1c548cee8a27520cf15162dce987659090c Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Thu, 3 Dec 2020 19:28:17 +0100 Subject: [PATCH 46/46] add newsletter email --- .github/newsletter.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/newsletter.md b/.github/newsletter.md index ee3cbcf..2f5235e 100644 --- a/.github/newsletter.md +++ b/.github/newsletter.md @@ -1,6 +1,6 @@ # Newsletter abonnieren -In unserem deutschsprachigen Newsletter informieren wir Sie über neue Entwicklungen und Veranstaltungen rund um das Projekt. +In unserem deutschsprachigen Newsletter `hoad@sub.uni-goettingen.de` informieren wir Sie über neue Entwicklungen und Veranstaltungen rund um das Projekt.