Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
C
Controller
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
4
Issues
4
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Guardians of the Kretschmar Elock System
Controller
Commits
6dc3fb50
Commit
6dc3fb50
authored
Mar 17, 2021
by
Jacob Priddy
👌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update deploy procedure and some config defaults
parent
2fc2f977
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
23 deletions
+45
-23
.gitlab-ci.yml
.gitlab-ci.yml
+41
-19
main/include/config.h.example
main/include/config.h.example
+4
-4
No files found.
.gitlab-ci.yml
View file @
6dc3fb50
image
:
gitlab.cs.wallawalla.edu:5050/elock/controller:latest
.get_version_from_tag
:
variables
:
VERSION
:
$CI_COMMIT_TAG
.get_version_from_build
:
variables
:
VERSION
:
0.0.0.$CI_PIPELINE_ID
stages
:
-
build
-
test
...
...
@@ -18,42 +26,56 @@ build_tests:
-
build/door-controller-universal-tests
expire_in
:
1 hour
build_esp32_application
:
test_application
:
stage
:
test
script
:
-
build/door-controller-universal-tests
.build_esp32
:
stage
:
build
script
:
-
echo $WEBSERVER_ROOT_CERT | base64 -d -w 0 > main/doorcode_root_cert.cert
-
cp main/include/config.h.example main/include/config.h
-
echo $VERSION > version.txt
-
/opt/esp/entrypoint.sh bash
-
idf.py build
artifacts
:
paths
:
-
build/door-controller.bin
-
version.txt
expire_in
:
2 months
test_application
:
stage
:
test
script
:
-
build/door-controller-universal-tests
.build_head
:
extends
:
-
.get_version_from_build
-
.build_esp32
except
:
refs
:
-
tags
.build_release
:
extends
:
-
.get_version_from_tag
-
.build_esp32
only
:
refs
:
-
tags
deploy_controller_update
:
stage
:
deploy
before_script
:
-
apt-get update -qq
-
apt-get install -qq rsync
-
'
which
ssh-agent
||
(
apt-get
update
-y
&&
apt-get
install
openssh-client
-y
)'
-
eval $(ssh-agent -s)
-
ssh-add <(echo "$SSH_PRIVATE_KEY" | base64 -d -w 0)
-
mkdir -p ~/.ssh
-
'
[[
-f
/.dockerenv
]]
&&
echo
-e
"Host
*\n\tStrictHostKeyChecking
no\n\n"
>
~/.ssh/config'
tags
:
-
elock
extends
:
-
.get_version_from_tag
script
:
-
echo "$SIGNING_KEY" | base64 -d -w 0 > decoded.pem
-
espsecure.py sign_data --keyfile decoded.pem --version 1 build/door-controller.bin
-
version=$(<version.txt)
-
deploy_name="v${version}.bin"
-
deploy_name="v${VERSION}.bin"
-
echo "Deploying ${deploy_name}"
# Can't use the CI job token to deploy the artifact because that's a "pRemiUm FEATurE"
-
"
rsync
build/door-controller.bin
$SSH_USER@$SSH_HOST:/home/$SSH_USER/doorcode/src/backend/storage/app/controller/binaries/$deploy_name"
when
:
manual
-
chown 1000:1000 build/door-controller.bin
-
mv build/door-controller.bin $PROJ_DIR/controller-bins/$deploy_name
only
:
-
master
refs
:
-
tags
main/include/config.h.example
View file @
6dc3fb50
...
...
@@ -11,7 +11,7 @@
#define API_BASE_PATH "/api/door"
#define API_UPDATE_URL API_BASE_PATH "/update"
#define API_TIMEOUT_MS
100
00
#define API_TIMEOUT_MS
35
00
#define API_USE_SSL
#define API_NO_NAME_VERIFY
...
...
@@ -30,7 +30,7 @@
// Every Day
#define SNTP_UPDATE_INTERVAL_MS (1000*60*60*24)
#define UPDATE_SKIP_VERSION_CHECK
//
#define UPDATE_SKIP_VERSION_CHECK
#define DOOR_LATCH_PIN 19
...
...
@@ -48,8 +48,8 @@
#define MIN_CODE_LENGTH 4
//
15 minutes
#define STATUS_MAX_NO_CONTACT_TIME_MS (1000 * 60
* 15
)
//
Time in MS we are allowed to go without contacting the server
#define STATUS_MAX_NO_CONTACT_TIME_MS (1000 * 60)
// How often to update the keypad state
#define KEYPAD_SCAN_PERIOD_MS 50
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment