Skip to content

Commit d954f61

Browse files
committed
fix: fix the release script
1 parent bc636c2 commit d954f61

File tree

4 files changed

+27
-60
lines changed

4 files changed

+27
-60
lines changed

.github/workflows/release.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ jobs:
2323
- name: Log in to GitHub Container Registry
2424
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
2525

26-
- name: Set up Docker Buildx
27-
uses: docker/setup-buildx-action@v3
28-
2926
- name: Install dependencies
3027
run: npm ci
3128

.releaserc

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,19 @@
1111
"changelogFile": "CHANGELOG.md"
1212
}
1313
],
14-
"@semantic-release/git"
14+
[
15+
"@semantic-release/git",
16+
{
17+
"assets": [
18+
"CHANGELOG.md"
19+
],
20+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
21+
}
22+
]
1523
],
1624
"prepare": [
17-
{
18-
"path": "./scripts/publish-docker.js"
19-
}
25+
"@semantic-release/changelog",
26+
"./publish-docker.js",
27+
"@semantic-release/git"
2028
]
2129
}

README.md

Lines changed: 4 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,14 @@ To install this service, the fist time, you will need to:
1010

1111
1. Required tools and versions:
1212
1. Install `node` and `npm` according to the directions at https://nodejs.org/en/download/package-manager
13+
2. `make` and `docker` are used for local development
1314
2. Clone the service: `https://github.com/Local-Connectivity-Lab/ccn-coverage-vis`
1415
3. Configure:
1516
1. `cd cd ccn-coverage-vis`
1617
1. Edit `src/utils/config.ts` and set the correct URL for your API host (if you're testing or you're deploying to a new URL).
1718

18-
19-
## Deploying
20-
Once the service has been setup (as above), it can be deployed using the following process:
21-
1. Login to the coverage-host
22-
2. Pull the lastest version from github
23-
3. Restart the service
24-
25-
The shell commands are:
26-
```
27-
ssh coverage-host
28-
cd ccn-coverage-vis
29-
git pull
30-
npm install
31-
npm run build
32-
pm2 restart Vis Server
33-
```
19+
## Development
20+
Avoid committing your change directly to the `main` branch. Check out your own private branch for your development and submit a pull request when the feature/bug fix/cleanup is ready for review. Follow the [Angular Commit Message Conventions](https://github.com/angular/angular/blob/main/contributing-docs/commit-message-guidelines.md) for your commit message. Versions will be managed based on those commit messages.
3421

3522
## Troubleshooting & Recovery
3623
When a problem occurs, there are several checks to determine where the failure is:
@@ -56,22 +43,6 @@ Look in the first column, Status:
5643
* Timeout or unreachable error: Something is broken in the network between your web browser and the coverage-vis host.
5744

5845

59-
### Checking ccn-coverage-vis with pm2
60-
Next, confirm ccn-coverage-vis is operating as expected. To do this, you will need to be able to log into the server hosting the coverage service.
61-
62-
Use `pm2 list` to confirm the "Vis Server" is **online**
63-
```
64-
ssh coverage-host
65-
pm2 list
66-
```
67-
![Online services under PM2](pm2-running-services.png "Online services under PM2")
68-
69-
If the "Vis Server" is not online as expected, restart it with:
70-
```
71-
pm2 restart Vis Server
72-
```
73-
74-
7546
### Checking nginx
7647
If there appear problems with nginx, then check that the
7748

@@ -100,18 +71,7 @@ If nothing else works, the last option is a clean reinstall of the service. The
10071

10172
## Testing
10273

103-
Changes to the main branch are automically built and deployed to: https://seattlecommunitynetwork.org/ccn-coverage-vis/
104-
105-
Once changes have been validated, they can be deployed with:
106-
107-
```
108-
ssh coverage-api.westus2.cloudapp.azure.com
109-
cd ccn-coverage-vis/
110-
git switch main
111-
git stash
112-
git pull
113-
npm install
114-
```
74+
We provide a docker compose environment for local testing. Run `docker compose up -d`, and the web server will be running on your local host at port `443`.
11575

11676

11777
# Issues

scripts/publish-docker.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import { execSync } from 'child_process';
22

3-
export default async ({ nextRelease }) => {
4-
const version = nextRelease.version;
5-
const imageName = 'ghcr.io/Local-Connectivity-Lab/ccn-coverage-vis';
3+
export default async (pluginConfig, context) => {
4+
const { nextRelease } = context;
5+
const version = nextRelease.version;
66

7-
console.log(`Building Docker image ${imageName}:${version}`);
7+
const imageName = 'ghcr.io/Local-Connectivity-Lab/ccn-coverage-vis';
88

9-
execSync(`docker build -t ${imageName}:${version} .`, { stdio: 'inherit' });
10-
execSync(`docker tag ${imageName}:${version} ${imageName}:latest`, { stdio: 'inherit' });
11-
execSync(`docker push ${imageName}:${version}`, { stdio: 'inherit' });
12-
execSync(`docker push ${imageName}:latest`, { stdio: 'inherit' });
13-
};
9+
console.log(`Building Docker image: ${imageName}:${version}`);
10+
11+
execSync('make build', { stdio: 'inherit' });
12+
execSync(`docker tag ${imageName}:${version} ${imageName}:latest`, { stdio: 'inherit' });
13+
execSync(`docker push ${imageName}:${version}`, { stdio: 'inherit' });
14+
execSync(`docker push ${imageName}:latest`, { stdio: 'inherit' });
15+
};

0 commit comments

Comments
 (0)