Skip to content

Commit 1819bf6

Browse files
Merge remote-tracking branch 'origin/staging' into development_update_socket_io
2 parents 77434b1 + a15cd18 commit 1819bf6

7 files changed

Lines changed: 104 additions & 69 deletions

File tree

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: staging
2+
3+
on:
4+
push:
5+
tags:
6+
- "v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+"
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
# - uses: actions/checkout@v1
12+
# - uses: actions/setup-java@v1
13+
# with:
14+
# java-version: '12.x'
15+
16+
# # Setup the flutter environment.
17+
# - uses: subosito/flutter-action@v1
18+
# with:
19+
# channel: 'stable' # 'dev', 'alpha', default to: 'stable'
20+
# flutter-version: '2.10.1' # you can also specify exact version of flutter
21+
22+
# # Get flutter dependencies.
23+
# - run: cd app && flutter pub get
24+
25+
# # Check for any formatting issues in the code.
26+
# - run: flutter format --set-exit-if-changed .
27+
28+
# # Statically analyze the Dart code for any errors.
29+
# - run: flutter analyze .
30+
31+
# # Build apk.
32+
# - run: flutter build apk
33+
34+
# # Upload generated apk to the artifacts.
35+
# - uses: actions/upload-artifact@v1
36+
# with:
37+
# name: release-apk
38+
# path: app/apks/app-release.apk
39+
40+
- uses: actions/checkout@v2
41+
- name: Login to docker hub
42+
run: docker login --username ${{ secrets.DOCKER_USERNAME }} --password ${{ secrets.DOCKER_TOKEN }}
43+
- name: Set config
44+
run: mv frontend/public/config.staging.js frontend/public/config.js
45+
- name: Build the Docker image
46+
run: docker build . --file Dockerfile --tag jimber/3botlogin:staging-${{ github.sha }}
47+
- name: Push the Docker image
48+
run: docker push jimber/3botlogin:staging-${{ github.sha }}
49+
50+
deploy:
51+
needs: build
52+
runs-on: tfc-connect-staging
53+
steps:
54+
- name: Login to docker hub
55+
run: docker login --username ${{ secrets.DOCKER_USERNAME }} --password ${{ secrets.DOCKER_TOKEN }}
56+
- name: kill old docker
57+
run: docker rm -f 3botlogin || true
58+
- name: Pull Image
59+
run: docker pull jimber/3botlogin:staging-${{ github.sha }}
60+
- name: Run new docker
61+
run: docker run -d -it --restart=unless-stopped --name 3botlogin -v /opt/3botlogin/pythonsqlite.db:/usr/share/nginx/backend/pythonsqlite.db -v /opt/3botlogin/config.ini:/usr/share/nginx/backend/config.ini --network=proxy jimber/3botlogin:staging-${{ github.sha }}

.github/workflows/old_wfs/testing.yml

Whitespace-only changes.

.github/workflows/staging.yml

Lines changed: 25 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -8,54 +8,33 @@ jobs:
88
build:
99
runs-on: ubuntu-latest
1010
steps:
11-
# - uses: actions/checkout@v1
12-
# - uses: actions/setup-java@v1
13-
# with:
14-
# java-version: '12.x'
15-
16-
# # Setup the flutter environment.
17-
# - uses: subosito/flutter-action@v1
18-
# with:
19-
# channel: 'stable' # 'dev', 'alpha', default to: 'stable'
20-
# flutter-version: '2.10.1' # you can also specify exact version of flutter
21-
22-
# # Get flutter dependencies.
23-
# - run: cd app && flutter pub get
24-
25-
# # Check for any formatting issues in the code.
26-
# - run: flutter format --set-exit-if-changed .
27-
28-
# # Statically analyze the Dart code for any errors.
29-
# - run: flutter analyze .
30-
31-
# # Build apk.
32-
# - run: flutter build apk
33-
34-
# # Upload generated apk to the artifacts.
35-
# - uses: actions/upload-artifact@v1
36-
# with:
37-
# name: release-apk
38-
# path: app/apks/app-release.apk
39-
4011
- uses: actions/checkout@v2
41-
- name: Login to docker hub
42-
run: docker login --username ${{ secrets.DOCKER_USERNAME }} --password ${{ secrets.DOCKER_TOKEN }}
12+
- name: Log into Docker Hub
13+
uses: docker/login-action@v2
14+
with:
15+
username: ${{ secrets.TFDOCKERHUB_USERNAME }}
16+
password: ${{ secrets.TFDOCKERHUB_PASSWORD }}
17+
4318
- name: Set config
4419
run: mv frontend/public/config.staging.js frontend/public/config.js
45-
- name: Build the Docker image
46-
run: docker build . --file Dockerfile --tag jimber/3botlogin:staging-${{ github.sha }}
47-
- name: Push the Docker image
48-
run: docker push jimber/3botlogin:staging-${{ github.sha }}
49-
20+
- name: Build the 3botlogin Docker image
21+
run: docker build . --file Dockerfile --tag threefolddev/3botlogin:staging-${{ github.sha }}
22+
- name: Push the 3botlogin Docker image
23+
run: docker push threefolddev/3botlogin:staging-${{ github.sha }}
24+
- name: Build wizard Docker image
25+
run: docker build wizard/ --file wizard/Dockerfile --tag threefolddev/wizard:staging-${{ github.sha }}
26+
- name: Push wizard Docker image
27+
run: docker push threefolddev/wizard:staging-${{ github.sha }}
28+
5029
deploy:
51-
needs: build
52-
runs-on: tfc-connect-staging
30+
needs: [build]
31+
runs-on: ubuntu-latest
5332
steps:
54-
- name: Login to docker hub
55-
run: docker login --username ${{ secrets.DOCKER_USERNAME }} --password ${{ secrets.DOCKER_TOKEN }}
56-
- name: kill old docker
57-
run: docker rm -f 3botlogin || true
58-
- name: Pull Image
59-
run: docker pull jimber/3botlogin:staging-${{ github.sha }}
60-
- name: Run new docker
61-
run: docker run -d -it --restart=unless-stopped --name 3botlogin -v /opt/3botlogin/pythonsqlite.db:/usr/share/nginx/backend/pythonsqlite.db -v /opt/3botlogin/config.ini:/usr/share/nginx/backend/config.ini --network=proxy jimber/3botlogin:staging-${{ github.sha }}
33+
- uses: actions/checkout@v2
34+
- name: Set authorization certificate
35+
run: |
36+
mkdir ${HOME}/.kube
37+
echo ${{ secrets.TF_KUBE_CONFIG }} | base64 --decode > ${HOME}/.kube/config
38+
- name: Install or Upgrade production on cluster
39+
run: |
40+
helm upgrade threebotlogin --install helm_files -f helm_files/valuesStaging.yaml --set images.login.tag=staging-${{ github.sha }} --set images.wizard.tag=staging-${{ github.sha }} -n threefoldconnect-staging

frontend/public/config.staging.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export default ({
2-
apiurl: 'https://login.staging.jimber.io/',
3-
openkycurl: 'https://openkyc.staging.jimber.io/',
2+
apiurl: 'https://login.staging.threefold.me/',
3+
openkycurl: 'https://kyc.staging.threefold.me/',
44
deeplink: 'threebot-staging://'
55
})

helm_files/values.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ replicaCount: 1
77
#tags vary per environment (staging/testing/production) change in according value files.
88
images:
99
login:
10-
repo: jimber/3botlogin
10+
repo: threefolddev/3botlogin
1111
containerPort: 80
1212
wizard:
13-
repo: jimber/wizard
13+
repo: threefolddev/wizard
1414
containerPort: 80
1515

1616
services:
@@ -36,13 +36,13 @@ storage:
3636

3737
claims:
3838
data:
39-
name: threebotlogin
39+
name: threebotlogin-staging
4040
accessModes: ReadWriteMany
4141
storage: 2G
4242

4343

4444
acme:
45-
email: laudr1997@gmail.com
45+
email: operations@threefold.io
4646

4747

4848
serviceAccount:

helm_files/valuesStaging.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,25 @@ environment: staging
77
images:
88
login:
99
name: threebotlogin-staging
10-
tag: staging-2
10+
repo: threefolddev/3botlogin
1111
wizard:
12-
name: wizard-prod
13-
tag: latest
12+
name: wizard-staging
13+
repo: threefolddev/wizard
1414

1515

1616
ingress:
1717
# Used to create an Ingress record.
1818
hosts:
19-
- name: login-helm-staging.jimbertesting.be
19+
- name: login.staging.threefold.me
2020
# default paths for "/" and "/*" will be added
2121
path: /
2222
service: threebotlogin-staging
2323
port: 80
24-
- name: login-helm-staging.jimbertesting.be
24+
- name: login.staging.threefold.me
2525
path: /socket.io/
2626
service: threebotlogin-staging
2727
port: 5000
28-
- name: wizard-helm-staging.jimbertesting.be
28+
- name: wizard.staging.threefold.me
2929
path: /
30-
service: wizard-prod
30+
service: wizard-staging
3131
port: 82

wizard/Dockerfile

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,23 @@
1-
FROM ubuntu:latest as builder
1+
FROM python:2.7 as builder
22
RUN apt-get update
33

44
# Is optional, but if you are not going to use this then you will need to install
55
# 'gnupg' for nodesource so it can setup node install
6-
RUN apt-get install -y build-essential python make gcc g++
7-
8-
RUN apt-get -y install curl
6+
RUN apt-get install -y build-essential python make gcc g++ curl
97

108
# The next 2 steps will install node
119
RUN curl -sL https://deb.nodesource.com/setup_15.x | bash -
1210

1311
RUN apt-get install -y nodejs
1412

15-
# The next 3 steps are for installing yarn
16-
RUN curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
17-
18-
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list
13+
# The next step is for installing yarn
1914

20-
RUN apt-get update && apt-get install yarn
15+
RUN npm install -g yarn
2116

2217
WORKDIR /app
2318
COPY package.json package.json
2419
COPY yarn.lock yarn.lock
25-
RUN yarn install
20+
RUN yarn install --ignore-engines
2621
COPY . .
2722
RUN yarn build
2823

0 commit comments

Comments
 (0)