Skip to content

Commit

Permalink
Merge branch 'main' into use-nodejs-22
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewKostka authored Aug 27, 2024
2 parents 3a39985 + 47cd3f0 commit 2198447
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 53 deletions.
72 changes: 42 additions & 30 deletions .github/workflows/docker.build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,108 +4,120 @@ on:
push:
branches:
- main
pull_request:

jobs:
docker-build:
runs-on: ubuntu-latest
steps:
-
name: Checkout
- name: Checkout
uses: actions/[email protected]
-
name: Docker meta
- name: Docker meta
id: docker_meta
uses: crazy-max/[email protected]
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=sha
-
name: Set up QEMU
- name: Set up QEMU
uses: docker/[email protected]
-
name: Set up Docker Buildx
- name: Set up Docker Buildx
uses: docker/[email protected]
-
name: Cache Docker layers
- name: Set up helmfile
uses: helmfile/[email protected]
- name: Cache Docker layers
uses: actions/[email protected]
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
-
name: Login to GitHub Container Registry
- name: Login to GitHub Container Registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push
- name: Build and push
uses: docker/[email protected]
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
push: true
-
name: Check out `wmde/wbaas-deploy` repository in staging child directory
- name: Check out `wmde/wbaas-deploy` repository in staging child directory
if: github.event_name != 'pull_request'
uses: actions/[email protected]
with:
repository: wmde/wbaas-deploy
path: ./repos/wbaas-deploy-staging
-
name: Check out `wmde/wbaas-deploy` repository in production child directory
- name: Check out `wmde/wbaas-deploy` repository in production child directory
if: github.event_name != 'pull_request'
uses: actions/[email protected]
with:
repository: wmde/wbaas-deploy
path: ./repos/wbaas-deploy-production
-
name: Update values for local, staging and production
id: update-values
- name: Update helmfile values for local, staging and production
if: github.event_name != 'pull_request'
id: update-helmfile-values
run: |
TAG="$(echo ${{ steps.docker_meta.outputs.tags }} | cut -d':' -f2)"
echo "tag=$TAG" >> $GITHUB_OUTPUT
sed -i "/image:/{n;s/tag:.*/tag: $TAG/;}" ./repos/wbaas-deploy-staging/k8s/helmfile/env/local/ui.values.yaml.gotmpl
sed -i "/image:/{n;s/tag:.*/tag: $TAG/;}" ./repos/wbaas-deploy-staging/k8s/helmfile/env/staging/ui.values.yaml.gotmpl
sed -i "/image:/{n;s/tag:.*/tag: $TAG/;}" ./repos/wbaas-deploy-production/k8s/helmfile/env/production/ui.values.yaml.gotmpl
-
name: Truncate commit message
# run the values script for local, prod and staging
- name: Update argo values for local, staging and production
if: github.event_name != 'pull_request'
id: update-argo-values
run: |
cd ./repos/wbaas-deploy-staging
# run generate values script for local from staging folder
./bin/generate-values local ui
# run generate values script for staging from staging folder
./bin/generate-values staging ui
# run generate values script for prod from prod folder
cd ../wbaas-deploy-production
./bin/generate-values production ui
- name: Truncate commit message
if: github.event_name != 'pull_request'
id: truncate-commit-message
run: |
MSG=$(git log -1 --pretty=format:%s)
echo "msg=$MSG" >> $GITHUB_OUTPUT
-
- name: Create Staging+Local Pull Request
uses: peter-evans/create-pull-request@v5
if: github.event_name != 'pull_request'
with:
path: ./repos/wbaas-deploy-staging
commit-message: 'Staging+Local: Deploy new UI image ${{ steps.docker_meta.outputs.tags }}'
title: 'Staging+Local: Deploy new UI image ${{ steps.docker_meta.outputs.tags }}'
branch: deploy-to-staging-${{ steps.update-values.outputs.tag }}
branch: deploy-to-staging-${{ steps.update-helmfile-values.outputs.tag }}
committer: wmdebot <[email protected]>
author: ${{ github.actor }} <[email protected]>
labels: automated pr
token: ${{ secrets.WBAAS_DEPLOY_TOKEN }}
body: |
This is an automated update for the `ui` image in staging and local, using `${{ steps.update-values.outputs.tag }}`.
This is an automated update for the `ui` image in staging and local, using `${{ steps.update-helmfile-values.outputs.tag }}`.
**Changes**: [${{ steps.truncate-commit-message.outputs.msg }}](https://github.com/wbstack/ui/commit/${{ github.sha }})
-
- name: Create Production Pull Request
uses: peter-evans/create-pull-request@v5
if: github.event_name != 'pull_request'
with:
path: ./repos/wbaas-deploy-production
commit-message: 'Production: Deploy new UI image ${{ steps.docker_meta.outputs.tags }}'
title: 'Production: Deploy new UI image ${{ steps.docker_meta.outputs.tags }}'
branch: deploy-to-production-${{ steps.update-values.outputs.tag }}
branch: deploy-to-production-${{ steps.update-helmfile-values.outputs.tag }}
committer: wmdebot <[email protected]>
author: ${{ github.actor }} <[email protected]>
labels: automated pr
token: ${{ secrets.WBAAS_DEPLOY_TOKEN }}
body: |
This is an automated update for the `ui` image in production, using `${{ steps.update-values.outputs.tag }}`.
This is an automated update for the `ui` image in production, using `${{ steps.update-helmfile-values.outputs.tag }}`.
**Changes**: [${{ steps.truncate-commit-message.outputs.msg }}](https://github.com/wbstack/ui/commit/${{ github.sha }})
25 changes: 12 additions & 13 deletions src/components/Pages/ManageWiki/Cards/ConfirmDelete.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,31 @@
<div class="px-4 pb-2">
<v-checkbox
class="ma-0" hide-details
label="Was only used for Testing"
v-model="deletion_reasons"
label="Was only used for testing"
v-model="checkboxReasons"
value="Was only used for testing"
/>
<v-checkbox
class="ma-0"
hide-details
label="Lacking essential
functionality"
v-model="deletion_reasons"
v-model="checkboxReasons"
value="Lacking essential functionality"
/>
<v-checkbox
class="ma-0"
hide-details
label="Too complex to work with"
v-model="deletion_reasons"
v-model="checkboxReasons"
value="Too complex to work with"
/>
<v-checkbox
class="ma-0"
hide-details
label="Other reasons (please specify)"
v-model="deletion_reasons"
value="Other Reason"
v-model="checkboxReasons"
value="Other reason"
/>
</div>
<div class="px-4 align-self-stretch align-start">
Expand All @@ -46,7 +46,7 @@
outlined
dense
hide-details
v-model="inputReason"
v-model="freeformReason"
placeholder="e.g. ran out of space to create new wiki"
></v-text-field>
</div>
Expand All @@ -73,18 +73,17 @@ export default {
],
data () {
return {
deletion_reasons: [],
open_dialog: true,
inputReason: ''
checkboxReasons: [],
freeformReason: ''
}
},
methods: {
doDelete () {
const wiki = this.wikiId
const deletionReasons = this.deletion_reasons
if (deletionReasons.includes('Other Reason')) {
deletionReasons[deletionReasons.indexOf('Other Reason')] = this.inputReason
const deletionReasons = [...this.checkboxReasons]
if (this.freeformReason) {
deletionReasons.push(this.freeformReason)
}
this.$store
.dispatch('deleteWiki', { wiki, deletionReasons })
Expand Down
7 changes: 0 additions & 7 deletions src/components/Pages/ManageWiki/Cards/Details.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@
<v-card>
<v-card-title>
Details
<v-spacer></v-spacer>
<v-tooltip right>
<template v-slot:activator="{ on }">
<v-icon v-on="on">mdi-information-outline</v-icon>
</template>
<span>During Alpha if you would like to change these details please contact us.</span>
</v-tooltip>
</v-card-title>
<v-card-text>
<strong>Please check your emails for your log in details.</strong><br/>
Expand Down
61 changes: 58 additions & 3 deletions src/components/Pages/ManageWiki/Cards/EntityImport.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,62 @@
<template>
<v-form ref="form" @submit="doSubmit">
<v-overlay
:value="showOverlay"
>
<v-dialog width="500" v-model="showOverlay">
<v-card>
<v-card-title>
Entities for import
</v-card-title>
<v-card-text>
<h4 class="mb-0 mt-4">Properties</h4>
<ul>
<li><a target="_blank" rel="noopener nofollow" href="https://www.wikidata.org/wiki/Property:P25">Mother</a></li>
<li><a target="_blank" rel="noopener nofollow" href="https://www.wikidata.org/wiki/Property:P22">Father</a></li>
<li><a target="_blank" rel="noopener nofollow" href="https://www.wikidata.org/wiki/Property:P40">Child</a></li>
<li><a target="_blank" rel="noopener nofollow" href="https://www.wikidata.org/wiki/Property:P18">Image</a></li>
<li><a target="_blank" rel="noopener nofollow" href="https://www.wikidata.org/wiki/Property:P31">Instance of</a></li>
<li><a target="_blank" rel="noopener nofollow" href="https://www.wikidata.org/wiki/Property:P279">Subclass of</a></li>
</ul>
<h4 class="mb-0 mt-4">Items</h4>
<ul>
<li><a href="https://www.wikidata.org/wiki/Q1" target="_blank" rel="noopener nofollow">Universe</a></li>
<li><a href="https://www.wikidata.org/wiki/Q2" target="_blank" rel="noopener nofollow">World</a></li>
<li><a href="https://www.wikidata.org/wiki/Q5" target="_blank" rel="noopener nofollow">Human</a></li>
<li><a href="https://www.wikidata.org/wiki/Q64" target="_blank" rel="noopener nofollow">Berlin</a></li>
<li><a href="https://www.wikidata.org/wiki/Q42" target="_blank" rel="noopener nofollow">Douglas Adams</a></li>
<li><a href="https://www.wikidata.org/wiki/Q3107329" target="_blank" rel="noopener nofollow">The Hitchhiker's Guide to the Galaxy</a></li>
</ul>
</v-card-text>
<v-card-actions>
<v-spacer />
<v-btn
color="primary"
text
@click="showOverlay = false"
>
Close
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</v-overlay>
<v-card>
<v-card-title>Import base set of entities to your Wikibase instance</v-card-title>
<v-card-title>
Import base entities
<v-spacer />
<v-btn plain right @click="showOverlay = true">
<v-icon>
mdi-information-outline
</v-icon>
More info
</v-btn>
</v-card-title>
<v-card-text>
You can import a preselected subset of items and properties to help you get started with your Wikibase instance.
You can import a curated subset of items and properties to help you get started with your Wikibase instance.
</v-card-text>
<v-card-actions>
<v-btn :disabled="hasPending || hasSuccess" type="submit">Copy entities</v-btn>
<v-btn :disabled="hasPending || hasSuccess" type="submit">Import entities</v-btn>
</v-card-actions>
<v-card-text v-if="hasError || (!hasPending && !hasSuccess && hasFailed)">
<span class="font-italic">Your entity import failed. Please try again.</span>
Expand Down Expand Up @@ -37,6 +87,11 @@ export default {
props: [
'wikiId'
],
data () {
return {
showOverlay: false
}
},
computed: {
hasError () {
return this.$store.getters.currentWikiEntityImportError !== null
Expand Down

0 comments on commit 2198447

Please sign in to comment.