Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

1.6.0 #17

Merged
merged 5 commits into from
Oct 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 1 addition & 1 deletion .github/workflows/prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:

# Setup gcloud CLI
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@master
uses: google-github-actions/setup-gcloud@v0
with:
service_account_email: [email protected]
service_account_key: ${{ secrets.GKE_SA_KEY }}
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ on:
- staging

env:
# set docker image for the service - i.e. "wire-bot/poll"
DOCKER_IMAGE: wire-bot/don-bot
# name of the service in the Dagobah - the value for label name, i.e. "polls"
SERVICE_NAME: don

jobs:
Expand Down Expand Up @@ -52,7 +54,7 @@ jobs:

# Setup gcloud CLI
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@master
uses: google-github-actions/setup-gcloud@v0
with:
service_account_email: [email protected]
service_account_key: ${{ secrets.GKE_SA_KEY }}
Expand All @@ -67,7 +69,7 @@ jobs:
# Get the GKE credentials so we can deploy to the cluster
- name: Obtain k8s credentials
env:
GKE_CLUSTER: anayotto
GKE_CLUSTER: dagobah
GKE_ZONE: europe-west1-c
run: |
gcloud container clusters get-credentials "$GKE_CLUSTER" --zone "$GKE_ZONE"
Expand All @@ -77,8 +79,8 @@ jobs:
env:
SERVICE: ${{ env.SERVICE_NAME }}
run: |
kubectl delete pod -l name=$SERVICE -n staging
kubectl describe pod -l name=$SERVICE -n staging
kubectl delete pod -l app=$SERVICE -n staging
kubectl describe pod -l app=$SERVICE -n staging

# Send webhook to Wire using Slack Bot
- name: Webhook to Wire
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ COPY src ./src
RUN mvn package -DskipTests=true

# runtime stage
FROM dejankovacevic/bots.runtime:2.10.3
FROM wirebot/runtime

WORKDIR /opt/don

Expand All @@ -29,4 +29,4 @@ ENV RELEASE_FILE_PATH=/etc/don/release.txt
RUN echo $release_version > $RELEASE_FILE_PATH

EXPOSE 8080 8081 8082
ENTRYPOINT ["java", "-jar", "don.jar", "server", "/etc/don/don.yaml"]
ENTRYPOINT ["java","-javaagent:/opt/wire/lib/prometheus-agent.jar=8082:/opt/wire/lib/metrics.yaml", "-jar", "don.jar", "server", "/etc/don/don.yaml"]
8 changes: 7 additions & 1 deletion src/main/java/com/wire/bots/don/DonService.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

import com.wire.lithium.Server;
import com.wire.xenon.MessageHandlerBase;
import io.dropwizard.bundles.redirect.PathRedirect;
import io.dropwizard.bundles.redirect.RedirectBundle;
import io.dropwizard.configuration.EnvironmentVariableSubstitutor;
import io.dropwizard.configuration.SubstitutingSourceProvider;
import io.dropwizard.setup.Bootstrap;
import io.dropwizard.setup.Environment;

Expand All @@ -14,7 +18,9 @@ public static void main(String[] args) throws Exception {

@Override
public void initialize(Bootstrap<DonConfig> bootstrap) {
super.initialize(bootstrap);
bootstrap.setConfigurationSourceProvider(new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(false)));
bootstrap.addBundle(new RedirectBundle(new PathRedirect("/", "/status"), new PathRedirect("/bots/status", "/status")));

instance = (DonService) bootstrap.getApplication();
}

Expand Down