Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cd brench #91

Closed
wants to merge 33 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
b2cc7a1
Add CD
Sivanwol Feb 15, 2022
8b66a90
update git hub action
Sivanwol Feb 15, 2022
4b09933
update files
Sivanwol Feb 15, 2022
c3e7a5b
test
Sivanwol Feb 15, 2022
f664cba
yml syntax error
Sivanwol Feb 15, 2022
38db03a
fix vertion not rigth
Sivanwol Feb 15, 2022
f516f59
... missing something
Sivanwol Feb 15, 2022
a72cd2c
small update check if server will have correct response
Sivanwol Feb 15, 2022
a97881f
remove the part install the ssh key
Sivanwol Feb 15, 2022
65a1e7e
remove ip as secret
Sivanwol Feb 15, 2022
e5594de
small changes
Sivanwol Feb 15, 2022
d97c7be
update script way
Sivanwol Feb 15, 2022
9a29c2f
update.
Sivanwol Feb 15, 2022
1fb1bcf
recheck
Sivanwol Feb 15, 2022
a452454
...
Sivanwol Feb 15, 2022
48c468f
wtf where this char come from
Sivanwol Feb 15, 2022
29f2590
recheck
Sivanwol Feb 15, 2022
3da3c5f
change to ssh
Sivanwol Feb 15, 2022
8ebebe1
add install of ssh key
Sivanwol Feb 15, 2022
c270c51
debug stuff
Sivanwol Feb 15, 2022
cd10eb1
.
Sivanwol Feb 15, 2022
2017628
remove debug stuff
Sivanwol Feb 15, 2022
542b442
update ip on known hosts
Sivanwol Feb 15, 2022
7233143
update workflow
Sivanwol Feb 15, 2022
b7c5f4d
improve workflow files
Sivanwol Feb 15, 2022
44d089d
update rsync
Sivanwol Feb 15, 2022
7faff0b
small update for connecion close
Sivanwol Feb 15, 2022
9f949d0
update scrupt
Sivanwol Feb 15, 2022
1f4c4f8
update composer
Sivanwol Feb 15, 2022
1761f34
recheck it working well
Sivanwol Feb 15, 2022
571d688
reload
Sivanwol Feb 15, 2022
e59920c
update package
Sivanwol Feb 15, 2022
ed4492d
update to git ignore
Sivanwol Feb 16, 2022
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
76 changes: 76 additions & 0 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# This is a basic workflow to help you get started with Actions

name: CI-CD

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]
# check_run:
# types: [rerequested, completed]
workflow_run:
workflows: ["build"]
types: [requested]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.CD_SERVER_KEY }}
known_hosts: 67.207.78.240
- name: Server Oprations
uses: appleboy/ssh-action@master
with:
host: 67.207.78.240
port: 22
username: root
key: ${{secrets.CD_SERVER_KEY}}
script: |
cd /var/www/html/vendor
rm -fr forter
mkdir -p forter
chown www-data:www-data -R ./forter
- name: Deploy with Plugin
timeout-minutes: 30
uses: burnett01/rsync-deployments@5.2
with:
switches: -avzr --delete
path: ./
remote_path: /var/www/html/vendor/forter
remote_host: 67.207.78.240
remote_user: root
remote_key: ${{ secrets.CD_SERVER_KEY }}
# Runs a single command using the runners shell
- name: Server Oprations
uses: appleboy/ssh-action@master
with:
host: 67.207.78.240
port: 22
username: root
key: ${{secrets.CD_SERVER_KEY}}
script: |
cd /var/www/html
chown www-data:www-data -R ./vendor/forter
composer install
php bin/magento maintenance:enable
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
php bin/magento maintenance:disable
php bin/magento cache:flush
75 changes: 75 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/.buildpath
/.cache
/.metadata
/.project
/.settings
/.vscode
atlassian*
/nbproject
/robots.txt
/pub/robots.txt
/sitemap
/sitemap.xml
/pub/sitemap
/pub/sitemap.xml
/.idea
/.gitattributes
/app/config_sandbox
/app/etc/config.php
/app/etc/env.php
/app/code/Magento/TestModule*
/lib/internal/flex/uploader/.actionScriptProperties
/lib/internal/flex/uploader/.flexProperties
/lib/internal/flex/uploader/.project
/lib/internal/flex/uploader/.settings
/lib/internal/flex/varien/.actionScriptProperties
/lib/internal/flex/varien/.flexLibProperties
/lib/internal/flex/varien/.project
/lib/internal/flex/varien/.settings
/node_modules
/.grunt
/Gruntfile.js
/package.json
/.php_cs
/.php_cs.cache
/grunt-config.json
/pub/media/*.*
!/pub/media/.htaccess
/pub/media/attribute/*
!/pub/media/attribute/.htaccess
/pub/media/analytics/*
/pub/media/catalog/*
!/pub/media/catalog/.htaccess
/pub/media/customer/*
!/pub/media/customer/.htaccess
/pub/media/downloadable/*
!/pub/media/downloadable/.htaccess
/pub/media/favicon/*
/pub/media/import/*
!/pub/media/import/.htaccess
/pub/media/logo/*
/pub/media/custom_options/*
!/pub/media/custom_options/.htaccess
/pub/media/theme/*
/pub/media/theme_customization/*
!/pub/media/theme_customization/.htaccess
/pub/media/wysiwyg/*
!/pub/media/wysiwyg/.htaccess
/pub/media/tmp/*
!/pub/media/tmp/.htaccess
/pub/media/captcha/*
/pub/media/sitemap/*
!/pub/media/sitemap/.htaccess
/pub/static/*
!/pub/static/.htaccess

/var/*
!/var/.htaccess
/vendor/*
!/vendor/.htaccess
/generated/*
!/generated/.htaccess
.DS_Store
auth.json
*.todo
/tasks/*
8 changes: 8 additions & 0 deletions auth.json.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"http-basic": {
"repo.magento.com": {
"username": "<public-key>",
"password": "<private-key>"
}
}
}
41 changes: 34 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,52 @@
"name": "forter/magento2-module-forter",
"description": "Forter Fraud Prevention For Magento 2",
"require": {
"php": ">=5.6"
"php": ">=7.2.0",
"magento/module-config": "101.0.*||101.1.*",
"magento/module-sales": "101.0.*||102.0.*",
"magento/module-directory": "100.2.*||100.3.*",
"magento/module-payment": "100.2.*||100.3.*",
"magento/module-checkout": "100.2.*||100.3.*",
"magento/module-backend": "100.2.*||101.0.*",
"magento/framework": "*",
"ext-json": "*"
},
"require-dev": {
"phpunit/phpunit": "~6.5.0",
"magento/magento-coding-standard": "*",
"squizlabs/php_codesniffer": "~3.5.3"
},
"type": "magento2-module",
"license": [
"proprietary"
],
"version": "2.0.54",
"authors": [{
"name": "Forter Dev",
"email": "support@forter.com",
"role": "Developer",
"homepage": "https://www.forter.com/"
}],
"authors": [
{
"name": "Forter Dev",
"email": "support@forter.com",
"role": "Developer",
"homepage": "https://www.forter.com/"
}
],
"autoload": {
"files": [
"registration.php"
],
"psr-4": {
"Forter\\Forter\\": ""
}
},
"post-install-cmd": [
"([ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard/)"
],
"post-update-cmd": [
"([ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard/)"
],
"repositories": {
"magento": {
"type": "composer",
"url": "https://repo.magento.com"
}
}
}