-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #813 from msusicky/develop
2.10.0 - revival
- Loading branch information
Showing
41 changed files
with
253 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,8 +16,6 @@ jobs: | |
SSH_PORT: ${{ secrets.SSH_PORT }} | ||
SSH_USER_WEB: ${{ secrets.SSH_USER_WEB }} | ||
steps: | ||
- id: ip | ||
uses: haythem/[email protected] | ||
- name: Setup SSH key | ||
run: | | ||
mkdir -p ~/.ssh/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,8 +18,6 @@ jobs: | |
SSH_PORT: ${{ secrets.SSH_PORT }} | ||
SSH_USER_WEB: ${{ secrets.SSH_USER_WEB }} | ||
steps: | ||
- id: ip | ||
uses: haythem/[email protected] | ||
- name: Setup SSH key | ||
run: | | ||
mkdir -p ~/.ssh/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,9 +23,7 @@ jobs: | |
SSH_USER: ${{ secrets.SSH_USER }} | ||
SSH_USER_WEB: ${{ secrets.SSH_USER_WEB }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- id: ip | ||
uses: haythem/[email protected] | ||
- uses: actions/checkout@v4 | ||
- name: Prepare config file | ||
uses: falnyr/[email protected] | ||
env: | ||
|
@@ -61,7 +59,7 @@ jobs: | |
- name: Unpack release and clean tmp | ||
run: ssh ${SSH_USER_WEB}@${SSH_HOST} -p ${SSH_PORT} "tar -xvf ${TMP_DIR}/release.tar -C ${RELEASE_DIR} && rm ${TMP_DIR}/*" | ||
- name: Create venv and install requirements | ||
run: ssh ${SSH_USER_WEB}@${SSH_HOST} -p ${SSH_PORT} "cd ${RELEASE_DIR} && ~/Python-3.10.0/python -m venv venv && source venv/bin/activate && pip install -r requirements.txt --no-cache-dir" | ||
run: ssh ${SSH_USER_WEB}@${SSH_HOST} -p ${SSH_PORT} "cd ${RELEASE_DIR} && python3 -m venv venv && source venv/bin/activate && pip install -r requirements.txt --no-cache-dir" | ||
- name: Swap releases | ||
run: ssh ${SSH_USER_WEB}@${SSH_HOST} -p ${SSH_PORT} "rm -f ${APP_DIR} && ln -s ${RELEASE_DIR} ${APP_DIR} && find ${RELEASES_DIR} -maxdepth 1 -mindepth 1 -not -path ${RELEASE_DIR} -exec rm -rf {} \;" | ||
- name: Execute migrations | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,9 +21,7 @@ jobs: | |
SSH_USER: ${{ secrets.SSH_USER }} | ||
SSH_USER_WEB: ${{ secrets.SSH_USER_WEB }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- id: ip | ||
uses: haythem/[email protected] | ||
- uses: actions/checkout@v4 | ||
- name: Prepare config file | ||
uses: falnyr/[email protected] | ||
env: | ||
|
@@ -59,7 +57,7 @@ jobs: | |
- name: Unpack release and clean tmp | ||
run: ssh ${SSH_USER_WEB}@${SSH_HOST} -p ${SSH_PORT} "tar -xvf ${TMP_DIR}/release.tar -C ${RELEASE_DIR} && rm ${TMP_DIR}/*" | ||
- name: Create venv and install requirements | ||
run: ssh ${SSH_USER_WEB}@${SSH_HOST} -p ${SSH_PORT} "cd ${RELEASE_DIR} && ~/Python-3.10.0/python -m venv venv && source venv/bin/activate && pip install -r requirements.txt --no-cache-dir" | ||
run: ssh ${SSH_USER_WEB}@${SSH_HOST} -p ${SSH_PORT} "cd ${RELEASE_DIR} && python3 -m venv venv && source venv/bin/activate && pip install -r requirements.txt --no-cache-dir" | ||
- name: Swap releases | ||
run: ssh ${SSH_USER_WEB}@${SSH_HOST} -p ${SSH_PORT} "rm -f ${APP_DIR} && ln -s ${RELEASE_DIR} ${APP_DIR} && find ${RELEASES_DIR} -maxdepth 1 -mindepth 1 -not -path ${RELEASE_DIR} -exec rm -rf {} \;" | ||
- name: Execute migrations | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,8 +17,6 @@ jobs: | |
SSH_PORT: ${{ secrets.SSH_PORT }} | ||
SSH_USER_WEB: ${{ secrets.SSH_USER_WEB }} | ||
steps: | ||
- id: ip | ||
uses: haythem/[email protected] | ||
- name: Setup SSH key | ||
run: | | ||
mkdir -p ~/.ssh/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,8 +17,6 @@ jobs: | |
SSH_PORT: ${{ secrets.SSH_PORT }} | ||
SSH_USER_WEB: ${{ secrets.SSH_USER_WEB }} | ||
steps: | ||
- id: ip | ||
uses: haythem/[email protected] | ||
- name: Setup SSH key | ||
run: | | ||
mkdir -p ~/.ssh/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,8 +21,6 @@ jobs: | |
SSH_PORT: ${{ secrets.SSH_PORT }} | ||
SSH_USER_WEB: ${{ secrets.SSH_USER_WEB }} | ||
steps: | ||
- id: ip | ||
uses: haythem/[email protected] | ||
- name: Setup SSH key | ||
run: | | ||
mkdir -p ~/.ssh/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,19 +16,38 @@ jobs: | |
SSH_KEY: ${{ secrets.SSH_KEY }} | ||
SSH_PORT: ${{ secrets.SSH_PORT }} | ||
SSH_USER_WEB: ${{ secrets.SSH_USER_WEB }} | ||
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} | ||
AZURE_RESOURCE_GROUP: ${{ secrets.AZURE_RESOURCE_GROUP }} | ||
AZURE_VM_NAME: ${{ secrets.AZURE_VM_NAME }} | ||
steps: | ||
- id: ip | ||
uses: haythem/[email protected] | ||
- name: Setup SSH key | ||
run: | | ||
mkdir -p ~/.ssh/ | ||
ssh-keyscan -H ${SSH_HOST} >> ~/.ssh/known_hosts | ||
eval `ssh-agent -s` | ||
echo "${SSH_KEY}" | tr -d '\r' | ssh-add - | ||
echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK" >> $GITHUB_ENV | ||
- name: Azure login | ||
uses: azure/login@v2 | ||
with: | ||
creds: ${{ secrets.AZURE_CREDENTIALS }} | ||
- name: Azure scale up VM | ||
uses: azure/cli@v2 | ||
with: | ||
inlineScript: | | ||
az vm deallocate --resource-group ${AZURE_RESOURCE_GROUP} --name ${AZURE_VM_NAME} | ||
az vm resize --resource-group ${AZURE_RESOURCE_GROUP} --name ${AZURE_VM_NAME} --size Standard_D4s_v3 | ||
az vm start --resource-group ${AZURE_RESOURCE_GROUP} --name ${AZURE_VM_NAME} | ||
- name: Execute fetcher | ||
run: ssh ${SSH_USER_WEB}@${SSH_HOST} -p ${SSH_PORT} -o ServerAliveInterval=120 "cd ${APP_DIR} && source venv/bin/activate && flask fetch-data all" | ||
- name: Compute metrics | ||
run: ssh ${SSH_USER_WEB}@${SSH_HOST} -p ${SSH_PORT} -o ServerAliveInterval=120 "cd ${APP_DIR} && source venv/bin/activate && flask compute-metrics all" | ||
- name: Verify data | ||
run: ssh ${SSH_USER_WEB}@${SSH_HOST} -p ${SSH_PORT} "cd ${APP_DIR} && source venv/bin/activate && flask verify-data" | ||
- name: Azure scale down VM | ||
uses: azure/cli@v2 | ||
with: | ||
inlineScript: | | ||
az vm deallocate --resource-group ${AZURE_RESOURCE_GROUP} --name ${AZURE_VM_NAME} | ||
az vm resize --resource-group ${AZURE_RESOURCE_GROUP} --name ${AZURE_VM_NAME} --size Standard_B1s | ||
az vm start --resource-group ${AZURE_RESOURCE_GROUP} --name ${AZURE_VM_NAME} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,8 +17,6 @@ jobs: | |
SSH_PORT: ${{ secrets.SSH_PORT }} | ||
SSH_USER_WEB: ${{ secrets.SSH_USER_WEB }} | ||
steps: | ||
- id: ip | ||
uses: haythem/[email protected] | ||
- name: Setup SSH key | ||
run: | | ||
mkdir -p ~/.ssh/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,8 +17,6 @@ jobs: | |
SSH_PORT: ${{ secrets.SSH_PORT }} | ||
SSH_USER_WEB: ${{ secrets.SSH_USER_WEB }} | ||
steps: | ||
- id: ip | ||
uses: haythem/[email protected] | ||
- name: Setup SSH key | ||
run: | | ||
mkdir -p ~/.ssh/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,8 +21,6 @@ jobs: | |
SSH_PORT: ${{ secrets.SSH_PORT }} | ||
SSH_USER_WEB: ${{ secrets.SSH_USER_WEB }} | ||
steps: | ||
- id: ip | ||
uses: haythem/[email protected] | ||
- name: Setup SSH key | ||
run: | | ||
mkdir -p ~/.ssh/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.