- Android PWA/WASM launcher with glassmorphism UI - Loads https://admin.dark.side directly on launch - Complete GitLab CI/CD pipeline configuration - Automated builds for Debug, Release, and AAB - Full WASM support with optimized WebView - Material Design 3 theme - Comprehensive documentation Features: - Auto-load target URL on app launch - Glassmorphism components (frosted glass effects) - Full PWA/WASM support - Room database for future extensions - Jetpack Compose UI - CI/CD with artifact storage Built for SilverLABS
353 lines
8.3 KiB
Markdown
353 lines
8.3 KiB
Markdown
# GitLab CI/CD Setup - Complete Summary
|
|
|
|
## ✅ What Was Configured
|
|
|
|
A fully automated Android CI/CD pipeline for SilverDROID that builds, tests, and deploys your Dark Side Admin APK.
|
|
|
|
---
|
|
|
|
## 📦 Files Created
|
|
|
|
### 1. `.gitlab-ci.yml`
|
|
**Complete CI/CD pipeline configuration with:**
|
|
- 4 stages: prepare, test, build, deploy
|
|
- 12 jobs covering all aspects of Android development
|
|
- Automatic caching for faster builds
|
|
- Artifact storage for 30-90 days
|
|
- Parallel job execution
|
|
|
|
### 2. `GITLAB_CICD_SETUP.md`
|
|
**Comprehensive setup guide including:**
|
|
- Step-by-step GitLab project creation
|
|
- Runner configuration instructions
|
|
- Pipeline architecture explanation
|
|
- Troubleshooting section
|
|
- Advanced features guide
|
|
|
|
### 3. `push-to-gitlab.sh`
|
|
**Bash script for automated push:**
|
|
- Initializes git repository
|
|
- Configures remote
|
|
- Commits changes
|
|
- Pushes to GitLab
|
|
- Updates project metadata
|
|
|
|
### 4. `push-to-gitlab.ps1`
|
|
**PowerShell version for Windows:**
|
|
- Same functionality as bash script
|
|
- Windows-friendly colored output
|
|
- Error handling for Windows environments
|
|
|
|
---
|
|
|
|
## 🚀 Quick Start
|
|
|
|
### Option 1: Automated Push (Recommended)
|
|
|
|
**From WSL/Linux:**
|
|
```bash
|
|
cd /mnt/c/Production/Source/SilverLABS/SilverDROID
|
|
./push-to-gitlab.sh
|
|
```
|
|
|
|
**From Windows PowerShell:**
|
|
```powershell
|
|
cd C:\Production\Source\SilverLABS\SilverDROID
|
|
.\push-to-gitlab.ps1
|
|
```
|
|
|
|
### Option 2: Manual Push
|
|
|
|
```bash
|
|
cd /mnt/c/Production/Source/SilverLABS/SilverDROID
|
|
|
|
# Initialize and configure
|
|
git init
|
|
git remote add origin https://gitlab.silverlabs.uk/SilverLABS/silverdroid.git
|
|
|
|
# Commit and push
|
|
git add .
|
|
git commit -m "Initial commit - SilverDROID CI/CD"
|
|
git push -u origin main
|
|
```
|
|
|
|
---
|
|
|
|
## 🏗️ Pipeline Overview
|
|
|
|
### Build Stages
|
|
|
|
```
|
|
prepare (1 min)
|
|
↓
|
|
test (2 min)
|
|
├─ lint
|
|
├─ unit_tests
|
|
└─ security:scan
|
|
↓
|
|
build (3-5 min)
|
|
├─ build:debug
|
|
├─ build:release
|
|
└─ build:bundle
|
|
↓
|
|
deploy (30 sec)
|
|
├─ deploy:staging
|
|
├─ deploy:production
|
|
├─ apk:info
|
|
└─ notify:*
|
|
```
|
|
|
|
### Total Time: ~5-8 minutes
|
|
|
|
---
|
|
|
|
## 📦 Build Outputs
|
|
|
|
### Debug APK
|
|
- **Path:** `app/build/outputs/apk/debug/app-debug.apk`
|
|
- **Size:** ~10-15 MB
|
|
- **Retention:** 30 days
|
|
- **Triggers:** All branches
|
|
|
|
### Release APK
|
|
- **Path:** `app/build/outputs/apk/release/app-release-unsigned.apk`
|
|
- **Size:** ~8-10 MB
|
|
- **Retention:** 90 days
|
|
- **Triggers:** main branch, tags
|
|
|
|
### Android App Bundle (AAB)
|
|
- **Path:** `app/build/outputs/bundle/release/app-release.aab`
|
|
- **Size:** ~8-10 MB
|
|
- **Retention:** 90 days
|
|
- **Triggers:** main branch, tags
|
|
- **Use:** Google Play Store submission
|
|
|
|
---
|
|
|
|
## 🔧 Features
|
|
|
|
### Automatic Features
|
|
✅ **Gradle Caching** - 90% faster subsequent builds
|
|
✅ **Parallel Jobs** - Multiple builds run simultaneously
|
|
✅ **Artifact Storage** - All APKs saved and downloadable
|
|
✅ **Test Reports** - JUnit XML format
|
|
✅ **Lint Reports** - HTML and XML format
|
|
✅ **Security Scanning** - Dependency vulnerability checks
|
|
✅ **Build Metadata** - Size, commit, date tracked
|
|
|
|
### Manual Features
|
|
⚙️ **Production Deployment** - Manual approval required
|
|
⚙️ **Signed APKs** - Optional keystore configuration
|
|
⚙️ **Notifications** - Slack/Mattermost webhooks
|
|
⚙️ **TeamCity Integration** - Trigger external builds
|
|
|
|
---
|
|
|
|
## 📊 Pipeline Jobs
|
|
|
|
| Job | Purpose | Triggers | Output |
|
|
|-----|---------|----------|--------|
|
|
| **prepare:dependencies** | Cache Gradle deps | All | Cached `.gradle/` |
|
|
| **lint** | Code quality | All | HTML/XML reports |
|
|
| **unit_tests** | Run tests | All | JUnit XML |
|
|
| **security:scan** | Vulnerability scan | main/develop | Security report |
|
|
| **build:debug** | Debug APK | All | app-debug.apk |
|
|
| **build:release** | Release APK | main/tags | app-release.apk |
|
|
| **build:bundle** | AAB bundle | main/tags | app-release.aab |
|
|
| **deploy:staging** | Stage deployment | develop | Staging env |
|
|
| **deploy:production** | Prod deployment | tags | Production env |
|
|
| **apk:info** | Build metadata | main/develop | apk-info.txt |
|
|
| **notify:success** | Success alert | main | Notification |
|
|
| **notify:failure** | Failure alert | main | Notification |
|
|
|
|
---
|
|
|
|
## 🌐 Access URLs
|
|
|
|
### GitLab Project
|
|
```
|
|
https://gitlab.silverlabs.uk/SilverLABS/silverdroid
|
|
```
|
|
|
|
### Pipeline Dashboard
|
|
```
|
|
https://gitlab.silverlabs.uk/SilverLABS/silverdroid/-/pipelines
|
|
```
|
|
|
|
### Jobs List
|
|
```
|
|
https://gitlab.silverlabs.uk/SilverLABS/silverdroid/-/jobs
|
|
```
|
|
|
|
### Download Latest Debug APK
|
|
```
|
|
https://gitlab.silverlabs.uk/SilverLABS/silverdroid/-/jobs/artifacts/main/raw/app/build/outputs/apk/debug/app-debug.apk?job=build:debug
|
|
```
|
|
|
|
### Download Latest Release APK
|
|
```
|
|
https://gitlab.silverlabs.uk/SilverLABS/silverdroid/-/jobs/artifacts/main/raw/app/build/outputs/apk/release/app-release-unsigned.apk?job=build:release
|
|
```
|
|
|
|
---
|
|
|
|
## 🔐 Security & Signing
|
|
|
|
### Optional: APK Signing
|
|
|
|
To sign release APKs, add these GitLab CI/CD variables:
|
|
|
|
**Settings → CI/CD → Variables:**
|
|
- `KEYSTORE_FILE` - Base64 encoded keystore
|
|
- `KEYSTORE_PASSWORD` - Keystore password
|
|
- `KEY_ALIAS` - Key alias (e.g., "silverdroid")
|
|
- `KEY_PASSWORD` - Key password
|
|
|
|
**Generate keystore:**
|
|
```bash
|
|
keytool -genkey -v -keystore silverdroid.keystore \
|
|
-alias silverdroid -keyalg RSA -keysize 2048 -validity 10000
|
|
|
|
base64 -w 0 silverdroid.keystore > keystore.base64
|
|
```
|
|
|
|
Then update `.gitlab-ci.yml` to use signing (see GITLAB_CICD_SETUP.md).
|
|
|
|
---
|
|
|
|
## 🔄 Workflow
|
|
|
|
### Development Workflow
|
|
|
|
1. **Make changes** to code
|
|
2. **Commit** to feature branch
|
|
3. **Push** to GitLab
|
|
4. **Pipeline runs** automatically
|
|
5. **Debug APK** generated
|
|
6. **Download** from artifacts
|
|
7. **Test** on device
|
|
|
|
### Release Workflow
|
|
|
|
1. **Merge** to main branch
|
|
2. **Tag** release: `git tag v1.0.0`
|
|
3. **Push tag:** `git push origin v1.0.0`
|
|
4. **Pipeline runs** with release builds
|
|
5. **Release APK + AAB** generated
|
|
6. **Manual approval** for production
|
|
7. **Download** signed APK/AAB
|
|
8. **Deploy** to Play Store
|
|
|
|
---
|
|
|
|
## 📈 Monitoring
|
|
|
|
### Pipeline Status Badge
|
|
|
|
Add to README.md:
|
|
```markdown
|
|
[](https://gitlab.silverlabs.uk/SilverLABS/silverdroid/-/pipelines)
|
|
```
|
|
|
|
### Check Pipeline Status via API
|
|
|
|
```bash
|
|
curl "https://gitlab.silverlabs.uk/api/v4/projects/SilverLABS%2Fsilverdroid/pipelines" \
|
|
--header "PRIVATE-TOKEN: glpat-wqUcD7mg53F1mgM-N-PdiW86MQp1OjEH.01.0w074ox93"
|
|
```
|
|
|
|
### Download Latest APK via API
|
|
|
|
```bash
|
|
curl -L "https://gitlab.silverlabs.uk/api/v4/projects/SilverLABS%2Fsilverdroid/jobs/artifacts/main/download?job=build:debug" \
|
|
--header "PRIVATE-TOKEN: glpat-wqUcD7mg53F1mgM-N-PdiW86MQp1OjEH.01.0w074ox93" \
|
|
-o silverdroid-debug.zip
|
|
```
|
|
|
|
---
|
|
|
|
## 🐛 Troubleshooting
|
|
|
|
### Pipeline Doesn't Start
|
|
- Check GitLab Runner is active: Settings → CI/CD → Runners
|
|
- Verify `.gitlab-ci.yml` is in root directory
|
|
- Check syntax: CI/CD → Pipelines → CI Lint
|
|
|
|
### Build Fails: "Gradle not found"
|
|
- Runner may not have Android SDK
|
|
- Using `mingc/android-build-box` image fixes this
|
|
- Check `image:` in `.gitlab-ci.yml`
|
|
|
|
### Can't Download Artifacts
|
|
- Check artifact expiration hasn't passed
|
|
- Verify job completed successfully (green checkmark)
|
|
- Try direct download URL (see above)
|
|
|
|
### Runner Out of Disk Space
|
|
```bash
|
|
# On GitLab server
|
|
gitlab-runner exec docker cleanup
|
|
docker system prune -a
|
|
```
|
|
|
|
---
|
|
|
|
## 🎯 Next Steps
|
|
|
|
1. **Push to GitLab**
|
|
```bash
|
|
./push-to-gitlab.sh # or .ps1 on Windows
|
|
```
|
|
|
|
2. **Watch Pipeline Run**
|
|
Visit: https://gitlab.silverlabs.uk/SilverLABS/silverdroid/-/pipelines
|
|
|
|
3. **Wait for Build** (~5-8 minutes)
|
|
|
|
4. **Download APK**
|
|
Go to: Jobs → build:debug → Browse → app/build/outputs/apk/debug/
|
|
|
|
5. **Install on Device**
|
|
```bash
|
|
adb install app-debug.apk
|
|
```
|
|
|
|
6. **Test Admin Panel**
|
|
Launch app → Should load admin.dark.side
|
|
|
|
---
|
|
|
|
## 📚 Documentation
|
|
|
|
- **GITLAB_CICD_SETUP.md** - Complete setup guide
|
|
- **BUILD.md** - Manual build instructions
|
|
- **DARK_SIDE_BUILD.md** - Custom build info
|
|
- **.gitlab-ci.yml** - Pipeline configuration
|
|
|
|
---
|
|
|
|
## ✅ Checklist
|
|
|
|
- [x] `.gitlab-ci.yml` created
|
|
- [x] Push scripts created (bash + PowerShell)
|
|
- [x] Documentation written
|
|
- [ ] **Push to GitLab** ← Next Step
|
|
- [ ] Verify pipeline runs
|
|
- [ ] Download APK
|
|
- [ ] Test on device
|
|
|
|
---
|
|
|
|
## 🎉 Ready to Go!
|
|
|
|
Your CI/CD pipeline is fully configured. Run the push script to get started:
|
|
|
|
```bash
|
|
./push-to-gitlab.sh
|
|
```
|
|
|
|
Or manually push and watch the magic happen! ✨
|
|
|
|
---
|
|
|
|
**Built for SilverLABS** | Automated Android Builds |